Page 1 of 4

[ZScript] Quake-style movement - v2.0.2

Posted: Sat Jan 19, 2019 4:23 pm
by dodopod


This script modifies GZDoom's movement code (which is conveniently written in ZScript, now) to more closely resemble Quake. This means slower, less slippery movement (similar to Nash's mod) and strafejumping (which can be turned on/off with a CVar), among other things.

Features:
  • Slower movement (320 UPS)
  • Higher default friction
  • Strafejumping
  • CVars to enable/disable straferunning and strafejumping (G_Straferunning and G_Strafejumping, respectively)
  • Speedometer (enabled with CG_Speedometer 1)
  • Strafejump bot (enabled with HelpMeMommy 1; requires SV_Cheats 1, of course)
  • Quake-style weapon and view bob
Gitlab Repo
Download:

Re: [ZScript] Quake-style movement

Posted: Sat Jan 19, 2019 10:17 pm
by luigiman0640
The link seems to be a bit... not found? I got a 404 error.

Re: [ZScript] Quake-style movement

Posted: Sat Jan 19, 2019 10:28 pm
by Nash

Re: [ZScript] Quake-style movement

Posted: Sat Jan 19, 2019 10:51 pm
by dodopod
luigiman0640 wrote:The link seems to be a bit... not found? I got a 404 error.
Sorry about that. It's fixed, now.

Re: [ZScript] Quake-style movement

Posted: Sat Jan 19, 2019 11:24 pm
by luigiman0640
Awesome, thanks!

Re: [ZScript] Quake-style movement

Posted: Sun Jan 20, 2019 4:26 am
by luigiman0640
So apparently, having a class that inherits DoomPlayer doesn't take the new QuakePlayer class into account, causing the class to move 2-4 UPS, aka, literally a snail's pace. Dunno why that is exactly, tho.

Re: [ZScript] Quake-style movement

Posted: Sun Jan 20, 2019 12:09 pm
by dodopod
luigiman0640 wrote:So apparently, having a class that inherits DoomPlayer doesn't take the new QuakePlayer class into account, causing the class to move 2-4 UPS, aka, literally a snail's pace. Dunno why that is exactly, tho.
The default friction in Doom is very low, which makes movement slippery, compared to Quake. To compensate, I increased the default friction considerably. But the way that friction works in GZDoom makes high friction surfaces sticky, like walking through mud. You can increase DoomPlayer's Player.ForwardMove or Speed properties to move faster, but it will still feel sticky, since you can't accelerate as fast.

Re: [ZScript] Quake-style movement

Posted: Sun Jan 20, 2019 5:43 pm
by RiboNucleic Asshat
Oh wow, this actually fixes one of my biggest problems with GZDoom's default movement: the delay after landing before you can jump again. It's not quite *exactly* like quake's movement, and I certainly wouldn't expect you to get it 100% perfect, but it feels a damn sight better than before. This would go great with Quake-inspired gameplay mods/maps.

Re: [ZScript] Quake-style movement

Posted: Sun Jan 20, 2019 9:28 pm
by luigiman0640
dodopod wrote:
luigiman0640 wrote:So apparently, having a class that inherits DoomPlayer doesn't take the new QuakePlayer class into account, causing the class to move 2-4 UPS, aka, literally a snail's pace. Dunno why that is exactly, tho.
The default friction in Doom is very low, which makes movement slippery, compared to Quake. To compensate, I increased the default friction considerably. But the way that friction works in GZDoom makes high friction surfaces sticky, like walking through mud. You can increase DoomPlayer's Player.ForwardMove or Speed properties to move faster, but it will still feel sticky, since you can't accelerate as fast.
True, but any mod that makes a new class that inherits from DoomPlayer won't work out of the box with the pk3 and will need some sort of new version with the movement mod built in. I understand if this is your intention or you just couldn't find a way to make it work, since it'd really just be a ease of life thing, but I feel a lot of people would enjoy it like that.

Re: [ZScript] Quake-style movement

Posted: Mon Jan 21, 2019 3:43 am
by Beezle
I guess the obvious question would be... Can you rocket jump like in Quake?

