Aleph-Bet-Marathon / alephbet

Open source continuation of the Marathon 2 game engine.
GNU General Public License v3.0
0 stars 4 forks source link

Safety valve to prevent dead players’ souls from getting trapped on bouncy ledges #34

Open aaronfreed opened 2 months ago

aaronfreed commented 2 months ago

Migrating from upstream issue that I’m sure they will never address.

Solra wrote:

When a player is killed, they can press the action key to respawn or reload from save—but only once their velocity has settled to zero. There are certain situations a player can die in which will prevent their velocity from ever settling down, such as certain "bouncy" map geometry, or platforms with exactly the right parameters. While these maps ought to be fixed, it would be infeasible to track down every single edge case in Marathon's physics, and it would be nice to prevent this entire class of softlock instead.

The solution that comes to my mind is allowing the player to respawn if it's been 15 seconds since they died, even if their velocity hasn't settled. The main obvious downside of this that I can see is that we then have to figure out where to put their death drop items. (Fortunately, there are already lots of other cases where we get weird about death drop items. :P)

My response was:

My immediate inclination is to suggest putting their death drop items at exactly the floor of whatever polygon their corpse is in at respawn time. This would be slightly weird in some cases, but any other option I can think of would be much weirder.

Since this would remove one of many reasons I’ve needed to write stupid Lua scripts that I never felt entirely good about, I’m naturally in full support of this idea. If need be, I’d be fine with some sort of parameter to enable or disable it if we’re worried about breaking scripts that rely on preventing players from respawning.

Solra replied:

Scripts can prevent players from respawning by blocking the action key press.

I responded:

Good point – people can just update scripts if they break, and now that we have map-specific plugins, it doesn’t even matter if map authors refuse to update their maps and refuse to offer permission to anyone else to do so either.

EDIT: …this is less true than I thought, since there can only be one TEXT resource 128, and <marathon_levels> can only exist in TEXT resource 128. Which is a bit of a problem.

I think there may now be an override for the latter, but I’m not really sure – it’s worth double-checking.

It is, in fact, very easy to create a map that will cause this problem – just make a right-angle corner that is 0.75 WU tall and walk up to it. I’ve included an example: cursed bouncy walls.sceA.zip