Optional Doom v0.4 Style Move Bobbing
Moderator: GZDoom Developers
- Dark-Assassin
- Posts: 742
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Optional Doom v0.4 Style Move Bobbing
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
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
- 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
There's been code for this. Nothing actually submitted to go in trunk AFAIK.
- 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
I still support this.
Re: Optional Doom v0.4 Style Move Bobbing
It's very easy to change the bobbing to Doom alpha, in p_pspr.cpp, line 328, it's just a one-line change:
becomes
Then all that's left it to add conditional checks to the code; either user option or a DECORATE weapon flag...
Code: Select all
*x = FixedMul(player->bob, finecosine[angle]);
Code: Select all
*x = FixedMul(player->bob, finesine[angle]);
- 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
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.
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.
- Dark-Assassin
- Posts: 742
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Optional Doom v0.4 Style Move Bobbing
One thing i don't get is why it was changed in v0.5 and beyond.
Re: Optional Doom v0.4 Style Move Bobbing
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.
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.
- Dark-Assassin
- Posts: 742
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Optional Doom v0.4 Style Move Bobbing
Tried it like that, seemed too fluid still and a bit slow compared to v0.4.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:
becomesCode: Select all
*x = FixedMul(player->bob, finecosine[angle]);
Then all that's left it to add conditional checks to the code; either user option or a DECORATE weapon flag...Code: Select all
*x = FixedMul(player->bob, finesine[angle]);
Infact is it even possible to get the source code for the Alpha versions?
- Minigunner
- Posts: 754
- Joined: Mon Dec 28, 2009 5:13 pm
Re: Optional Doom v0.4 Style Move Bobbing
There is a timer in the same file (line 300) that sets the position of the weapon when bobbing:
You could put a new bobbing speed property in and place the defined value here.
Code: Select all
int angle = (128*35/TICRATE*level.time)&FINEMASK;
- 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
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
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.
- Dark-Assassin
- Posts: 742
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Optional Doom v0.4 Style Move Bobbing
Ok, i've managed to do it.
In p_pspr.cpp where:
I've added below:^ Just threw in an always bob on the side, off by default.
Also where:
I've changed it to:^ Could be Cleaner.
And Lastly where:
I've changed it to:
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"
In p_pspr.cpp where:
Code: Select all
CVAR(Int, sv_fastweapons, false, CVAR_SERVERINFO);
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);
Also where:
Code: Select all
// Bob the weapon based on movement speed.
int angle = (128*35/TICRATE*level.time)&FINEMASK;
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;
And Lastly where:
Code: Select all
if (curbob != 0)
{
*x = FixedMul(player->bob, finecosine[angle]);
*y = FixedMul(player->bob, finesine[angle & (FINEANGLES/2-1)]);
}
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)]);
}
}
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"
Re: Optional Doom v0.4 Style Move Bobbing
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.
Even better, an extension to A_WeaponReady so that you could have different bobs for different states (sprinting, anyone?).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.
- 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
or you could modify it via acs, if the weapon properties (like what i posted above) were exposed to it.
Re: Optional Doom v0.4 Style Move Bobbing
I think Ryan's implementation is a lot more flexible for users. It lets modders define how they want their weapons to bob.dark-slayer-201 wrote:Ok, i've managed to do it.
- Dark-Assassin
- Posts: 742
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Optional Doom v0.4 Style Move Bobbing
Yes, i understand that and perhaps the best way would to well, use both.Ghastly_dragon wrote:I think Ryan's implementation is a lot more flexible for users. It lets modders define how they want their weapons to bob.dark-slayer-201 wrote:Ok, i've managed to do it.
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.