Sniper's Paradise- Bot AI


This AI guide will go over the basic Bot behaviour.

When starting out, a bot selects a destination and tries to take the fastest possible way to get there. That means if the level has dead-ends and nothing to pick up at the end, bots will in most cases never go there. If two paths exist to a specific item and one is much longer than the other, bots will use the shortest path each time.

In most cases they will get to their designated target without problems. but in some cases, bots will tend to suicide themself trying to get where they want. Jumping across lava and fails, walking into traps or similar hazzards, Bots never pay attention to these dangers and kill themself's everytime.

As stated, bots pick a destination and try as best as they can to get there. Along the way it will pick up most items, if they find it useful. If it fails to complete its route it might try again until it is successful or another item gets more interesting.

If a bot "falls" outside the definded paths, either by falling off a ledge or after a
firefight, the bot will seek the closest pathnode and from there decide on it's next way.
If the bot fails to "see" a pathnode in the area the bot will camp, wandering around.

When bots walk across ledges (>=32 units) they will often jump out (depends on pathnode position). If the ledge is just barely within the safety-limit of falling damage,
bots will certainly take damage as they jump off the ledge.

Bots will never camp at spots for a longer period of time unless there is a reason for it to do so. A bot might wait a few seconds for ammo or item to respawn, pick it up and then continue. In gametypes other than DM bots might stand and defend positions if needed but this depend greatly on how different navigation points have been placed.

When a bot gets stuck or don't know how to proceed it will either stand still by the current pathnode or wander between two.

A bot may also get stuck by a wall. This is because the bot thinks that it is able to walk in a straight line between two pathnodes. If a wall is too close to this path the bot might get stuck.

In fights bots will focus on the destruction of their target. Pathnodes is then only used as "checkpoints" to keep the bot from going too far outside the path network. If the target goes out of sight the bot will return to the network, possibly looking for its target for a few seconds and then keep on with it's mission. This means that if some areas are too big/open the bot might spend more time trying to fight opponents rather than taking the flag or control-points.

Difficulty and Bots

A bots behaviour change according to it's difficulty setting. It mostly affect it's ability to fight but also the choices it make regarding the navigation network.

In fights a bot will focus on taking out its target and use several techniques like any player do, moving, strafing side jumping and so on. Difficulty determine several areas including how much a bot use any of the above examples. A novice bot will basically stand still and not shoot too often with horrible aim. Bots with godlike setting never stand still and have excellent aim while leading it's target.

Reaction time and speed is also affected and novice bots may not actually react to a hostile player being close by. They move slow and is easy to outrun while on godlike they react instantly and move at the same speed as any other player.

All of the above only affect firefight situations but when it comes to navigating the network and make sane choices difficulty also play a role. Random values slightly affect a bots priority but the outcome is reduced with higher difficulty settings.

You can see a novice bot make 'stupid' choices when it comes to where to go an not, what to pickup and so on. They may even ignore hostile opponents when trying to obtain a targeted pickup.

No matter what difficulty a bot has it will still only run in a straight line between two nodes and thus turn very predictable.

AI functions

Retreating

This is an automatic function rather than an explicit Order. The creature can be made to retreat to a specific spot if hurt or otherwise frightened.

  1. Place a creature in the map and enter a unique Tag that will be used to associate this creature with a HomeBase.
  2. Place a HomeBase somewhere in the map. This will the place the creature will retreat to. Likely places to retreat to include out of the way places, spots "deeper" into the map's layout or objective sequence, or where other creatures can be found to help this creature in combat.
  3. Enter the Tag of the HomeBase to match the creature's Tag.
  4. Decide an appropriate Extend to set for the HomeBase. This is the radius (in UU) that the creature's "home" extends from the HomeBase actor. Note that the creature will only consider themselves at "home" if they are within the Extend and have a line of sight to the HomeBase.
  5. Decide an appropriate LookDir for the HomeBase. This is the direction the creature will face once they are at "home."
Alarm

