Week 10: March 8-14
On the tail end of what could reasonably be considered a Wednesday, I come bringing progress. There aren’t any flashy gifs this time, but I go over a bit of the AI behavior I’ve been planning.
Idle Hands Are My Current Workshop
Progress this week was split into generally two parts; I spent a fair bit of time making some strafing animations and idle masks (the former of the two I read a lot about with Blend trees for Unity, but am as of yet undecided on), and the other half on AI planning, which comes down to some drafts on state machines and decision logic. Just to throw something interesting in at the end, I implemented some hitboxes and ragdoll physics with a health system.
The animations ended up probably longer than I thought they would and for no particularly good reason either. After making the left and right strafes with forwards/backwords loops, I realized I could just make one and mirror it in Unity. I’m not even particularly happy with them anyway, but I can probably make them again with only a marginal amount of work, now knowing what I want. Same goes for the blocking animation. It’s a bit crooked but it more looks bad with the awkward strafes than with anything else. These things are light fixes but they do involve launching back into blender to change them.
AI And Plans Relating To It
Here’s a webm of the ragdoll physics: https://webmshare.com/play/1WrKx
This kind of thing is humorous, but it’s really not that big of a problem. I got the hitboxes working – with all the limbs taking generic damage and the neck/head taking double – and the joints turning to liquid upon death means that it’s sort of working, I just need to debug a quick issue with the root before it starts working fine.
A surprising amount of my progress this week is already into AI. I have plenty of animations left to do, but I find that with what I already have, I can make the basics of the AI already, so I might as well plan it.
Turns out it won’t be terribly complicated. The Tribal warriors, despite making them first, only have probably a 15-30 minute section planned in the final game, which means that while they’re good practice and a fair template for human AI (which I planned more extensively by building off what I want here), I don’t have to go balls to the walls with this one and I can focus mostly on just some idle behaviors and getting out a basic combat loop – which is exactly what’s necessary and serves the Demo Day this April.
The AI for humans is going to hinge on two components: a Controller script for each squad, or the Consensus, and the individual AI scripts, dubbed the Anima.
The Consensus is attached to a component that holds references to each Anima assigned to it, forming a squad. According to its own internal logic, the component will plan out and assign patrol routes or idle behaviors out of combat – managing the states of the Anima – and oversee combat by delivering state changes on countdown timers and player data to keep it interesting and fair. In more complicated AI units, this is going to also dictate squad morale and inter-unit communication between and also provide functions for merging squads together splitting them apart. In the tribesman it probably won’t do much.
The Anima will simply dictate the individual whims of each human, and will be directly attached to each Tribesman. According to it’s state, it will move to waypoints that are assigned, circle around the player in combat according to it’s given distance and initial location, decide when to pose for a block or for a parry, and engage with the player using attacks when given an aggressive state.
Well over the next week I’ll be finishing up some light work at uni before I go home for a few days and head off to GDC. I’ll try to work a bit on Friday and then a full day on Saturday and Monday, whereafter I’ll collect some images to get the blog out on maybe Tuesday or Wednesday night. I’m hoping I can get some headway into the AI, maybe focusing on the “Watching the Player” state and the “Defensive” combat state, with the Consensus handling the switch between the two.