Author Topic: [Bug][Player] Double assignments are still possible via replay file editing  (Read 1586 times)

0 Members and 1 Guest are viewing this topic.

Online IchoTolot

  • Moderator
  • Posts: 1862
    • View Profile
I solved a certain old format contest level exploiting this behavior. ;) This is still possible in new format NL though as the replay format didn't change.

Reproducing:

- Load a level.
- Assign a skill to a lemming.
- Assign a 2nd skill on the very next frame (for simplicity purposes) to another Lemming.
- Save the replay.
- Close NL and open the replay file with a texteditor.
- Look at the 2 skills assigned and change the frame of the 2nd skill to the frame of the first, while updating the 2nd Lemming's position to the position the Lemming had on the frame before:

Example:

Original file:

$ASSIGNMENT
  FRAME 85
  LEM_INDEX 1
  LEM_X 111
  LEM_Y 135
  LEM_DIR left
  ACTION builder
$END

$ASSIGNMENT
  FRAME 86
  LEM_INDEX 0
  LEM_X 209
  LEM_Y 151
  LEM_DIR right
  ACTION basher
$END

After editing:

$ASSIGNMENT
  FRAME 85
  LEM_INDEX 1
  LEM_X 111
  LEM_Y 135
  LEM_DIR left
  ACTION builder
$END

$ASSIGNMENT
  FRAME 85
  LEM_INDEX 0
  LEM_X 208
  LEM_Y 151
  LEM_DIR right
  ACTION basher
$END

(I've attached an example file where the first 2 assignments are a double assign)

NL will accept and load the edited file and assign both skills in the same frame to their respective Lemmings. ;)

Fix proposal:

If we have multiple assignments in the same frame in a replay file: Only execute the first assignment, while all other assignments in the same frame will be ignored.

This fix will therefore trigger no NL error and it won't be noticable. This is only discovered anyways if a user deliberatly edits a replay file to do this, as double assignments are otherwise forbidden in the player.

Offline Nepster

  • Moderator
  • Posts: 1805
    • View Profile
Haven't yet tried to reproduce it, but here is already one change to the fix proposal:
While only the first assignment should be applied, the others should be queued instead of being ignored. This is more keeping in line with our desire to try to make the best out of a malformed replay file.

I thought we were already doing that, but perhaps some of the bug-fixes in the last two or three versions have messed with this... or I am just remembering dreams :P

Online IchoTolot

  • Moderator
  • Posts: 1862
    • View Profile
Quote
While only the first assignment should be applied, the others should be queued instead of being ignored.

Totally fine with that. :)

Online IchoTolot

  • Moderator
  • Posts: 1862
    • View Profile
Just came to my mind:

The queued up assignments then need to be checked again if they overlap with future assignments. In that case they must be delayed even further.

Offline nin10doadict

  • Posts: 319
  • Guy who constantly misses the obvious
    • View Profile
I do agree with fixing this. It's not something that's likely to cause issues if not fixed, but imagine if someone were to make a troll level that required manually editing replays to exploit this unintended behavior...

Online IchoTolot

  • Moderator
  • Posts: 1862
    • View Profile
I do agree with fixing this. It's not something that's likely to cause issues if not fixed, but imagine if someone were to make a troll level that required manually editing replays to exploit this unintended behavior...

Well, guess how I found this out. ;)

There is already such a level!

Offline Dullstar

  • Posts: 1581
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
There is already such a level!


Now I'm curious as to how that would even work.

Offline namida

  • Administrator
  • Posts: 8576
    • View Profile
    • NeoLemmix Website
Alright, that's one case where I wouldn't at all have a problem with a player update breaking the level - after all, it clearly abuses a completely and obviously unintended mechanic. Boo to whoever thought that was a good idea. Boo.
My released level packs:
Lemmings Plus Series | Doomsday Lemmings

Online IchoTolot

  • Moderator
  • Posts: 1862
    • View Profile
Now I'm curious as to how that would even work.

Basically 2 lemmings are at a position where they MUST be assigned a skill in exactly the same frame. And it has to be in these exact positions for both lems.

Otherwise you will have to assign an extra walker which will make all other attempts come short by a skill.