Hi all,
Matt here with an update!
We’re honestly trying to be better about our devlogs; without going into too much detail I think we’ll be improving going forward, with a few unrefined short posts per month rather than one big dump every couple of months.
With that aside, I’ve been working on our bird flight mechanics - the bird character plays a large part in Vane, and we wanted to make sure we get the flight input and mechanics exactly right.
The old system was what I call “Magic Airplane” - it turns left and right sort of magically, and the roll is just a cosmetic incidental (we were actually doing it with an anim blend). The algorithm was basically:
-Get turn inputs in yaw and pitch (horizontal and vertical)
-apply turn inputs
-apply small downward velocity to simulate gravity
-set animation blends to reflect state (wings position, roll)
-increase velocity when going down, decrease when going up
-increase velocity when flapping, decrease when braking
Here’s a look in a test environment:
"Magic Airplane" model
It didn’t feel *bad* per se; we got a lot of good feedback at GDC and BitSummit. But we felt like we could do better - the motion felt “mechanical”, to generously quote our Art Director Rasmus. I also had a technical ax to grind; my implementation of control systems wasn’t where I wanted it to be (more on that in another devlog.).
A big focus for us on Vane is verisimilitude; we want all of our systems, stories, and mythology to be internally consistent. With that in mind, I set about reworking the flight mechanics to be more “physics-y” and less robotic.
The new algorithm looks like:
-Get horizontal & vertical turn inputs
-Apply vertical to pitch, and horizontal to *roll*
-derive a yaw from roll in order to simulate the complex motion of air past the wings of the bird
-apply lift based on current velocity & wing state (open/closed)
-include small amount of forward thrust to simulate a forward-biased angle of attack
-note that lift is in the local up direction
-apply forward thrust and upward lift from flapping
-apply air resistance based on current velocity; includes an increased resistance when turning
-apply an additional resistance force when braking, including an auto-brake system for when about to crash into stuff (environmental awareness for the characters is a big focus for us, we’ll talk about that more later)
-apply gravity
-lerp velocity towards heading to make direction intuitive and compensate for the fact that this is a bad physical model
-apply animation states
This is nowhere close to an actual, physical model of bird flight; it’s using unit weights and very rough approximations of forces, and the lerp is almost like cheating in a way. But the results were positive:
"PSEUDO PHYSICS" Model
The difference is hard to see in a GIF, but we’re happy so far; the flight feels a bit more authentic and a lot less mechanical. There’s still a lot of work to do - for example, I’d like the animation to be much more responsive and evocative - but we can tackle a lot of that in the coming months. The camera motion (it tilts a little bit) is also really important but also the topic of another blog.