Author Topic: [BUG][PLAYER] Spearer/Grenader can throw through walls  (Read 923 times)

0 Members and 1 Guest are viewing this topic.

Offline IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
[BUG][PLAYER] Spearer/Grenader can throw through walls
« on: November 22, 2020, 07:46:08 PM »
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,....

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Spearer/Grenader can throw through walls
« Reply #1 on: November 22, 2020, 07:52:00 PM »
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 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] Spearer/Grenader can throw through walls
« Reply #2 on: December 05, 2020, 03:03:55 AM »
Note to self: Test any fix with potential Cloner 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] Spearer/Grenader can throw through walls
« Reply #3 on: December 05, 2020, 03:33:12 AM »
Change implemented in commit 2fc4387.
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)