Blockflow icon indicating copy to clipboard operation
Blockflow copied to clipboard

Flow timing gets synchronized when multiple Command Processors execute the same Command Collection concurrently

Open aoisensi opened this issue 7 months ago • 12 comments

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:

project.zip

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.

aoisensi avatar Apr 07 '25 12:04 aoisensi

Used Blockflow version is 1.1

aoisensi avatar Apr 07 '25 12:04 aoisensi

Issue seems related to shared resources, still debugging...

AnidemDex avatar Apr 13 '25 20:04 AnidemDex

Yeah, definitively related to shared resources:

Image

Coroutine ends, and since both are the same custom command, both receives the signal (because they're the same even being in different processors)

AnidemDex avatar Apr 14 '25 00:04 AnidemDex

Maybe a possible solution could be ensuring that all collections are unique at the time they're used 🤔

AnidemDex avatar Apr 14 '25 00:04 AnidemDex

Yeah, is that:

Image

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:

Image

AnidemDex avatar Apr 14 '25 00:04 AnidemDex

Now the question could be: should we make all collection local to scene? 🤔

AnidemDex avatar Apr 14 '25 00:04 AnidemDex

It works for me! Thank you!

aoisensi avatar Apr 14 '25 06:04 aoisensi

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

AnidemDex avatar Jun 26 '25 23:06 AnidemDex

The minimal project is not working...

aoisensi avatar Jun 27 '25 01:06 aoisensi

with what plugin/godot version?

AnidemDex avatar Jun 27 '25 23:06 AnidemDex

Godot_v4.5-beta1_win64 and 1.1 plugin https://github.com/AnidemDex/Blockflow/issues/183#issue-2976767877

aoisensi avatar Jun 28 '25 09:06 aoisensi

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

AnidemDex avatar Jul 01 '25 03:07 AnidemDex