Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Internal AI FSM transition from an external Raycast's results


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 UraniumSlug   Members   -  Reputation: 157

Like
0Likes
Like

Posted 28 April 2014 - 05:03 AM

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?



Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7987

Like
1Likes
Like

Posted 28 April 2014 - 05:44 AM


Since the states check their transition logic internally every frame it seems counter-intuitive to force a transition to the HurtState externally.

If your FSM already checks its internal state every frame(hp<threshold => transition to hurtstate), then you just need to modify the decision attributes when reacting to an external event ( hit trigger => hp -= dmg).



#3 UraniumSlug   Members   -  Reputation: 157

Like
0Likes
Like

Posted 02 May 2014 - 03:29 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS