Page contents

AI following guide

This guide provides general info on how to set up AI to follow you around a level, this guide assumes you have basic understanding of navigating sapien, pathfinding, AI spawning and the objective system, as having these is very useful.

This guide assumes you know how to set up and spawn AI, this is crucial as without the ability to spawn AI you cannot set up a system by which they can follow the player or another squad.

View of a basic squad

Correct squad setup is essential

The objectives

After you have set up your squad within sapien, scroll down to the AI section and click on objectives, click New instance

Heirarchy view of navigating to the objectives and making a new one

Creating goals for the AI

Open your new objective and assign it a default zone, give it a name you will recognize later and click Add to create a new task

View of the objective window

Objectives are composed of tasks

Clicking on the task will allow you to edit properties such as its name and allow clicking areas to assign them to this task

Window view of the task and its assigned areas

Tasks are composed of areas

The task

Within your new task, set the follow policy to your desired option and assign a follow radius (assumed in world units). Remember, AI are not following a target between firing positions, but rather between areas inside the task

Window view of task properties

Who will the AI follow?

The result

In sapien under the AI section, you can now go to your AI squad and assign them the new objective and task you just made. Save the scenario Ctrl + S, do a map reset Ctrl + R and place your AI squad down. Observe your results.

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • odchylanie_uderzenia (writing and research)