Optional Doom v0.4 Style Move Bobbing

Moderator: GZDoom Developers

User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Optional Doom v0.4 Style Move Bobbing

Post by Dark-Assassin »

Today i just watched a video on the Doom alpha releases and one thing that really stood out is the nice move bobing.
So then i thought, "I wonder what it would be like in ZDoom" so now that why i am suggesting it here.
Optional of course, possibly changeable in the "Player Setup" menu.

Here is a link to the video i watched. Start watching from 1:20.
http://www.youtube.com/watch?v=h6YTBTSsrqU
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: Optional Doom v0.4 Style Move Bobbing

Post by NeuralStunner »

There's been code for this. Nothing actually submitted to go in trunk AFAIK.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Optional Doom v0.4 Style Move Bobbing

Post by wildweasel »

I still support this.
User avatar
Nash
 
 
Posts: 17491
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Optional Doom v0.4 Style Move Bobbing

Post by Nash »

It's very easy to change the bobbing to Doom alpha, in p_pspr.cpp, line 328, it's just a one-line change:

Code: Select all

*x = FixedMul(player->bob, finecosine[angle]);
becomes

Code: Select all

*x = FixedMul(player->bob, finesine[angle]);
Then all that's left it to add conditional checks to the code; either user option or a DECORATE weapon flag...
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: Optional Doom v0.4 Style Move Bobbing

Post by NeuralStunner »

As long as the top-of-arc is at normal weapon position. Wasn't too fond of the one method that required extra graphic below the base line. It's hard enough to keep weapons nice and visible.

Honestly I'd rather see this as a full-featured property. Reverse bobbing could be achieved by checking for a negative vertical range. (Wouldn't be good to use it directly in math, for the reason stated above.) I for one would love a shorter, quicker motion, instead of the classic "lol hypnotism" wide and slow motion.
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Optional Doom v0.4 Style Move Bobbing

Post by Dark-Assassin »

One thing i don't get is why it was changed in v0.5 and beyond.
Gez
 
 
Posts: 17942
Joined: Fri Jul 06, 2007 3:22 pm

Re: Optional Doom v0.4 Style Move Bobbing

Post by Gez »

They tried various things until they found what looked best in their opinion.


It'd be nice if bobbing could be a weapon property. I have some beautiful angled sprites that tend to show off their cut-off while bobbing.
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Optional Doom v0.4 Style Move Bobbing

Post by Dark-Assassin »

Nash wrote:It's very easy to change the bobbing to Doom alpha, in p_pspr.cpp, line 328, it's just a one-line change:

Code: Select all

*x = FixedMul(player->bob, finecosine[angle]);
becomes

Code: Select all

*x = FixedMul(player->bob, finesine[angle]);
Then all that's left it to add conditional checks to the code; either user option or a DECORATE weapon flag...
Tried it like that, seemed too fluid still and a bit slow compared to v0.4.
Infact is it even possible to get the source code for the Alpha versions?
User avatar
Minigunner
Posts: 754
Joined: Mon Dec 28, 2009 5:13 pm

Re: Optional Doom v0.4 Style Move Bobbing

Post by Minigunner »

There is a timer in the same file (line 300) that sets the position of the weapon when bobbing:

Code: Select all

int angle = (128*35/TICRATE*level.time)&FINEMASK;
You could put a new bobbing speed property in and place the defined value here.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Optional Doom v0.4 Style Move Bobbing

Post by Ryan Cordell »

here's some experimental code for mostly fully custom bobbing, i've had this implemented in Tower of Babel for a good while, thought it'd be good to share it since this topic came up.
there might be problems, i'm relying on you guys to tell me if anything is off here or doesn't work properly.

edit: implemented in this are BobSpeed, which determines how fast it moves side-to-side,
BobLimit, how far it moves side to side (max and def. is 16 I think?),
BobStyle (expressed via string ala "Original" and "Alpha", "Original" by default in source and inventory.txt) defines how it moves..

http://www.mediafire.com/?2wkv5s84tion7kr
Last edited by Ryan Cordell on Fri Apr 06, 2012 7:35 am, edited 3 times in total.
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Optional Doom v0.4 Style Move Bobbing

