[BUG][Player] Step-up through an 8 pixel steel ceiling possible with stacker

Started by IchoTolot, October 11, 2022, 11:38:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchoTolot

I found the following:

When you have an 8 pixel steel ceiling it should be impossible to step through it.

Now in the attached test level you have a ground floor 4 pixel under said steel ceiling.

The stacker is placed in a location that is timed perfectly so that a lemming that steps up (I think from the right) becomes weirdly stuck inside the ceiling way higher as he should be and as a result stepping up through it.

I don't know exactly what goes wrong here though, but it should be a bug 100%. ???

namida

Haven't had a chance to watch it yet, but from the description I can both guess why it happens and confirm it's a bug - it's (I suspect) basically a far more limited form of L1's sliding glitch, and could likely also be pulled off in a similar fashion with a 1px notch just below the ceiling.
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

Modified version of your test level that only has 2 lemmings with a precisely-timed RR, rather than a constant RR99 stream. This makes it easier to see what's going on. Beyond creating this variation (and confirming I can reproduce it), haven't looked into the cause 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

Okay so looking at this - this is a really tricky situation that I don't know if there's any good answer to "what should happen?".

Here's what happens:

1. Lemming A turns around at the wall and immediately is assigned a Stacker.

2. Lemming B steps up and walks over the incomplete stack, and turns around at the wall.

3. Lemming B encounters the stack, at this point 3 pixels tall, and begins to ascend.

4. As Lemming B is ascending, Lemming A places the 4th brick, sealing the gap between the ground and the wall above.

5. Lemming B continues to ascend. Because ascenders don't check for overhangs (only for a gap, or for reaching the 6px maximum ascend distance), he continues to ascend until he has ascended a total of 6 pixels.

6. Lemming B turns around and becomes a faller, as is the behavior for a lemming that ascends 6 pixels without encountering a gap where he can become a walker.

7. Lemming B immediately detects terrain below him (as he's 1px inside the overhang) so becomes a walker.

8. Lemming B has >6 pixels in front of him so cannot ascend, so turns around.

9. Lemming B has exactly 6 pixels in front of him so can ascend, and does so.

This would also confirm my theory that you could do it similarly with other skills + a small nook; but somewhat disproves the comparison to sliding - the lemming is not ascending further than he otherwise should be able to; it's just a very specific setup where he manages to ascend into an awkward spot, from which he can ascend a second time, to ultimately still only clear the normal distance expected from two ascends - 12 pixels.
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

I think get the behavior.

Normally I thought it was a rule that a lemming can step through a thin ceiling. In reality it is just a general example of the ascending behavior:

- A lemming walking through a 1 pixel line of empty space can step up through a thin ceiling. The step up can be up to 6 pixels and as he still needs to ascend through the empty space the ceiling can't be 6 pixels.

Here we have the extreme case that a lemming is already inside terrain and steps up 6 pixels again.  Especially he having 6 pixels of solid (steel) terrain above (not infront of) him is the counterintuitive thing .

If there is a problem to solve it would be this part maybe - the way he initially already gets 2 pixels inside the ceiling and later just going through 6 solid terrain pixels above him - by just ignoring all overhangs while ascending:

Quote5. Lemming B continues to ascend. Because ascenders don't check for overhangs (only for a gap, or for reaching the 6px maximum ascend distance), he continues to ascend until he has ascended a total of 6 pixels.

I think this could be a very far reaching physics change though as it would affect general common behavior and maybe is another case of "things new engines will need to think about".

At least, I would advocate for a "please do not rely on this!" warning. As without in-depth knowledge of the inner workings no one would consider this possible and even in an "Expert" rank it would be highly unfair (+ extremely precise), at least in in my opinion! :)

namida

Yes, I would agree with that. I'm just not sure what can be changed here to make this not happen, without breakage elsewhere or an also-buggy (or at least also-unintuitive) outcome. Leaving the topic open in case any good ideas come up, though.
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

Some thoughts from Discord. Will type out proper details later; for now here's a screenshot.
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

To elaborate on the above:

My first thought in those messages, was a purely hypothetical idea about using NL's "predict the future" code (which is based on simulating a lemming's actions; generally used for skill shadows, but also occasionally used in physics too), to terminate the ascender if it will reach the 6 pixel maximum distance without finding a spot it can transitition back to a walker. This has to be ruled out in practice due to that the simulation code is only designed to simulate a single lemming at a time (plus passive effects, eg. blocker fields, from other lemmings), but this case - as it relies on other lemmings adding / removing terrain while the lemming is ascending to trigger it - would require simulating multiple. Aside from the code not supporting that, the performance impact of this would be very significant on any frame where an ascender is active (or even being simulated, during eg. projection shadows). This approach therefore must be ruled out.

Next idea is, if an ascender fails to ascend (and thus transitions to a faller), give this faller a special property where it will ignore solid terrain until it has detected at least one pixel of empty space (or, by implication, fallen back to where it started ascending from). I don't like this; it's an ugly edge case behavior. A bit less of an issue if we introduce it through a seperate state (like a "descender" rather than being a faller), but that would cause issues for custom lemming sprites and be a pain to implement, all for a tiny edge case.

After this, the possibility of simply accepting this outcome is suggested; it would be the kind of behavior that's discouraged in level design, but a concern is that the outcome could still arise unintentionally when stacking inside a 4-pixel tunnel - a lemming arriving at the might time may end up stuck in the ceiling, or stepping up through it if it's thin ehough (ie: total distance from the floor to the *top* of the ceiling is 12 pixels or less), even if the level designer didn't intend or even anticipate it.

One last thought that came to mind later, was to have an edge case rule where a failed ascender is immediately moved downwards to the nearest pixel of empty space (subject to not moving below where he started from). This would feel a bit "jumpy" in some cases, and it is an edge case, but it's a relatively contained one and may be the best way to deal with this problem.
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

QuoteOne last thought that came to mind later, was to have an edge case rule where a failed ascender is immediately moved downwards to the nearest pixel of empty space (subject to not moving below where he started from). This would feel a bit "jumpy" in some cases, and it is an edge case, but it's a relatively contained one and may be the best way to deal with this problem.

I implemented this in commit 848f864. I ran mass replay tests on Lemmings Plus I, II, Omega II and Alpha, and none broke. I suspect breakage will be very rare if it happens at all. The actual behavior doesn't feel too bad, no worse than some of the other "jumpy" cases that exist in physics already.

I may revert this (and go with "just accept that this happens") if breakage starts to show up during the RC phase.
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)