[BUG][PLAYER]Lemmings can pass thorugh a steel wall in certain circumstances

Started by Armani, August 06, 2023, 08:32:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Armani


When a lemming is completely trapped inside the terrain as well as a force field, you can make him move a pixel forward by assigning him a walker no matter what.


With this bug, with enough skills and lemmings, you can get through any arbitrary thick steel wall.

level files and replays are attached.
My newest NeoLemmix level pack : Lemmings Halloween 2023 8-)

My NeoLemmix level packs(in chronological order):
  Lemmings Uncharted [Medium~Extreme]
  Xmas Lemmings 2021 [Easy~Very Hard]
  Lemmings Halloween 2023 [Easy-Very Hard]

ericderkovits

definitely bugs. should be fixed.

Tried these 2 levels and replays in Superlemmix, but the replays fail.

namida

  if (NewSkill = baToWalking) and (L.LemAction = baWalking) then
  begin
    TurnAround(L);

    // Special treatment if in one-way-field facing the wrong direction
    // see http://www.lemmingsforums.net/index.php?topic=2640.0
    if    (HasTriggerAt(L.LemX, L.LemY, trForceRight, L) and (L.LemDx = -1))
       or (HasTriggerAt(L.LemX, L.LemY, trForceLeft, L) and (L.LemDx = 1)) then
    begin
      // Go one back to cancel the Inc(L.LemX, L.LemDx) in HandleWalking
      // unless the Lem will fall down (which is handles already in Transition)
      if HasPixelAt(L.LemX, L.LemY) then Dec(L.LemX, L.LemDx);
    end;
  end;


This code, starting at line 1930 in LemGame.pas, is the relevant code. Ironically, the fix for similar behavior in one-way fields has instead enabled it on terrain - commenting out that fix, fixes this. I need to look closer at exactly what's happening here to figure out how to fix it without breaking that fix.
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

Should be fixed in commit e25c4bb.

Basically, it arose because Nepster's correction for lemmings passing through one-way fields in a manner like this, worked by cancelling out a movement that happens unconditionally for a walker. However, if the walker turns around specifically due to terrain, then this movement already gets cancelled out in the walker's update code. The double-cancel thus allowed for the result seen here.

Also - nothing is special about steel here; this bug occurred with non-steel terrain too.
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)