Although this is not an explicit Order, Alarm functions can direct a creature to perform complex tasks when an enemy player is first seen. In practical terms, the creature will attempt to perform these tasks at all cost. After the task is complete, the creature will attack the enemy, if still available. After combat, the creature will return to a RestFormation or resume it's normal Orders.

  1. Place a creature in the map and enter a unique AlarmTag that will be used to associate this creature with it's AlarmPoint.
  2. Place an AlarmPoint in a spot that will represent a destination for the task the creature is to perform once "alarmed". This could be a spot near other creatures to help in combat, it could be an actual alarm trigger (a switch the creature activates to set off an audible alarm sound), or it could be a better tactical position to attack from. While the specific tasks the creature is to perform can vary, the main idea is that it will travel to this AlarmPoint once "alarmed".
  3. You may add additional AlarmPoints as long as they all have a unique Tag. Place as many additional AlarmPoints as you like. These will make the creature travel from the first AlarmPoint to the next in a series until the last AlarmPoint is reached.
  4. Enter the Tag of the next AlarmPoint in the NextAlarm property of this AlarmPoint. Move on to the next AlarmPoint in the series and continue to enter the NextAlarm property until all are properly associated.
  5. Decide if the creature should perform a specific animation sequence when this AlarmPoint is reached. If so, enter the name of the animation sequence in the AlarmAnim property of the AlarmPoint. A list of animation sequece names can be found in the editor's Mesh Browser. Note that animation sequences are specific to the creature used.
  6. Decide if the creature should play a specific sound while at this AlarmPoint. Enter the sound in the AlarmSound property of the AlarmPoint.
  7. If no AlarmAnim is used, decide if the creature should pause and play default waiting animations when this AlarmPoint is reached. Enter the time to pause (in seconds) in the PauseTime property on the AlarmPoint.
  8. The creature can be made to shoot at any actor when this AlarmPoint is reached. Enter the Tag of the actor in the ShootTarget property on this AlarmPoint.

Note: The AlarmPoint actor has many other properties with which to adjust the creature's behavior. In conjunction with other AlarmPoints, Triggers, etc., the creature can be made to perform complex behavior once a player enemy is detected.

Waiting

This is the default Order. The creature will wait near its location, sometimes randomly wandering, until a player enemy is seen to attack. After combat, the creature will return to a waiting state.

  1. Place a creature in the map and enter "Waiting" in the Orders property, if it isn't already set.
  2. That's it. You may want to rotate the creature to face a particular direction at match start, but after a short while, it will wander and change it's location and rotation on its own.
Ambushing

The creature will find a place to wait in ambush for a player to attack. Once combat is over, the creature will find another spot to ambush from and again wait for a player to attack.

  1. Place a creature in the map and enter "Ambushing" in the Orders property.
  2. Enter a unique OrderTag that will be used to associate this creature with it's AmbushPoints.
  3. Place AmbushPoints in the map at places where the creature can reach, can watch out for players, and hopefully can attack from with some element of suprise. A ledge, a side passage or a hole are likely places to Ambush from. Place as many as you like.
  4. Enter the Tag of these AmbushPoints to match your creature's OrderTag. This will associate the creature to these AmbushPoints.
  5. Decide whether to set bFixedStart to true on the creature or not. If true, the creature will always start the match at the placed position and travel to a random AmbushPoint to ambush players. If false, the creature will be teleported to a random AmbushPoint at match start.
  6. Decide whether to set bSniping to true on the various AmbushPoints. If true, the creature will likely snipe from that position when it sees a player to attack.
  7. Adjust the SightRadius on the various AmbushPoints, if necessary. This is the radius (in UU) that will be used by the creature when it is waiting to ambush at this point.
Patroling

The creature will move from spot to spot in a patrol route until a player enemy is seen to attack. After combat, the creature will return to the patrol route and continue to patrol.

  1. Place a creature in your map and enter "Patroling" in the Orders property.
  2. Enter a unique OrderTag that will be used to match this creature with a starting PatrolPoint. (suggested name, "Patrol1")
  3. Place a series of PatrolPoints in the map to define the patroling route for this creature. The creature will follow the normal path network to get from PatrolPoint to PatrolPoint, so you do not need to define each corner. Instead, find places that might be good to have this creature pause while patroling. A room, a lookout, a switchback or dead end are likely places to place PatrolPoints. Place as many as you like.
  4. Enter the Tag of the first PatrolPoint to match the creature's OrderTag. This will associate the creature with this patrol route and further associate this PatrolPoint as the creature's start.
  5. Enter the NextPatrol property of this PatrolPoint to match the Tag of the next PatrolPoint in the series along this patrol route. Enter the Tag of the next PatrolPoint to match.
  6. Repeat 4-5 until the patrol route is defined. Match the NextPatrol property of the last PatrolPoint with the Tag of the first PatrolPoint in the route to complete the loop.
  7. Decide whether to set bFixedStart to true on the creature. If true, the creature will always start the match at the placed position and travel to the starting PatrolPoint. If false, the creature will be teleported to the starting PatrolPoint at match start.
  8. Decide whether to set bDelayedPatrol to true on the creature. If true, the creature will wait at the placed location until it is triggered before it will travel to the first PatrolPoint and begin the patrol.
  9. Decide whether the creature should perform a specific animation sequence while at this PatrolPoint. The creature can be made to play an animation, pause using standard waiting animations or neither and simply move on to the next PatrolPoint. If a specific animation sequence is desired, enter the name of the sequence in the PatrolAnim property of the PatrolPoint. A list of animation sequences can be found in the Mesh Browser. Note that animation sequences are specific to the creature used.
  10. If an animation sequence is used, the creature can be made to loop the animation sequence a number of times. Enter the desired number of sequence loops in the NumAnims property of the PatrolPoint.
  11. Decide whether the creature should play a specific sound while performing an animation sequence at this PatrolPoint. Enter the sound in the PatrolSound property of the PatrolPoint.
  12. If no PatrolAnim is defined but a pause is desired, enter the number of seconds to pause in the PauseTime properties of the PatrolPoint.
