[h1]Hey there! Today we're talking AI.[/h1] For those of you that have played the demo, you know that the AI is a bit temperamental. This is largely because of some bad design decisions I made when first creating enemies and which were meant to be temporary, and also some recent changes that weren't fully tested which resulted in the very temperamental behaviour. Next week, I will be rewriting the enemy AI with a modular finite state machine in mind. This is to allow me to create different AI for each enemy type without having to rewrite tons of code. This in turn will allow me to create a vast array of enemy variety, and even combining the different types of AI will result in (hopefully!) better engagements. Now, how does a state machine work? In essence, it means that the AI can only ever do one thing at a time - whether that is chase the player, call for backup, wander, etc. Theoretically it will form some kind of tree or a diagram like the one below, where depending on inputs such as player distance or if the enemy can see the player, the next state will be different. [img]https://clan.cloudflare.steamstatic.com/images//43798425/117c934215537578074f302c69946a61cadf3454.png[/img] Let's take a very simple AI for example. First, he is wandering. This is the default state that the enemy is in. Then let's say, the player walks within range of the AI - this then changes the state to a chase state, which then changes to a shoot stage once the AI is close enough to the player. Of course in reality it is more complicated than this but this system allows me to create modular AIs for each enemy type. I am also planning on integrating the enemy AI together so they can somewhat act as a team, though that is a longer term goal that I don't know if I'm going to get done next week. I am also beginning to map out the rough story line for the game and will begin to create side quests as I see the opportunity for them. [strike]Now, what is that about cheese? Oh yes, I'm hungry. I'm gonna have myself some Brie![/strike] Thanks for checking in, have a good day! Andrei