Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About Whorse

  • Rank
  1. Whorse

    Decision Tree Delays

    Upon further thought, a structure could be returned with the Action type that was run and the amount of seconds to wait. Store the last Action type, if the new Action type is the same as the last Action type do nothing, if it's a different action type then trigger it.
  2. I've graduated from using a cluttered FSM for my AI to a Decision Tree of my own creation. I'm using Unity3d and C# for this pet project. I've structured my tree in the following manner without pointer capabilities. However my question, could apply to any decision tree which might implement coroutines. protected virtual void Update() { StartCoroutine(TriggerTree()); } IEnumerator TriggerTree() { yield return rootDecisionNode.StartCoroutine(rootDecisionNode.TriggerPath()); } Currently every Update() call a run through of the tree's branches is triggered and it checks branch logic paths to see what leaf should be reached. The last Action leaves at the end of each branch return new WaitForSeconds.   I'm interested in learning the best way to halt the decision tree or perform an animation but still be able to run the tree and check if another leaf has been reached. So if my character is idling, wait for the idle animation to finish before playing another idle animation but if the character is damaged then trigger the damage animation. Is my code design for a decision tree without pointers sound enough as it is?
  3. Keeping it internal like you suggested led me to compare the previous frame's health with the current health. Depending on the amount it had changed, I trigger different animations or death.
  4. I'm making good progress on a shooter I've been working on for the last few months, I've now moved onto the AI. Currently I perform a Raycast from my base Weapon class to check for impacts, and then invoke a function on the hit object after performing the necessary checks. I've implemented an FSM pattern for my enemy AI and I'm having trouble coming up with an elegant solution to transition to a HurtState from another state to perform hurt animations and to momentarily stop the enemy's movement. Since the states check their transition logic internally every frame it seems counter-intuitive to force a transition to the HurtState externally. What's the best way to achieve what I'm after without hacking something in or am I thinking too much into this?
  5. Here it is:   https://github.com/idmillington/aicore   The URL provided in the book was dead.
  • 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!