Interrupt on Event for RTS like Behaviour

JayRock22

New member
So i want to create the most basic RTS Behaviour and do not know if I do this right at all. I created a modified HasReceivedEvent Conditional which waits for input and returns running until the event is received, which already seems sketchy. What i just can not wrap my head around is how can i interrupt the ongoing sequences? In RTS games i want to be able to completely stop anything a unit does when i give new commands. Can you maybe lead me in a direction that's better or am I already doing it right in some way? Later on i want to implement Resource Gathering, Attacking, Chasing etc. all while being able to be interrupted.

Greetings!

1733693623519.png
 
You can use conditional aborts for this. Take a look at this page for an explanation/video:

 
Hey Justin,

I've looked at the video and read the page multiple times but still don't get how i would interrupt a sequence when receiving an Event. Could you maybe send me in the right direction? Like how would you do classic RTS controls on a high level? Thank you so much!
 
You would use a lower priority abort, similar to this example:


The Selector / Sequence pattern can be used for a large number of behavior tree designs and should be appropriate for an RTS as well.
 
Back
Top