An Update From Kate The Enemy Programmer


Heyo, I'm Kate, the secret second programmer for Build A Bot. I'm fully devoted to Enemy AI (along with some other stuff here and there, you know how it is)

Before sitting down to make an AI, it's always a good idea to assess the desired complexity of the entities in question.

With that in mind let's ask: "How do I make a good AI?"

Well, first off, there's options. The go to option is generally a "finite state machine". The concept is that you define different behaviours as a state, like, "Shoot at the player" or "Take Cover". Then you go about describing when your AI transitions between these states.

State machines create some complex appearing enemies while looking very clean on paper. However, setting up all the transitions can be a hassle, and testing all the transitions and states is a pain.

The second option is the "behaviour tree". This is a self navigating structure of nodes, with each node being an individual behaviour or a way to control other nodes.

Behaviour trees are simpler and shorter things, although either can be stretched to fulfil the needs met by the other, the most comprehensive use would be a state machine for which each state uses a behaviour tree.

When I designed the core of the AI for BAB, I decided I wanted the enemies to feel simpler, so I coded for just behaviour trees. This is the kind of design that real life robots use to perform tasks, and I didn't think any enemies would live long enough to need anything super complex.

So, peek behind the curtain, the grey egg guys have a 4 node brain: Sequence(Approach, Strafe, Pause). which means it approaches something (the player), strafes around a thing (the player) and then pauses for some time (not the player). Every other bot is made by writing out the brain and programming the bits I don't have yet. One exception is the spider bot, because the spider has the exact same brain as the egg and uses the same script.

So yeah, that's how enemy brains are built. See you again later!

Files

Build A Bot.zip 229 MB
45 days ago

Get Build A Bot

Leave a comment

Log in with itch.io to leave a comment.