[ZScript] Quake-style movement - v2.0.2

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm

[ZScript] Quake-style movement - v2.0.2

Post 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:
Last edited by dodopod on Wed Jul 10, 2019 4:11 pm, edited 6 times in total.
User avatar
luigiman0640
Posts: 98
Joined: Mon Apr 28, 2014 6:18 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: [ZScript] Quake-style movement

Post by luigiman0640 »

The link seems to be a bit... not found? I got a 404 error.
User avatar
Nash
 
 
Posts: 17296
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Quake-style movement

Post by Nash »

dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm

Re: [ZScript] Quake-style movement

Post 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.
User avatar
luigiman0640
Posts: 98
Joined: Mon Apr 28, 2014 6:18 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: [ZScript] Quake-style movement

Post by luigiman0640 »

Awesome, thanks!
User avatar
luigiman0640
Posts: 98
Joined: Mon Apr 28, 2014 6:18 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: [ZScript] Quake-style movement

Post 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.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm

Re: [ZScript] Quake-style movement

Post 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.
User avatar
RiboNucleic Asshat
Posts: 501
Joined: Thu May 09, 2013 8:15 pm
Graphics Processor: nVidia with Vulkan support
Location: Exactly where I am

Re: [ZScript] Quake-style movement

Post 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.
User avatar
luigiman0640
Posts: 98
Joined: Mon Apr 28, 2014 6:18 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: [ZScript] Quake-style movement

Post 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.
Beezle
Posts: 139
Joined: Thu Aug 16, 2018 6:48 pm

Re: [ZScript] Quake-style movement

Post by Beezle »

I guess the obvious question would be... Can you rocket jump like in Quake?
User avatar
BROS_ETT_311
Posts: 177
Joined: Fri Nov 03, 2017 6:05 pm

Re: [ZScript] Quake-style movement

Post 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.
User avatar
Nash
 
 
Posts: 17296
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Quake-style movement

Post 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?
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm

Re: [ZScript] Quake-style movement

Post 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.
User avatar
Nash
 
 
Posts: 17296
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Quake-style movement

Post 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.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm

Re: [ZScript] Quake-style movement

Post 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.

Return to “Script Library”