[ZScript] Quake-style movement - v2.0.2

Post your example zscripts/ACS scripts/etc here.

[ZScript] Quake-style movement - v2.0.2

Postby dodopod » Sat Jan 19, 2019 4:23 pm



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.
dodopod
 
Joined: 04 Oct 2017

Re: [ZScript] Quake-style movement

Postby luigiman0640 » Sat Jan 19, 2019 10:17 pm

The link seems to be a bit... not found? I got a 404 error.
User avatar
luigiman0640
 
Joined: 29 Apr 2014

Re: [ZScript] Quake-style movement

Postby Nash » Sat Jan 19, 2019 10:28 pm

User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: [ZScript] Quake-style movement

Postby dodopod » Sat Jan 19, 2019 10:51 pm

luigiman0640 wrote:The link seems to be a bit... not found? I got a 404 error.


Sorry about that. It's fixed, now.
dodopod
 
Joined: 04 Oct 2017

Re: [ZScript] Quake-style movement

Postby luigiman0640 » Sat Jan 19, 2019 11:24 pm

Awesome, thanks!
User avatar
luigiman0640
 
Joined: 29 Apr 2014

Re: [ZScript] Quake-style movement

Postby luigiman0640 » Sun Jan 20, 2019 4:26 am

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.
User avatar
luigiman0640
 
Joined: 29 Apr 2014

Re: [ZScript] Quake-style movement

Postby dodopod » Sun Jan 20, 2019 12:09 pm

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.
dodopod
 
Joined: 04 Oct 2017

Re: [ZScript] Quake-style movement

Postby RiboNucleic Asshat » Sun Jan 20, 2019 5:43 pm

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
RiboNucleic Asshat
avatar by Skelegant
 
Joined: 10 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Quake-style movement

Postby luigiman0640 » Sun Jan 20, 2019 9:28 pm

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.
User avatar
luigiman0640
 
Joined: 29 Apr 2014

Re: [ZScript] Quake-style movement

Postby Beezle » Mon Jan 21, 2019 3:43 am

I guess the obvious question would be... Can you rocket jump like in Quake?
Beezle
 
Joined: 17 Aug 2018
Discord: #8423

Re: [ZScript] Quake-style movement

Postby BROS_ETT_311 » Tue Jan 22, 2019 11:35 pm

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
BROS_ETT_311
 
Joined: 04 Nov 2017

Re: [ZScript] Quake-style movement

Postby Nash » Wed Jan 23, 2019 12:26 am

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?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: [ZScript] Quake-style movement

Postby dodopod » Fri Jan 25, 2019 5:03 pm

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.
dodopod
 
Joined: 04 Oct 2017

Re: [ZScript] Quake-style movement

Postby Nash » Wed Feb 20, 2019 8:14 am

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.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: [ZScript] Quake-style movement

Postby dodopod » Wed Mar 06, 2019 3:23 pm



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.
dodopod
 
Joined: 04 Oct 2017

Next

Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest