Double assignment -> broken replay (fixed)

Started by IchoTolot, September 05, 2015, 05:04:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchoTolot

Simon here, playing Ichotolot's levels.

Bug in editor playtest mode: Double assignment isn't remembered in replay.

How to repro:
- pause
- RMB on lemming A to highlight
- RMB on skill to assign to highlit lem A. This will not advance physics.
- LMB on different lem B. This will advance physics.
- Unpause, play on.
- Hit Numpad-Minus to go back in time.
- The assignment B is not in the replay anymore.

-- Simon

namida

The glitch here is the double assign in a single frame.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Simon

#2
Quote from: namida on September 05, 2015, 10:58:38 PM
The glitch here is the double assign in a single frame.

Yeah, either support it fully or disable it completely.

We were able to desync physics and replay even without same-frame assignments:

- pause
- assign miner to lem A
    -- Expected and observed: physics advance, sound plays, A becomes miner
- press [B] to go back in time by 1 frame
- assign miner to lem B different from lem A
    -- Expected: Either double assignment (which you don't want) *or*
        the now-pending assignment to A is cancelled from replay and physics,
        then physics advance, and B will become miner
    -- Observed instead: physics advance, no assign sound plays at all,
        assignment to B is ignored completely by the physics,
        and A becomes miner again
- assign miner to lem B again
    -- Expected and observed: physics advance, sound plays, B becomes miner.
        A continues to mine. B's animation is one frame behind that of A,
        because we have assigned to B one frame later than to A.
- press [pad-minus] to go back a second, to a point in time way
    earlier than A's assignment
- unpause and watch our recording
    -- Expected: First A, then B get an assignment
    -- Observed instead: only the assignment to B is replayed

There is a variant of this.

- pause
- assign miner to lem A
- press [B] to go back in time by 1 frame
- assign miner to lem B different from lem A
    -- same as above so far, same discrepancy in expected/observed behavior
- press [pad-minus] to go back a second, before A's assignment
- unpause and watch our recording
    -- Expected: assignment to A at the proper point in time
    -- Observed instead: no assignment to A ever happens

Or even:

- pause
- assign miner to lem A
- press [B] to go back in time by 1 frame
- assign miner to lem B different from lem A
    -- same as above so far, same discrepancy in expected/observed behavior
- unpause, watch A mine for 5 seconds
- press [pad-minus] to go back a second
    -- Expected: A is still miner, and the miner tunnel got shorter than it
        was before we pressed [pad-minus].
    -- Observed instead: A didn't get any assignment 4 seconds ago,
        and is a walker. By now, he's walked somewhere completely different.

This is a source of erroneous replay files without being able to notice they're erroneous.

Players can produce a replay that misses some assignments, but don't notice it, because they never hit [B]/[R]/[pad-minus]. The physics don't match what will be saved to file.

-- Simon

<SimonN> Akseli: do you remember whether this [bug described in this post] was already in vanilla Lemmix?
<Akseli> I don't think so, didn't encounter this in Lemmix
<SimonN> hmm, it might be worthwhile to add this, so he can better guess where the bug was introduced