Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

123 Neutral

About lucasite

  • Rank
  1. Hi everyone, Ive recently been reading about behavior trees for AI and how they work. There's lots of great stuff on here. However Im stuck with a question. Imagine I have an AI truck, that needs to drive to point A, load up some goods, then drive to point B and unload them. These are laid out appropriately as leaf nodes in a behavior tree.   What happens when an action takes a large amount of time? For instance, in each game loop, no other nodes will be tested whilst the drive from point A to point B node continues to execute. But what happens if the truck is attacked by bandits halfway through? There may well be a whole new set of rules for handling this situation, but Im always executing this "transport" node until its complete.   My only thought is rather than have a node that says "drive from point A to point B", it would become "move 5 feet in the direction of point B as long as there's no bandits around...and there's still fuel.....and the driver is not tired". My concern is thats alot of questions to ask, each game loop, for each AI entity.   Is this the right way to handle these long actions, by chopping them up and avoiding them altogether? Or is there a better way for this scenario?   regards   Luca
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!