Sooo, quite some time passed since the last post. Busy times and writing is hard.
Last post, we talked about critters – free roaming animals, big and small, just living their life in the meadows and forest. But what is a farming game without animals for your farm, obeying to your commands and gladly providing eggs and more on a daily basis? Let’s fix that right away.
Modelling
Let’s start with a simple one – the good ol’ chicken, a trusty companion on any farm of yours. Modelling and texturing is pretty straightforward, especially since my toolchain changed recently. Moving from Blender to Blockbench, a tool specialized on voxel-based modelling, saves a bunch of time, especially on texturing. Two legs, two wings, two eyes, a beak and some feathers all around, and here we go!

This one has some personality to it – looks kind of curious, but also a bit afraid. As a matter of fact, eyebrows turn out to be insanely good carriers for emotions on voxel animals, so let’s keep that as a general design pattern. I also like textures to be a bit noisy and not flat single-colored, so add a few gray sprinkles.
And while we’re on it, why not add a few variations of it, since that is mostly just a change in texture.


Animation
Animations on animals is a thing giving me headaches. The current approach is to animate them using Unity Animator. Being able to do basic animations, the Unity Animator is more about correcting and fixing issues on existing animations, not creating new ones from scratch. Animals with 2 legs is fine, but as soon as you enter 4-legged territory, things escalate quickly. Unfortunately, the current tool chain does not allow animations to move from Blockbench to Unity, so down the rocky road we go. A few iterations and lil’ chick is picking and walking like a pro! And since this bird is not going to fly anywhere, we can save on the flying-animation.


Behavior
As a general philosophy, individual parts of the game are being kept simple and farm animals are no exception. Let’s mark the general behavioral rules on paper before implementing them:
- Move around from time to time in a random direction. If you face an obstacle in front of you, turn away.
- Random picking, as long as you are idle.
- If in water, start panic-swimming-animation and GTFO!


Nice. Look how happy lil’ chick is picking and swimming for his dear life.
But, what is this all actually good for (except satisfying your desire to have a small bird running around your farm and making noises)? I guess, a chicken should lay an egg for you to collect, let’s say 1 per day. Small code changes done, and …

Let there be egg! These chickens have been busy.
More!
Looks like we’re on a good path here. Just … one type of animal will not be enough. So, let’s add some more. Following the approach of moving from smaller to more complex models, we continue with ducks and follow up with a sheep.



Aren’t they adorable? I hope you can give them a place they can call home. Ducks will provide you with eggs as well, and sheep can be sheared for wool from time to time.
And if you ever decide that animal husbandry is not your thing … well, there is also a solution for that.







Leave a Reply