Author Topic: [BUG][PLAYER] Possible to seperate miner-glider from other gliders  (Read 1947 times)

0 Members and 1 Guest are viewing this topic.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Also doable with other skills, but miner is what I discovered this with (while testing to see if a certain other bug happens - the other bug I suspected did not actually happen).

See attached level for an example - assign the miner towards the right just before hitting the wall, with the first lemming (there's steel placed to prevent assigning too early for the correct position to trigger this).

After some examination of the code, I've determined the reason for this - different skills may move the lemming downwards by different amounts before transitioning to a faller, ranging from 0 to 3 pixels. This was the cause of the fall distance difference between walkers vs bashers/miners in DOS, but NL has long since fixed that side of things - splat distance is consistent. Then, the lemming pulls out the glider - theoretically - after falling 7 pixels. Even for this - NL correctly tracks it regardless of the downwards movement at the start.

The bug arises from the fact that a faller falls 3 pixels per frame, but the "do I become a glider now?" check only happens once per frame (before any downwards movement). If the downwards movement before transitioning to faller is 0 or 3,  then the lemming will fall a total of 9 pixels before transitioning (as on the first frame it will have fallen 0, the second frame 3, the third frame 6 - none of which are enough to start gliding yet); whereas if it's 1 or 2, they'll only fall 7 or 8 pixels respectively (1, 4, 7 or 2, 5, 8 respectively).

This bug also affects floaters, although the impact there is usually far more subtle - purely a matter of "the lemming might hit the ground one frame earlier or later when the bug is fixed".
« Last Edit: April 13, 2020, 03:46:19 AM by namida »
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #1 on: April 13, 2020, 03:30:11 AM »
Fixed in the "fix-wip/floater-glider-vertical-movement-fix" branch (which has a couple of commits).

I'm doing some tests myself, and asking a couple of others to test with exp builds, to determine how widespread breakage is from this. It seems to be fairly limited, so far.

From my own testing of my replay collections (I didn't test the talisman replays, but I did in some cases test alternate solution replays):

Lemmings Plus I - 4 / 150 replays broken
Lemmings Plus II - 0 / 100 replays broken
Lemmings Plus III - 2 / 64 replays broken
Lemmings Plus IV - 3 / 80 replays broken
Lemmings Plus V - 1 / 75 replays broken
Lemmings Plus VI - 1 / 169 replays broken (lots of alternate solution replays here)
Lemmings Plus Omega - 8 / 120 replays broken
Lemmings Plus Omega II - 4 / 71 replays broken (one alternate solution replay)
Lemmings Plus Alpha - 3 / 45 replays broken
Holiday Lemmings Plus - 0 / 15 replays broken (a few talisman replays got included here, though I only checked them as far as "they still pass the level", not "they get the talisman")
Doomsday Lemmings - 1 / 21 replays broken

Total - 27 / 910 replays broken (about 3% of replays)

Not ideal, but this is about the best that can be achieved while fixing this bug, without introducing lots of physics edge cases.
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #2 on: April 15, 2020, 09:15:52 PM »
I've found a bug in the implementation that may account for some of the broken replays. I've only tested Lemmings Plus I so far (will test the others later today), but fixing the bug alone improves it from 4 broken replays to only 3.

If even with the bug fixed, replay breakage is too high (in particular, one tester observed a much higher rate of replay breakage than I did, but it's unknown yet how much is due to the physics change vs how much is due to the bug), then I have a plan B here that should reduce this: Applying the fix only to Gliders, and accepting the slight discrepancy when it comes to Floaters. Ideally I'd like to be able to do the full fix, but if the broken replay cost is too great, this is an acceptable alternative as unlike with Gliders where it can affect what areas are reachable, for Floaters it's limited to very slight impacts (on the order of a single frame) on timing.
My Lemmings 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)

Offline IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #3 on: April 15, 2020, 09:25:55 PM »
As the floaters still land on the same spot and the 1 frame discrepancy is so minimal and wasn't noticed at all before, I say fix it just for the glider+miner case as there the real difference occurs with lemming seperation possibilities.

The floater replay breakage was quite common for me as just a single standard floater drop was enough to break replays. Slightly more than 10% of my United replays broke as a result.

I 100% think this must be fixed for the glider case and there we have to take the hit in replay breakage, but the 1 frame floater timing difference is not worth the hassle.

EDIT: The fix gliders only version reduces that number to less than half.
« Last Edit: April 15, 2020, 09:37:44 PM by IchoTolot »

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #4 on: April 15, 2020, 09:32:43 PM »
Bugfix (but "fix still applies to floaters too") broken replay counts:

Lemmings Plus I: 3 / 150 (-1)
Lemmings Plus II: 0 / 100 (unchanged)
Lemmings Plus III: 1 / 64 (-1)
Lemmings Plus IV: 2 / 80 (-1)
Lemmings Plus V: 1 / 75 (unchanged)
Lemmings Plus VI: 1 / 169 (unchanged)
Lemmings Plus Omega: 8 / 120 (unchanged)
Lemmings Plus Omega II: 3 / 71 (-1)
Lemmings Plus Alpha: 3 / 45 (unchanged)
Holiday Lemmings Plus: 0 / 15 (unchanged)
Doomsday Lemmings: 1 / 21 (unchanged)

Total: 23 / 910 replays broken, an improvement of 4 over previous results. Next thing is to get results for "floaters are exempt" and see how much that improves - possibly a lot, as aside from the four levels in packs that don't use gliders, there's at least one other level that I spotted during testing that immediately jumped out as "this level doesn't have gliders either".
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #5 on: April 15, 2020, 09:45:26 PM »
Broken replay counts with bugfix *and* floater exemption (comparisons are to "bugfix but floaters not exempt" counts):

Lemmings Plus I: 0 / 150 (-3)
Lemmings Plus II: 0 / 100 (unchanged)
Lemmings Plus III: 0 / 64 (-1)
Lemmings Plus IV: 2 / 80 (unchanged)
Lemmings Plus V: 1 / 75 (unchanged)
Lemmings Plus VI: 0 / 169 (-1)
Lemmings Plus Omega: 6 / 120 (-2)
Lemmings Plus Omega II: 2 / 71 (-1)
Lemmings Plus Alpha: 0 / 45 (-3)
Holiday Lemmings Plus: 0 / 15 (unchanged)
Doomsday Lemmings: 1 / 21 (unchanged)

Total: 12 / 910 replays broken, that's an improvement of 11 over the result without floaters being exempt.

One thing that came to mind is that I noticed - and thinking about the before vs after code would back this up - that some of these cases (including some, but not all, of the floater cases, should that exemption not go ahead) relate to lemmings being pre-assigned, or assigned during the initial fall from the window, these skills. A special case that ensures (at least under the most-common-situation, in particular, "no updraft, or the floater / glider is pulled out before hitting the updraft") the old timing there, too, might be worth considering. We already accept a special case with regards to the fall distance from entrances, so I feel this should be okay too if it minimizes replay breakages for this fix.

(Side note: Just to confirm, even those with 0 broken replay results in earlier tests were re-tested in the later ones, just in case.)
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #6 on: April 15, 2020, 09:52:29 PM »
Something unusual has been noted on the final level of Genocide in Lemmings United - if a lemming walks off the bottom-right while already being a glider, he now falls off the screen. In stable, he's (just) rescued by the updraft. I can reproduce this but haven't looked into the "why" yet.

EDIT: This was due to overlooking a detail of the situation there that doesn't fit the "basic situation" which was used as the reference for the consistent-across-everything behaviour. With that considered, this situation breaking (or at least possibly breaking) is expected.
« Last Edit: April 15, 2020, 10:02:56 PM by namida »
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #7 on: April 15, 2020, 11:06:54 PM »
Quote
One thing that came to mind is that I noticed - and thinking about the before vs after code would back this up - that some of these cases (including some, but not all, of the floater cases, should that exemption not go ahead) relate to lemmings being pre-assigned, or assigned during the initial fall from the window, these skills. A special case that ensures (at least under the most-common-situation, in particular, "no updraft, or the floater / glider is pulled out before hitting the updraft") the old timing there, too, might be worth considering. We already accept a special case with regards to the fall distance from entrances, so I feel this should be okay too if it minimizes replay breakages for this fix.

I pursued this, and implementing such a special case - while still keeping the fix as "gliders only" - was able to further improve my failed replay count from 12 to 10 (one less each in LPIV and LPO2).

The remaining breakages are:
- Lemmings Plus Omega: Mental 12 "Cave of the Cactus" (involves faller->glider transitions inside updrafts)
- Lemmings Plus Omega: Perplexing 20 "Current Affairs" (involves faller->glider transitions inside updrafts)
- Lemmings Plus Omega II: Spiky 14 "Don't Forget!" (unknown cause)
- Doomsday Lemmings: Apocalypse 5 "Garden Of Trauma" (unknown cause)
- Lemmings Plus Omega: Puzzling 7 "More Than Just A Dream" (involves faller->glider transitions inside updrafts)
- Lemmings Plus IV: Bumpy 15 "Munitions Deposit" (unknown cause)
- Lemmings Plus V: Outrageous 11 "Relentless" (involves faller->glider transitions inside updrafts)
- Lemmings Plus Omega: Mental 16 "Skill Factory" (likely involves nonwalker->faller transitions on gliders, but needs investigation just in case)
- Lemmings Plus Omega: Mental 9 "Stormy Ascent" (involves faller->glider transitions inside updrafts)
- Lemmings Plus Omega: Mental 30 "The Final Tower" (unknown cause)
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Possible to seperate miner-glider from other gliders
« Reply #8 on: April 28, 2020, 08:03:46 AM »
Upon reviewing the above, all of them also result from nonwalker -> faller -> glider transitions, and thus are expected potential breakages.

Commit fd25b1e has merged this fix into the master branch.
My Lemmings 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)