Extended Weapon Bobbing Properties

Moderator: GZDoom Developers

User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Extended Weapon Bobbing Properties

Post by Xaser »

Finally decided to tackle this oft-requested feature. It's a bit more polished and extensive than Ryan's patch in the linked thread (thanks for the reference though), most notably also including a "range" multiplier for the Y axis and proper savegame support.

This patch adds the following actor properties to the Weapon class:
  • Weapon.BobStyle -- The type of bobbing to use. Default is "Normal." Other types described below.
  • Weapon.BobSpeed -- Bobbing speed multiplier. Affects how quickly the bobbing motion occurs. Default is 1.0.
  • Weapon.BobRangeX -- Range multiplier for horizontal bobbing.
  • Weapon.BobRangeY -- Same as the above, only for vertical bobbing.
Weapon.BobStyle can be any of "Normal", "Inverse", "Alpha", "InverseAlpha", "Smooth", or "InverseSmooth". "Alpha" is Doom 0.4/0.5 Alpha's linear bobbing style, "Smooth" is (naturally) a smoother version of the standard bobbing style, and the Inverse types are "vertically-flipped" versions of each. Each style is distinct -- for example, though both "Inverse" and "Alpha" bob in a similar fashion, Inverse's pattern is upside-down-U-shaped while Alpha bobs linearly, like an upside-down V.

The other properties are implemented as fixed point multipliers since they either have meaningless default values as integers (speed) or are influenced by CVARs in a way that prevents integral values from being feasible (range).

Finally, here's a zip with the patch and an example wad that replaces some of the default weapons with ones that show off a variety of different bobbing types & properties:
xa-bob.zip
Extended bobbing patch + example wad.
(2.33 KiB) Downloaded 551 times
User avatar
Jimmy
 
 
Posts: 4726
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Extended Weapon Bobbing Properties

Post by Jimmy »

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :D
User avatar
Xtyfe
Posts: 1490
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Extended Weapon Bobbing Properties

Post by Xtyfe »

holy shit dipped sticks of shit, this is awesome
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Extended Weapon Bobbing Properties

Post by Graf Zahl »

Can't be added without changes since it completely ignores savegame compatibility handling.

I don't have time to fix this now so it'll have to wait.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: Extended Weapon Bobbing Properties

Post by Blue Shadow »

This's very nice indeed, though, could there be a menu option (could be in the hud menu?) to change the default bobbing style?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Extended Weapon Bobbing Properties

Post by Xaser »

Graf Zahl wrote:Can't be added without changes since it completely ignores savegame compatibility handling.
I noticed that the new Accuracy/Stamina settings have a few lines in the form of "if (SaveVersion > ####)" -- is this what you mean? I'll make the necessary changes once I figure how the save version numbering is done.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Extended Weapon Bobbing Properties

Post by Xaser »

Well, that wasn't so hard. Saving+loading between versions seems to be working fine now. Updated patch:
Attachments
xa-bob2.zip
(2.03 KiB) Downloaded 178 times
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Extended Weapon Bobbing Properties

Post by NeuralStunner »

Blue Shadow wrote:This's very nice indeed, though, could there be a menu option (could be in the hud menu?) to change the default bobbing style?
Indeed, default style and ranges. One could be rid of weaponized hypnotism on a global basis. 8-)
User avatar
Enjay
 
 
Posts: 26988
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Extended Weapon Bobbing Properties

Post by Enjay »

I like the hypnotising sway. :trippy:

Seriously, this is a welcome submission. I haven't really messed with weapon bobbing hacks at all but these options being a proper part of the game will make tailoring the weapon bob much more interesting.

I wonder, do the bobs differ between crouched and uncrouched and can they be scaled according to the speed that the player moves? I'm guessing probably not but those might be nice options at some point, if they're possible.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Extended Weapon Bobbing Properties

Post by NeuralStunner »

I think the engine somewhat scales on its own. Attempting to walk into a wall results in very little weapon movement, for example.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Extended Weapon Bobbing Properties

Post by Graf Zahl »

ok, that was better
User avatar
Nash
 
 
Posts: 17490
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Extended Weapon Bobbing Properties

Post by Nash »

Thank you so much for this Xaser! Now I don't have to rely on hard-coded stuff for my project anymore. :D

Any chance of you doing a tweakable "movebob" for the player? There are several open threads related to it...
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Extended Weapon Bobbing Properties

Post by Xaser »

It's probably possible to add as a multiplier similarly to how weapon bob is done now. At one point I was also looking at adding a way to modify player acceleration as well, and those two combined might be useful for that dungeon crawler of yours.

Don't get your hopes up too soon, though. I tend to choose very randomly what to work on at any given moment.
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Extended Weapon Bobbing Properties

Post by CaptainToenail »

Oh wow, pure sex. :)

I expect this to be a staple of all weapon mods now. This could be extremely handy for giant mech player classes, tanks etc. where the original bobbing is just silly. Nice one. :D

edit: I haven't actually tried this patch, but can you make vertical bobbing only using the above options? Like Quake's silly up and down weapon bobbing?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Extended Weapon Bobbing Properties

Post by Xaser »

Sure can. Just set Weapon.BobRangeX to zero and adjust Weapon.BobSpeed/Weapon.BobRangeY to suit. If you want sine-wave-like Y-bobbing, you'll be most interested in the "Smooth" BobStyle.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”