StealthAI_V4 – New Features

Initially I started development with a focus to two possible methods for AI scripting. The first was the video shown above, that involved having multiple scripts that manage each specific AI state, a good system if you want to be able to add additional features later.

The second method was one that used baseClasses and the state machine system I know well from the last attempt to go between states.

Ultimately I decided to try out the baseclass setup for the prototype, but with the idea that I will probably use the multiple script method in the final product. This is because I wanted to be able to easily tweak things in one code, and was curious how baseclass worked.

Detection Script


To begin the new setup I made a baseclass where I stored the AI’s detection functions and basic move features. I then made a subclass that inherited from this script and would manage what the AI did in different states.



With this version of the AI I leant heavily on mecanim to remake the linear sequences I lost from not using a cortine set up. Above is the substate that handled the AI’s animations when standing idle at a waypoint. In order to interact with these mecanim trees I added booleans into the brain script that kept track of what animation was currently playing so it could responded according.

Hear Player and Look At


The AI was giving some additional animations and a new investigation target variable, the lookAtPoint vector3. Used when the player is running near the AI the patroller will now turn to look at a specific direction when triggered.

AI Path


Finally I worked on updating the AI path script with the following features:

  • The ability to set a waypoint to be lingered on
  • While being idle at a waypoint, make the AI pivot to look in a specific direction.
  • Allow the AI to do the following behaviors at a Idle spot, wait intro, search, wait outro.
  • The addition of a constant schedule the AI path keeps to, if the AI patroller lags behind in following waypoints, or needs to rsync with the routine they will run to catch up.

These new features present themselves as additional options in the AIPath Menu (see image above) and as the circles and lines seen at each waypoint in the scene view. To edit you simply click and choose where you want a AI to look at when they reach a specific waypoint and set if you want them to play the search animation, and how long you want them to stand there before and after that animation plays. The green rectangular box above the waypoint in the scene view is the waypoint the patroller is currently scheduled to be targeting.

StealthAI_V4 – New Features

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s