Re: [ZScript] Quake-style movement

Posted: Tue Jan 22, 2019 11:35 pm
by BROS_ETT_311
Beezle wrote:I guess the obvious question would be... Can you rocket jump like in Quake?
Plus a little bit of air control and I'd say this just about nails it.

Re: [ZScript] Quake-style movement

Posted: Wed Jan 23, 2019 12:26 am
by Nash
Suggestion: you should make the viewbob and also the weapon bob match Quake's... IIRC these have also been virtualized in PlayerPawn...

Also: is the "friction = 0" assignment in the TERRAIN lump necessary? Could +NOFRICTION be used instead?

Also also: does this fix Doom's weird discrepancy with forwardmove and sidemove being scaled differently? Graf added this for mods, would this help?

Re: [ZScript] Quake-style movement

Posted: Fri Jan 25, 2019 5:03 pm
by dodopod
luigiman0640 wrote:True, but any mod that makes a new class that inherits from DoomPlayer won't work out of the box with the pk3 and will need some sort of new version with the movement mod built in. I understand if this is your intention or you just couldn't find a way to make it work, since it'd really just be a ease of life thing, but I feel a lot of people would enjoy it like that.
Well, I primarily made this as part of a TC, where QuakePlayer is an ancestor of the main player class. Given that, I think this was the right way to structure it. It shouldn't be too hard to modify this PK3 to work with other mods, though -- you just have to make QuakePlayer descend from whatever the mod's player class is, instead of DoomPlayer.
BROS_ETT_311 wrote:Plus a little bit of air control and I'd say this just about nails it.
I just changed air movement to be more similar to Quake 3. I'm not sure how to make it gel with sv_aircontrol or the MAPINFO setting, though.
Nash wrote:Suggestion: you should make the viewbob and also the weapon bob match Quake's... IIRC these have also been virtualized in PlayerPawn...
I think I could do that. Pretty sure BobWeapon and CalcHeight are the methods to override. I could make Player.BobStyle "Normal" work like Quake, and then Player.BobStyle "Doom" would revert to the original behavior.
Nash wrote:Also: is the "friction = 0" assignment in the TERRAIN lump necessary? Could +NOFRICTION be used instead?
I forgot +NOFRICTION was added. Definitely works better than trying to cancel out the friction, which is what I was doing.
Nash wrote:Also also: does this fix Doom's weird discrepancy with forwardmove and sidemove being scaled differently? Graf added this for mods, would this help?
It doesn't, yet. I'll see about NormForward/SideMove. Quake normalizes inputs to [-127, 127], so maybe I could try doing that.

Re: [ZScript] Quake-style movement

Posted: Wed Feb 20, 2019 8:14 am
by Nash
Hey dodopod, good work with the recent changes. It's starting to feel more and more awesome. :)

I have another small suggestion: in CalcHeight, instead of assigning pitch and roll directly, use A_SetPitch/Roll(<angle>, SPF_INTERPOLATE) ... this will eliminate camera jitter and make the view movement interpolate. :D

Some more suggestions (although I'm not sure how many of these would be relevant to your design goals)

- Able to choose bobbing pattern between Quake's inverted U or Doom's default U pattern
- movebob CVar doesn't seem to affect bobbing anymore

Also found a bug: it seems player pawn's sprite doesn't leave running animation even when they're not moving anymore. Can be see in chasecam mode.

EDIT:

Another bug: using toggled crouching completely bypasses your custom crouch code.

Re: [ZScript] Quake-style movement

Posted: Wed Mar 06, 2019 3:23 pm
by dodopod


Version 2.0 is out! This release adds Quake-style view and weapon bob, as well as footstep sounds. There are 3 variants of this release: the main release is what you want if you want to incorporate Quake-style movement into your own mod. The GZDoom v3.8 variant includes features only present in the upcoming version of GZDoom -- specifically, it makes the player walk at the same speed when moving forward vs. strafing. In the Doom mod variant, QuakePlayer inherits from DoomPlayer, allowing this script to be used directly as a Doom mod. If you just want to play Doom with Quake-style movement, this is your download.

See the first post for links.