Post news RSS Runewatch - Dev log #9

Welcome to our ninth dev log. Today we will show the tool created to manage artificial intelligence.

Posted by on


To control the artificial intelligence in Runewatch, we created a tool that allows us to handle different enemy behaviors by filling in some fields with little effort.

This tool allows us to easily create states in which enemies perform the desired behaviors until some condition orders them to change.

In order to make the images easier to read, right-click on the image and open it in a new tab.

Artificial Intelligence Manager Tool


The imagem above presents an empty state, without any logic. Let's take a closer look at the fields.


This field determines all the actions that will be performed while the artificial intelligence agent is in this state.


In the image above, we are analyzing the "State Agile Agressive". This state is intended to make an agent agile and aggressive. These actions are quite self-explanatory.

In the example of this state, we know the agent will:

  • Follow the player;
  • Use spells from a list of possible spells;
  • It will move sideways;
  • Will continue to look at the player continuously;
  • Will maintain a constant minimum distance from the player;

You can see these actions working all together in the video below:


Transitions determine when an agent must change its state because of a condition.


In the previous image, we are analyzing the "State Agile Lost Player". This state is used by agile agents, who have lost the player from their field of vision.

We can analyze two decisions:

  • Can the agent see the player?

If it succeeds, then the agent will switch to "State Agile Agressive" (state that we analyzed earlier), otherwise, it will switch to "State Agile Random Patrol", in which it will have the behavior of patrolling an area.

  • Is the maximum time to search for the player over?

If it has reached the maximum time, then it will switch to "Agile Random Patrol", in which it will have the behavior of patrolling an area, otherwise, it will remain in this state until the time runs out.

On Enter State and On Exit State Actions

Actions that happen when an agent enter or leaves this state.


As seen on this last image, simply by assigning actions to these last fields, the actions will be executed depending on the field they are one. On this case we are analyzing “State Agile Lost Player”, and everytime the agent enters this state, it will execute “Action Move To Last Known Position”.


Although this tool took some time and work initially, in the long run it paid off for the dedication, as we are now able to create new states with a variety of behaviors efficiently and quickly.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.