Add support for jumping
Brought to you by:
e6y
Hi Andrey,
having played chocolate-strife for several hours, I felt like adding support for jumping to prboom-plus. It's bound to the same key as fly-up, but only works if the fly cheat is disabled. The actual value for mo->momz is taken from chocolate-strife. Jumping should probably be forbidden when recording demos and in certain compatibility modes, but I am not sure about that.
I have just checked in chocolate-hexen and it seems that Hexen uses a slightly different algorithm for jumping, introducing jumptics to force a short delay between jumps and setting momz to 9 * FRACUNIT instead of adding 8 * FRACUNIT.
Algorithm for jumping takes two lines of code, heh. I think it could be tweaked. For example you can't jump to plasma gun (in multiplayer) on map01 if you are standing closely to sector with it
It just adds vertical momentum, the ballistic curve is calculated by the engine. You need to walk/run towards the plasma gun in map01 and then press jump in order to get it. That's how it works in Hexen/Strife as well, just try it out.
Relevant code in Hexen:
https://github.com/chocolate-doom/chocolate-doom/blob/master/src/hexen/p_user.c#L752
Now I see your point, Andrey! In Hexen the player has some in-air control: In P_MovePlayer [p_user.c:204f] there is an "else"-branch to the "if (onground)" check that is missing in Doom and thus prboom-plus. It allows the user to gain some thrust while he is not on the ground, i.e. jumping or falling. Strife has similar code, but forbids side steps while in air.
I think it would be possible to implement both jumping styles in prboom-plus and give the user a choice between them. In-air control should however get disabled during demo recording and playback!
Why only this? Jump are not possible in Doom, so they should be disabled in any case.
Last edit: Andrey Budko 2013-12-13
Heh, the same is true for mouse look, crosshair and many of the other advanced features of prboom-plus.
So, won't you accept a patch to enable jumping at all?
Mouse look, crosshair and many of the other advanced features are "visual" features and have no side effects. How you will play demo with jumps with previous version of prboom? Demos recording/playback is the reason why prboom/+ exists.
I think I can add it with checking some new config variable which has no entry in GUI and with checking for demorecording of course.
This draft introduces the movement_jumpstyle variable. If set to 1, the player jumps as in Hexen; if set to 2, the player jumps as in Strife. Most people will want the jumping as in Hexen (and in ZDoom), so I left the Strife option undocumented.
Last edit: Fabian Greffrath 2013-12-13
now i can jump to plasma gun from closest position with both styles. it is ok, right?
Yes, both styles allow for minimal in-air control and differ only in details.
Applied, thanks!
Great, thanks!