Post by Dark-Assassin »

Ok, i've managed to do it.

In p_pspr.cpp where:

Code: Select all

CVAR(Int, sv_fastweapons, false, CVAR_SERVERINFO);
I've added below:

Code: Select all

// [Dark-Assassin] Movebob Styles
// 0 = None
// 1 = Doom
// 2 = Doom Alpha v0.4
CVAR (Int, cl_bobstyle, 1, CVAR_ARCHIVE);
// True = Always Bob
// False = Default Bobing
CVAR (Bool, cl_alwaysbob, 0, CVAR_ARCHIVE);
^ Just threw in an always bob on the side, off by default.

Also where:

Code: Select all

// Bob the weapon based on movement speed.
int angle = (128*35/TICRATE*level.time)&FINEMASK;
I've changed it to:

Code: Select all

	// Bob the weapon based on movement speed.
	int bobspeed = 0;

	if (cl_bobstyle == 0)
	{
		bobspeed = 0;
	}
	else if (cl_bobstyle == 2)
	{
		bobspeed = 256;
	}
	else
	{
		bobspeed = 128;
	}

	int angle = (bobspeed*35/TICRATE*level.time)&FINEMASK;
^ Could be Cleaner.

And Lastly where:

Code: Select all

	if (curbob != 0)
	{
		*x = FixedMul(player->bob, finecosine[angle]);
		*y = FixedMul(player->bob, finesine[angle & (FINEANGLES/2-1)]);
	}
I've changed it to:

Code: Select all

	if (curbob != 0 or cl_alwaysbob)
	{
		if (cl_bobstyle == 0)
		{
			*x = 0;
			*y = 0;
		}
		else if (cl_bobstyle == 2)
		{
			*x = FixedMul(player->bob, finesine[angle]);
			*y = FixedMul(player->bob, finesine[angle & (FINEANGLES/2-1)]);
		}
		else
		{
			*x = FixedMul(player->bob, finecosine[angle]);
			*y = FixedMul(player->bob, finesine[angle & (FINEANGLES/2-1)]);
		}
	}
I'm sorry that idk anything about diff patches or anything, so i just posted whats changed.

Also, More modifications would be needed if this is to become a modder's choice as found in the code that Ryan Cordell provided.

And just throwing this comment out, "cl_bobstyle 2" looks best with "movebob 0.125"
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Optional Doom v0.4 Style Move Bobbing

Post by amv2k9 »

Gez wrote:They tried various things until they found what looked best in their opinion.
It'd be nice if bobbing could be a weapon property. I have some beautiful angled sprites that tend to show off their cut-off while bobbing.
NeuralStunner wrote:...Honestly I'd rather see this as a full-featured property. Reverse bobbing could be achieved by checking for a negative vertical range. (Wouldn't be good to use it directly in math, for the reason stated above.) I for one would love a shorter, quicker motion, instead of the classic "lol hypnotism" wide and slow motion.
Even better, an extension to A_WeaponReady so that you could have different bobs for different states (sprinting, anyone?).
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Optional Doom v0.4 Style Move Bobbing

Post by Ryan Cordell »

or you could modify it via acs, if the weapon properties (like what i posted above) were exposed to it.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Optional Doom v0.4 Style Move Bobbing

Post by Ghastly »

dark-slayer-201 wrote:Ok, i've managed to do it.
I think Ryan's implementation is a lot more flexible for users. It lets modders define how they want their weapons to bob.
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Optional Doom v0.4 Style Move Bobbing

Post by Dark-Assassin »

Ghastly_dragon wrote:
dark-slayer-201 wrote:Ok, i've managed to do it.
I think Ryan's implementation is a lot more flexible for users. It lets modders define how they want their weapons to bob.
Yes, i understand that and perhaps the best way would to well, use both.
ie. the cvar for default bobing unless otherwise defined in Ryan Cordell's code.

Not to sound selfish or something...
All i managed to do right now (and not knowing how easy enough it was) is just the part i suggested.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”