Adaptive AI Engine for RTS Games

Discussing the theory and practice

Steering Behaviors (SB)

Posted by Ogail on August 17, 2009

Steering Behaviors (SB)

  • Sometimes in games, creatures not require intelligence and you want them to behave in natural way. Here you are looking for steering behavior
  • Steering techniques tend to be low level and concerned only with which direction a character should steer (يتوجه)
  • Characters that use SB are called autonomous agents meaning that they are typically set in motion and don’t require additional help from programmer or scripted elements in order to perform within the game world
  • SB are only concerned with movement so autonomous here appears in that area only
  • Reynolds call his original creatures boids and he set up 3 simple rules that can model complex locking behavior
  • These rules are:
    • Alignment: your head should always be in the same direction with the rest of the group
    • Cohesion: force of keeping the group together; tight and focused
    • Separation:
      • Could be seen as opposite of cohesion. This gives group members “personal space bubble” so they don’t crowd each other too much and every individual has room operate

 

  • Emergent behaviors is something like holy grail of game programming, where combination of simple local rules lead to very complex global behaviors
  • Because every boid is behaving in local stimulus (حافز), by time this can lead to chaotic state. But negative feedback from the main controller brings the overall group back into more ordered state
  • Prediction of the next behavior is 1 minute is impossible!
  • When to combine behaviors take in account following:
    • The combination could lead to meaningless behavior
    • Some behaviors could cancel other behaviors (antagonistic behaviors)
  • Most popular combining behaviors are:
    • Simple Weighted:
      • Sum up all individuals steering forces
      • Apply a weight multiple to each force vector before adding it into running sum
        • This able you to control the effect of the steering behavior on the overall system
      • The problem here is: how to find the suitable weights that lead to balance
      • Expensive o n CPU time because this calculation is calculated every game loop
    • Prioritized Sum:
      • Behaviors are stored in prioritized list
      • When we update each one we sum the result into accumulated steering force
      • The magnitude of the incoming force is subtracted from the maximal force (set by the programmer)
        • Here when we pass the maximal amount we truncate sum and stop updating
      • Advantages:
        • Here we only update exactly the number of allowed behaviors
        • We set up the behaviors here from important (pure) to lower importance
    • Prioritized
      Dither:
      • All the given behaviors are stored in priority order
      • Each behaviors is assigned a probability value
      • When the manages goes to update behavior collection, it rolls the dice and tests against the behavior’s probability value
        • If it passes, the behavior is updated
        • If the behaviors does something (sends back a steering vector), then its ignored
      • And after that the behavior in the collection is tested
      • Advantages:
        • For accurate results a very probability will be assigned to it
  • Pros of Steering Behaviors:
    • Ease of implementation
    • Predictable
    • Inexpensive to execute on the CPU
  • Cons of Steering Behaviors:
    • Combinatorial complexity
    • Short sightedness (بعد النظر)
    • Deadlocking problems
    • Large tuning requirements
    • They look robotic is misused
    • Not great at modeling idle states
  • Extension to Paradigm:
    • Layered Steering:
      • Each steering behaviors has other system of steering
      • The layers tend to be general then specific
    • Learning Behaviors:
      • Use learning behaviors in:
        • Altering weights and probabilities of behaviors
        • Learn the agent when to use the specific behavior
      • GA was used successfully in that area
      • There are 2 papers useful in that topic:
        • Competition, Coevolution and the Game of Tag
        • Evolution of Corridor Following Behavior in a Noisy World
    • Common Steering Behaviors:
      • Approach
      • Pursuit
      • Evade
      • Arrive
      • Avoid
      • Wander
      • Purist With Offset
      • Patrol
      • Match Target Speed
      • Hide
      • Interpose
      • Orbit
      • Flow Field Following
      • Queuing
    • Data-Driven Steering Behaviors:
      • This will be grateful for game designers because with one mouse click a new behaviors will be added to your system
  • Optimizations:
    • Load Balance:
      • Update certain agents in certain loops
        • Take care here if you are using flocking groups so, all the group should be updated
      • Update agent under condition
        • Like if we have a leader and a following group, the group will not be updated only if the leader changes his state
      • Using less costly combination methods for certain percentage of time
        • In order to partially bring down CPU cost without losing all the accuracy in your game
    • Priority/Weight Adjustments:
      • Assign the highest propriety to the least expensive behaviors you have (also does work well)
      • The less cost behaviors could be checked first
  • Design Considerations:
    • Genre: preferred to be used with tactical types
    • Agent Reactivity: very reactive and able to be adjusted
    • System Realism: suitable for realism
    • Genre:
      • Genres that require emergent, organic movement from AI controlled agents
      • Genres that have groups and flocking behaviors exist
    • Development Limitations:
      • Make sure of the produced emergent behaviors by system
  • Note:

Always check that you problem is really simplified break down to the simplest behaviors you have

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

 
%d bloggers like this: