[BUG][PLAYER] After hitting replay button: Terrain did not reset

Started by IchoTolot, September 20, 2016, 09:16:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchoTolot

It seems this is still buggy, only this time the simple replay button is enough and not just the load savestate one. (Compare: http://www.lemmingsforums.net/index.php?topic=2877.0)

I don't know if this can be reproduced the same way. I was just playing and encountered this again ---> quick  post ;P 


Example picture attached!

namida

I cannot reproduce this on either stable V1.47n-C2 or experimental 1.47n-D:FC73BC8.

Could you please confirm which version this happened on for you? If you can remember any other details, that would be helpful too. In particular, was the terrain actually absent (ie: lemmings could walk through the holes that shouldn't be there), or was it purely graphical?
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)

IchoTolot

Version: V1.47n-C

The terrain was indeed absecent, but sadly I cannot remember the exact reproducing procedure. I was in pure solving mode when I just noticed that sth's wrong and I was only focused on my solving procedure ;P

namida

I'm still not able to reproduce this on any recent version.

It won't be dependant on whether or not you've made your own save state. Self-made "save states" simply work on the basis of "remember the frame number", then a load state is treated as a backwards (or forwards, if applicable) jump to that exact frame, via the same methods that would be used for a relative jump or a full restart (the latter is, on a technical level, simply a backwards frameskip to frame 0).

I do notice that your image only has destructive skill remains visible. Did the constructive skill ones disappear correctly, or only graphically? (Or were there none involved in the first place?)
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)

IchoTolot

Quote from: namida on September 21, 2016, 01:41:42 AM
I'm still not able to reproduce this on any recent version.

It won't be dependant on whether or not you've made your own save state. Self-made "save states" simply work on the basis of "remember the frame number", then a load state is treated as a backwards (or forwards, if applicable) jump to that exact frame, via the same methods that would be used for a relative jump or a full restart (the latter is, on a technical level, simply a backwards frameskip to frame 0).

I do notice that your image only has destructive skill remains visible. Did the constructive skill ones disappear correctly, or only graphically? (Or were there none involved in the first place?)

I did not use a save-state, I just pressed "R" for replay. I did not used constructive skills.

I will keep my eyes open if it happens again and try to make a reproduction recipe. :)

Also if somebody else encounters this please post it here.

IchoTolot

This still occurs in 1.47 D! 

I had another instance of this while playing a long level rank 5 level 1 from Wafflems/Flopsys collab beta. I was not able to reproduce that, but now I have encountered another instance which I am able to reproduce and this could also help fining the source of the problem in the long "normal level".  "Normal" you may ask? Yes the level I am able to reproduce this is rank 1 level 6 from the same collab pack beta has no entrances just pre-placers.


Reproducing:

- go into the level and immidiatly pause
- create a replay by assining for example a miner and pause
- press R to replay, the game is still paused (important as the next assignment has to be on the first frame!)
- assign preferably a miner on the most left lemming to get the best visualisation
- after some time press R again ----> terrain is still removed!

Also works on all other-preplacers only levels where you can assign in the first frame!

As I checked in the editor this also works with a save state and going back to it! (preplacers only) :

(- make a savestate
- assign a skill after that
- pause and load the state --> terrain still removed)


ok this is still not the right reliable way to reproduce it, but I was also possible with savestate + creating a replay + pausing + returning to it :(   And I am pretty sure the buggy savestates + savestate load is the reason this is possible on "normal levels" as well! + maybe some instances of R pressing


The first way of reproducing only works on the level with pre-placed lemmings only!
But it also happens in a long normal level after a longer playtime while again pausing, framestepping and R pressing. This I am still not able to reproduce consistantly sadly :(

Hope the first way of reproducing leads to the root for all of those problems!


namida

I've managed to reproduce this myself now. I also have an idea of what may be causing it, but haven't looked into the code yet.
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)

namida

The cause of this, as I suspected, was that in some conditions, a save state may be ignored in favor of an earlier one, even if a later one might be suitable. Specifically, this would happen if there was a skill assignment on the exact frame of the saved state; I vaguely remember this being implemented due to a bug occuring when such a state was used, but it appears that removing that check no longer causes issues (probably due to the overhaul of how replays vs current state is handled in V1.47n-D / V1.48n). But if for some reason, the frame 0 save state gets considered irrelevant, there isn't one, so it runs the same routine that would start the level for the first time. In the past, this was much slower, which is why it would be avoided. In the current version, this does not render the terrain at all; the rendering instead occurs only once on the preview screen. Thus, the terrain-removed version would be kept, because there's nothing overwriting it.

Simply removing this check appears to fix the bug, at least as far as the reproducible method you mention goes.

The only other cause I could think of is if the frame-zero save state gets purged for some reason, but I can't think of anything that might be triggering this. Thus, it's possible the alternate form of this bug is still out there. (EDIT: One possibility; I think the bug would probably also trigger if you activated the nuke (irrelevant, since this would still require preplaced lemmings otherwise the level would immediately end) or changed the release rate (this one is very relevant) on frame 0, thus allowing you to trigger this bug without preplaced lemmings. The same fix will fix this too. EDIT again: Confirmed, a release rate change on frame 0 would also trigger this bug.)

At any rate, here's an update to the experimental (V1.48n:0EE0B9B) that should at least fix the reproducible version: https://www.dropbox.com/s/o1r8mdzkyml7y5l/NeoLemmix.exe?dl=1 (This experimental is otherwise unchanged from the previous one.)
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

Awesome. Such a hallmark code improvement, you can remove old workarounds and a bug with the same deletion. 8-)

-- Simon