Guarding

The creature will guard an item. It will stay at its placed location until an enemy player is seen, when it will challenge the player to combat. After combat, the creature will return to the placed location and continue to guard the item. If the item is touched, the creature will consider the "toucher" an enemy.

  1. Place a creature in the map and set its Order property to "Guarding". It's a good idea to place the creature near the item to be guarded, or at least within a line of sight to that item or the area surrounding the item.
  2. Enter a unique Tag on the item that will associate it with the creature guarding it. Match the creature's OrderTag to the Tag of the item.
PawnSpecific Orders

Some individual creatures have unique Orders or functions. See also the ScriptedPawn subclasses for the various creatures.

CreatureFactory and SpawnPoints

CreatureFactory is a subclass of ThingFactory. SpawnPoints are associated to factories to provide a suitable place to spawn an actor. CreatureFactories are specifically designed to spawn creatures in-game and give appropriate settings to various properties.

  1. Place a CreatureFactory in the map. Thing and CreatureFactories can either be triggered externally or activated via Touch, just like a Trigger. For this tutorial, place the CreatureFactory in a spot where a player is likely to walk by. We will set this CreatureFactory to spawn the creature when touched.
  2. Place a SpawnPoint somewhere in the map that will allow access to the bot path network and give enough space for the creature to be spawned. Also rotate the SpawnPoint to a good orientation for the creature to be spawned.
  3. Enter a unique Tag on the SpawnPoint that will associate it with the CreatureFactory. Match the CreatureFactory's Tag to the SpawnPoint Tag.
  4. Place as many additional SpawnPoints as you like, up to a total of 16. Make sure their Tags all match the Tag of the CreatureFactory. Spawned creatures will appear randomly at one of these SpawnPoints.
  5. Set the ThingFactory->Prototype property on the CreatureFactory to the desired creature to spawn.
  6. Set the ThingFactory->MaxItems property on the CreatureFactory to the maximum number of creatures this factory will allow in game at one time.
  7. Set the ThingFactory->Capacity property on the CreatureFactory to the maximum number of total creatures to spawn. After this number is reached, the factory will shut down. A value of -1 here indicates the factory should never shut down.
  8. Set the ThingFactory->Interval property to the (average) number of seconds to wait before this factory is ready to spawn the next creature. Note that spawning several creature with an interval of zero will likely cause a "hiccup", where the engine stalls momentarily while spawning. Set the interval to something small instead, like 0.1
  9. Set the ThingFactory->bOnlyPlayerTouched property on the CreatureFactory to true. For this tutorial, we want the player to trigger the factory when it touches it, but we don't want other creatures to trigger it. If true, only player pawns are able to activate this factory.
  10. Decide if the ThingFactory->bCovert property on the CreatureFactory should be set to false. It is set to true by default. If true, the creature will only be spawned if a player is unable to see it spawned, otherwise the factory will wait. If your SpawnPoint is in plain sight but you'd like creatures to spawn at it even if a player sees the creature appear from (seemingly) nowhere, this could be set to false.
  11. Decide if the ThingFactory->bStoppable property on the CreatureFactory should be set to true. If true, the factory will spawn creatures if Touched (or triggered) and will stop spawning creatures when it is unTouched.
  12. Set the CreatureFactory->Orders, OrderTag and AlarmTag properties on the CreatureFactory to those desired property settings for the spawned creatures.
  13. If the game is set to CoOp mode, decide if extra creatures should be spawned from this factory. Enter the number of extra creatures to spawn in the AddedCoopCapacity property on the CreatureFactory.

NOTE: Creatures spawned from a given SpawnPoint will have their Event set to match the Tag of the CreatureFactory (and the SpawnPoint). That way, once the creature is killed, it will automatically trigger a new creature to be spawned.



Spam Killer

Back To Top
2005 Sniper's Paradise
All logos and trademarks are properties of their respective owners.
Unreal™ is a registered trademark of Epic Games Inc.
Privacy Policy
Website by Softly
Powered by RUSH