[BUG][PLAYER] Spearer/Grenader can throw through walls

Started by IchoTolot, November 22, 2020, 07:46:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchoTolot

Currently the spearer can throw through a 5 pixel wall and the grenader through a 1 pixel wall in front of a lem.

Both terrain checks should start at the lem's x coordinate to prevent this.

It is also possible to throw through a thin ceiling if the lem is directly under it. This is a result because the lemming is the "feet" and the projectile starting higher at the hand.

I dicussed this with namida and we tend to only check a few pixels below the projectile to throw out extreme cases and let throwing through very thin ceilings directly at the lemming's foot be possible - an example where this is also possible would be the climber being able to climb through rough terrain sticking out at the base. So it is consistent with that.

Visualization:



So we would allow throwing through this and hitting ceilings would start if we move the upper pole a few pixels upwards.



In any case throwing through thin walls before the lem should always be prevented!

Side note: The "razor's edge" trick is possible with the spearer and if you throw it at a 1 pixel thin wall it gets stuck with 1 pixel sticking out. ;)   That is indeed consistent with builder, platformer, stacker,....

namida

The overall proposal I've put forward here is:
- Start terrain checks when the projectile's pin has the same X coordinate as the lemming itself. (Current behavior: Terrain checks start when the projectile leaves the lemming's hand)
- On this first frame where terrain checks occur, do some additional checks below the projectile's position. Exact distance covered is TBD by experimentation. The projectile's position will not change in response to these checks, but if terrain is detected, the projectile "hits" immediately at its normal location for that 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)

namida

Note to self: Test any fix with potential Cloner edge cases.
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

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)