AI Types
Some Terms and Definitions
- Feature - a prominent or conspicuous part or characteristic of a game A.I. behavior
- Tuner - aspects of a game A.I. behavior that can be easily adjusted by the Panda3D programmer
- Non-player Character (NPC) - character or object in the game that is controlled by the program and not the human player
Game A.I. Steering Behaviors
1. Seek
- Features:
- seeker's target is a static point
- seeking object accelerates till its force is equal to its max force and reaches target a quickly as possible
- seeking object stops when it reaches its target
- seeker always faces target
- Tuners:
- * All found in AICharacter
Video Description: Five NPCs (red) all SEEK their respective static targets, which are represented by yellow spheres dispersed throughout the 3-dimensional space.
2. Pursue
- Features:
- an advancement of seek; a continuous seek where the pursuing object constantly adjusts while tracking a moving object
- Tuners:
- * All found in AICharacter
Video Description: The two NPCs (red) PURSUE their respective wandering targets (blue NPCs).
3. Flee
- Features:
- opposite of seek; object moves away from a static point (point of avoidance)
- Fleeing object accelerates till its force is equal to its max force and moves away from the point of avoidance as quickly as possible
- Fleeing object always faces away from the point of avoidance
- Fleeing object stops fleeing once it has reached the "Panic + Relax" distance
- Tuners:
- panic distance - detection radius of the AI object
- relax distance - the distance to stop after flee has been started
- * Others determined in AICharacter
Video Description: Four NPCs (red) FLEE from different static points, which are represented by yellow spheres dispersed throughout the 3-dimensional space.
4. Evade
- Features:
- an advancement of flee; evading object moves away from a moving object (object of avoidance) until it reaches the "Panic + Relax" distance
- Tuners:
- panic distance - detection radius of the AI object
- relax distance - the distance to stop after flee has been started
- * Others determined in AICharacter
Video Description: The NPC (red) is set to EVADE the player-controlled character (blue) whenever it gets too close. After evading a certain distance away from the blue character, the red character comes to a stop.
5. Arrival
- Features:
- arriving object decelerates as it approaches its target (can be a static point or an object in motion)
- arriving object decelerates as it approaches its target (can be a static point or an object in motion)
- Can be used only with Seek and Pursue
- Tuners:
- distance from the target point after which it decelerates (braking distance)
Video Description: The NPC (red) enacts the ARRIVAL behavior whenever it comes close to completing its pursuit of an invisible point located directly behind the player-controlled character (blue). The fact that this “pursue point” is placed behind the blue character instead of centered within it, means that the NPC will arrive next to its target as opposed to directly over it.
6. Wander
- Features:
- NPC traverses around the world with no particular goal
- NPC traverses around the world with no particular goal
- invisible "wander sphere" stems from the character out in front of it
- NPC can be restricted to wandering around a designated region
- Tuners:
- size of the "wander sphere"
- ability to lock an axis (x, y, or z) of the "wander sphere"
- the restricted region (location and size) in which the NPC can wander
Video Description: All NPCs (red) WANDER around the 3-dimensional space. The wander behavior is caused by random points being generated within an invisible boundary in front of each NPC. The NPC continuously seeks these random points, so that it appears to be wandering around aimlessly.
7. Flock
- Features:
- group of NPCs moving together as a herd
- flocking behavior is a result of each NPC's awareness of its neighbors in the flock, which is determined by a "visibility cone" that stems from each individual NPC
- based on this NPC awareness level, three other behaviors act together to produce the flock behavior:
- cohesion -- finds average position of neighbors and tries to move to that position
- separation -- object keeps a certain distance between itself and its neighbor
- alignment -- finds average direction in which all neighbors are moving and tries to move in that direction
- based on this NPC awareness level, three other behaviors act together to produce the flock behavior:
- flocking behavior is a result of each NPC's awareness of its neighbors in the flock, which is determined by a "visibility cone" that stems from each individual NPC
- group of NPCs moving together as a herd
- Tuners:
- the angle and length of each NPC's "visibility cone"
- weight of cohesion, separation, and alignment (how much each sub-behavior of flock affects the overall flocking behavior)
Video Description: Groups of NPCs (red, pink, and yellow) FLOCK together, and each separate flock pursues the player-controlled character (blue). Different colors distinguish the different flocking groups, but they are also there to show how variations of the behavior can be created by adjusting the tuners. For example, the NPCs in the red flock have “visibility cones” with lower viewing angles, so their flock does not stay together as well as pink and yellow. The separate flocks have also been given different speeds.
8. Obstacle Avoidance
- Features:
- NPC recognizes obstacles, and attempts to move around them
- NPC recognizes obstacles, and attempts to move around them
- Tuners:
- “Feeler length”, which is the range at which the obstacle can be detected by the NPC
Video Description: A player-controlled character (yellow egg) is moved around the plain, while a flock of NPCs (white eggs) all pursue and use OBSTACLE AVOIDANCE to navigate around the obstacles (tress).
9. Path Follow
- Features:
- A path is formed from several waypoints placed in 3D space, which the NPC then traverses
- There must be at least two waypoints in order for a path to be formed
- Tuners:
- Position of the waypoints
Video Description: The NPC (red) traverses around a set path, formed by four waypoints (yellow spheres).