Blockflow
Blockflow copied to clipboard
Flow timing gets synchronized when multiple Command Processors execute the same Command Collection concurrently
When multiple Command Processors run the same Command Collection at the same time, their flow timings seem to get synchronized unexpectedly.
I've created a minimal project to demonstrate the issue:
In the provided code, Pawn1 has a 2-second wait, and Pawn2 has a 3-second wait. The expected behavior is that the print logs should appear 2 and 3 seconds after the game starts, respectively.
However, both prints appear exactly 2 seconds after the game starts. It seems like the timing of the flow is being shared or synchronized between the two Command Processors, even though they should operate independently.
Used Blockflow version is 1.1
Issue seems related to shared resources, still debugging...
Yeah, definitively related to shared resources:
Coroutine ends, and since both are the same custom command, both receives the signal (because they're the same even being in different processors)
Maybe a possible solution could be ensuring that all collections are unique at the time they're used 🤔
Yeah, is that:
We must have to ensure that, if collection is local to scene, contained collections are local to scene too, possibly related to https://github.com/godotengine/godot/issues/16478
Edit: Forgot to mention that this can be solved this way:
Now the question could be: should we make all collection local to scene? 🤔
It works for me! Thank you!
Seems like it's fixed on Godot 4.5 https://github.com/godotengine/godot/pull/100673 I'll test with the new version just in case
The minimal project is not working...
with what plugin/godot version?
Godot_v4.5-beta1_win64 and 1.1 plugin https://github.com/AnidemDex/Blockflow/issues/183#issue-2976767877
hmmmmm It opens fine if I download the project as is, but the bug is not solved indeed. If the project doesn't open, can you share the log that you get on terminal if you execute with verbose and debug options?
./Godot_v4.5-beta1_win64_console.exe --verbose --debug
It should print a lot of stuff in terminal/console, you can paste it here or in a gist
Edit: Yeah, is not solved in 4.5 because I use a custom "duplicate" function 😓
https://github.com/AnidemDex/Blockflow/blob/ee0f50d46b873c3b38ae7d94ed2bc4c3341d6891/collection.gd#L60-L68
The fix is still the same, resources must be forced to be marked as duplicated and local to scene to break the connection