Behavior 1.0.3: Keep listening to Event channel until condition succeeds

Greetings,

the WaitForEvent Node on the Behavior Graph waits until it recieves an event. If there is a condition after and it is not met, I would like to keep listening to the event. The workaround would be adding a repeat until success node, but this makes us unsubscire/ subscibe to the event each time the event is called.
To make it even clearer: If our player gets hungier each frame, so the event is called, but we only want to trigger a state transition when a Hunger-Threshold is met.

  1. Event Call (Success)
  2. Threshold Met (Failure)
  3. Now have to Repeat the process just to wait for the threshold to succeed, this causes a lot of subscribing/ unsubscribing each frame.

Thank you for your time.

Hi @NixonAroboX! :slight_smile: Thanks a lot for the feedback.

Would it be helpful for you if you would be able to add a condition directly on the Wait for Event, to add a requirement for the node to only catch and unsubscribe to the event successfully if the attached condition results to true? Similarly to as how you can add conditions on the conditional node types.

I think this is something that we could consider adding as an “advanced” setting to the Event node to make it more flexible for different use cases when using the same event channel. Not sure if this would make sense for the issue that you were describing - if you have any additional ideas on how to improve the node(s) and how they should be able to be set up, please let me know!

Hey Laura,

thank you for your reply! I think having optional conditions to the event node would be very nice. This also goes hand in hand with some modifier nodes like restart, where we can assign conditions aswell!
And that would totally fix the issue of performance overload (Lot of unnecessary sub and unsubscribing)

Thank you for your time!

Quick add to the old one. Since it is already a thing to Start > Mode Restart on Event Message (Comparable with Any State Transitions), adding conditions to the WaitFor Node would be like the At State To State Transition workflow

@NixonAroboX Great to hear! And no problem at all, I’m glad if I can help.

I’ve now added a task for our team to look into improving the event nodes, and attached this discussion as a reference. :slight_smile: We’re currently still quite busy with stability improvements, but hopefully we’ll be able to pick this up soon as well!

1 Like