BehaviourToolkit icon indicating copy to clipboard operation
BehaviourToolkit copied to clipboard

`FiniteStateMachine` only processes one event per frame.

Open nickswebsite opened this issue 2 years ago • 1 comments

FiniteStateMachine only processes one event per frame.

I'm not sure if this is a bug or if it is intentional, but it was certainly a surprise to me. I was expecting the event stream to complete its processing within a given _process_*() callback. Ultimately this assumption led to some really wonky behaviour and/or delayed transitions as the queue backed up.

I can hack in a solution locally, but if this is intentional I'd rather not build on a hacked solution that breaks fundamental assumptions of the library.

I'm not sure what the intent is here. Could I get some clarity?

nickswebsite avatar Apr 18 '24 14:04 nickswebsite

Currently it only parses one event per tick.

	# Check if there are events
	if current_events.size() > 0:
		# Get the first event
		event = current_events[0]
		# Remove the event from the list
		current_events.remove_at(0)

This is by design. However it is a valid discussion if it should support handling more than that.

ThePat02 avatar Apr 18 '24 16:04 ThePat02