[All] Player bobbing in air
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
[All] Player bobbing in air
I don't know if it is a bug, or not. While in the air, the player is still bobbing. You can notice it even when you do regular jumps, but if you jump in a sector with low gravity, it looks really weird. Also, it doesn't looking good when player is swimming, but at least, it's not so weird.
As I remember, Legacy players weren`t bobbing both in air and water.
Can bobbing be removed while jumping/swimming?
As I remember, Legacy players weren`t bobbing both in air and water.
Can bobbing be removed while jumping/swimming?
Re: [All] Player bobbing in air
I take it you mean weapon bobbing and not view bobbing?
Re: [All] Player bobbing in air
Or could you also possibly mean the player himself, when viewed by an external camera?
Re: [All] Player bobbing in air
I think he means weapon bobbing - if so, why shouldn't the weapon bob when you are moving - even if it is a jump or a swim? Personally, I think that looks much better than suddenly not moving - especially if it snapped to a neutral central position from wherever it was on the bob when the jump (etc) started. I know that I'd find it difficult to hold a weapon absolutely steady when jumping or swimming. 
The Doom weapon bob is a pretty primitive sway animation that, IMO, looks equally bad and good in all the circumstances mentioned.

The Doom weapon bob is a pretty primitive sway animation that, IMO, looks equally bad and good in all the circumstances mentioned.
Re: [All] Player bobbing in air
No, I mean player camera. Just set low gravity, run and then jump. This looks like player is walking in the air.
Re: [All] Player bobbing in air
Build a two-sector map in vanilla. A square sector neighboring another square sector, with as large a height difference between both floors as the engine will allow, but the same ceiling height. Put the player start on the high floor sector. Run from it and fall down to the low floor sector. During the fall, keep moving forward and look if you are bobbing or not.
Re: [All] Player bobbing in air
It's bobbing. It's difficult to notice that with normal gravity, with low it's definitely bobbing
Re: [All] Player bobbing in air
I mean, does it bob in plain old vanilla DOOM.EXE too?
Re: [All] Player bobbing in air
Looks like it does... But I can't say for sure. It's hard to find that out without low gravity
Re: [All] Player bobbing in air
Another interesting fact. When turning on nogravity flag, camera will bob when player standing on ground, but won't bob while player is in air. That's the right behaviour=)
That also works for vanilla.
That also works for vanilla.
Re: [All] Player bobbing in air
I'm not experienced in fixing bugs. I don't even know how to make code patches(posted in code submissions). However, I found this in p_user.cpp (zdoom 2.3.1 src)
line 1513: void P_CalcHeight (player_t *player)
___blah blah___
line 1528: if ((player->mo->flags & MF_NOGRAVITY) && !onground)
Cheks if player isn't standing on ground and have NOGRAVITY flag. So, this turns off movement bobbing if player have nogravity flag (by entering fly cheat for example) AND is in air. Shouldn 't that be changed to something like this?
if (((player->mo->flags & MF_NOGRAVITY) && !onground) || !onground)
So it checks if player is in air with nogravity flag set, or simply when he is in air.
EDIT. Wait, isn't that just
if ( !onground)
My maths is sooo bad...
I can't test this right now, I'm downloading vc++ and stuff, so it will take some days.
EDIT2:
line 1513: void P_CalcHeight (player_t *player)
___blah blah___
line 1528: if ((player->mo->flags & MF_NOGRAVITY) && !onground)
Cheks if player isn't standing on ground and have NOGRAVITY flag. So, this turns off movement bobbing if player have nogravity flag (by entering fly cheat for example) AND is in air. Shouldn 't that be changed to something like this?
if (((player->mo->flags & MF_NOGRAVITY) && !onground) || !onground)
So it checks if player is in air with nogravity flag set, or simply when he is in air.
EDIT. Wait, isn't that just
if ( !onground)
My maths is sooo bad...
I can't test this right now, I'm downloading vc++ and stuff, so it will take some days.
EDIT2:
Damn... Is it really needed even if not on ground?(needs to be calculated for gun swing even if not on ground)
Re: [All] Player bobbing in air
Well, the player might be walking on bridges or other non-ground things.
Re: [All] Player bobbing in air
The main problem is "weapon bobbing weirdness". Use fly cheat - fly in air, then on ground and look at the weapon. To fix movement bobbing bug the weapon bobbing code must be rewritten. 

- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [All] Player bobbing in air
Why was still here? 

- Cutmanmike
- Posts: 11351
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: [All] Player bobbing in air
I wouldn't actually mind a way to turn that bobbing off if possible. Maybe through setplayerproperty with a set of 2?