Posted1 screenshot
Adding a T-Rex

The next dinosaur I added was probably the obvious one.
A T-Rex.
Up until this point, the Compy was really the only predator I had in the game. The Brachiosaurus was passive, so I wanted something at the complete opposite end of the scale. A very large predator that could actually hunt the player.
Getting it into the world went reasonably well.
It worked with the AI pathing system I had already built, and it could navigate around the voxel terrain and chase things as expected.
What I wasn't completely happy with was how it looked while doing it.
The problem with a creature the size of a T-Rex is that even relatively small changes in the terrain become very obvious across the length of its body. On steeper voxel slopes it could look strangely upright, almost as if the terrain underneath it wasn't really affecting it.
I've started compensating for that by allowing the body to tilt slightly as it moves up and down steeper inclines.
I've also added inverse kinematics to the dinosaurs so their feet can react more naturally to the ground underneath them rather than everything relying entirely on the animation.
There is still work to do here, but it already helps enormously with making such a large creature feel like it is actually standing in the world rather than simply moving across the top of it.
Then there was the slightly more important problem.
It couldn't bite you properly.
Technically, it could already hunt you.
It just bit with its feet.
The first strike system measured attack reach from origin to origin. For a voxel animal, that origin is effectively underneath the centre of the body.
That works surprisingly well until you create something with a head several metres away from its origin.
Standing directly in front of the T-Rex's mouth didn't necessarily mean you were in range.
Standing underneath it did.
The jaw itself also wasn't really doing anything. The model already had an attack pose, but the mouth was essentially scenery.
So I've changed how attacks work.
The bite now belongs to the jaw.
At the moment of impact, the hit test is performed from that part of the dinosaur's rig rather than from the centre of the creature. The dangerous part of a T-Rex is therefore finally the end with the teeth.
I've also added a proper two-stage bite animation.
During the windup the jaw opens, and then it snaps shut on the actual damage tick.
Range and stopping distance can also be configured per species. That means a T-Rex needs to get its head close enough to actually bite you rather than dealing damage from a body-length away.
I've also made predators track what they're attacking with their head while they hunt.
That sounds like a very small detail until you've watched a T-Rex chase you while staring at the floor.
Different animals will eventually attack in different ways. A tail strike is a very different problem to a bite, and something with horns will need another solution again.
But for a predator whose main weapon is supposed to be its mouth, it seemed fairly important that the mouth actually did the work.