Page 2 of 3

Re: Head bobbing

Posted: 24 May 2019, 13:17
by Stomy
I've got a first pass at head bobbing on GitLab, here's a brief video demonstration on discord.

As it stands though I'm not quite happy with how it interferes with weapon bobbing and footsteps, as it's not fully in sync with first person animations, and to put it in sync would be really jarring and frankly ruin the effect. So to that end I'm thinking I'll add some more options before marking it ready:
  • Off (Default)
  • On (with loaded first person animations)
  • On, Weapon Walk Paused (first person walking animations aren't played, footstep sounds are based on head bob instead)
  • On, Weapon Walk Hardcoded (first person walking animations replaced with parametric weapon bobbing matched to head, with added turning inertia, also configurable in cfg)
I'm thinking I'll also add additional options for head-bobbing while swimming, and some slight camera bounce when jumping and landing.

Re: Head bobbing

Posted: 24 May 2019, 18:16
by thephantomfiddler
Honestly makes me a bit dizzy to look at.

Re: Head bobbing

Posted: 24 May 2019, 22:09
by raevol
That's funny, I was going to say it looks way better than I anticipated. Still not my style, but cool to see a feature like this in place.

Re: Head bobbing

Posted: 25 May 2019, 02:32
by mistermoonshine
I actually really like it

Re: Head bobbing

Posted: 25 May 2019, 04:12
by wareya
Oh yeah, weapon sway is a pretty integral part of viewbob not looking janky. In fact it's probably the most important part. Also, some games make the view "crunch" or "spring" when you land from jumps.

Re: Head bobbing

Posted: 25 May 2019, 11:42
by Stomy
I ended up keeping it much more simple, I added a separate hand bob over the top of the existing animations and I think it ends up looking quite natural after all: here it is in motion.

There's also landing bounce, some extra sway from movement inertia, and toggling sneak while head bobbing is on causes it to be a quick transition instead of an instant offset.

I'm pretty happy with it now, what do all of you think?

Re: Head bobbing

Posted: 25 May 2019, 11:56
by fredzio
Stomy wrote: 25 May 2019, 11:42 I'm pretty happy with it now, what do all of you think?
Looks pretty neat :)

Re: Head bobbing

Posted: 25 May 2019, 13:38
by wareya
It has a bobrate limit, right? Last thing I want is for my viewmodel to vibrate wildly when I have 10000 speed.

Also, the viewbob itself doesn't happen while in the air, right?

Re: Head bobbing

Posted: 25 May 2019, 15:26
by Stomy
There's no bobrate limiting as it would get out of sync with the footstep sounds. The bob depth however has a soft cap at 400 movespeed (corresponds to running with about 70 Speed + 70 Athletics), after which it weakens asymptotically towards zero. As you go higher and higher you stop seeing it, I can't even tell at 10000 Speed.

It does still bob when levitating if your feet are touching the ground. But if you're jumping, levitating up in the air, swimming, or no-clipping it doesn't happen.

Re: Head bobbing

Posted: 25 May 2019, 20:31
by wareya
Stomy wrote: 25 May 2019, 15:26 There's no bobrate limiting as it would get out of sync with the footstep sounds.
That's not better than having everything onscreen flicker back and forth randomly at at min(fps, refreshrate), which can trigger people with sensory sensitivity problems, like myself (though it's not epilepsy, it's related to ADHD). Make a hard bobrate limit of something like 10hz or 20hz in terms of full bob cycles or something like that, IMO.

>after which it weakens asymptotically towards zero

Oh, so the amplitude of the bobbing fades out? That might work. I'd have to try it out. Might as well limit the rate as well at that point, if you ask me...

>It does still bob when levitating if your feet are touching the ground. But if you're jumping, levitating up in the air, swimming, or no-clipping it doesn't happen.

I agree with that combination of behaviors.