Closed Redo11 closed 3 months ago
thats like what rand does
where is the bug
use sync
i am using sync
the problem still persists
thats like what rand does
I don't think it's intended to cause desynchronization between clients. I have a use case for rand that requires it to be synchronized to be properly playable.
the problem still persists
how often are you using sync and are you waiting at least a little bit
the problem still persists
how often are you using sync and are you waiting at least a little bit
i am using the function constantly. The whole gameplay of my map depends on it.
the problem still persists
how often are you using sync and are you waiting at least a little bit
i am using the function constantly. The whole gameplay of my map depends on it.
it has a delay
certainly you can wait 3 ticks
What do you mean wait a tick? Where? When? And why is that required and not specified?
What do you mean wait a tick? Where? When? And why is that required and not specified?
its 3 ticks my bad
Since it's per variable, it should be fine. I already have 0.03 wait, I will bump it to 0.05, but it shouldn't be the main cause either.
Spawning visual effects appear on the client side, where on the host/server side they do not exist, since nothing is spawning. The client thinks the X and Y variables as well as random wait time are absolutely different variables from the truth of host.
↑Client ↑ host
Spawning visual effects appear on the client side, where on the host/server side they do not exist, since nothing is spawning. The client thinks the X and Y variables as well as random wait time are absolutely different variables from the truth of host.
do you expect every single double to be synced over the network?
Attempts are made to synchronize the random seed, but it's not reliable, and never will be. Don't use random when synchronization matters.
Platforms
Linux
Build
146 steam
Issue
When a processor assigns a random value to a variable, there is an automatic desynchronization between the server and client. I am making a gimmick map, heavily dependent on logic that uses randomized variables in multiple places. It works absolutely fine in single player, but in multiplayer, it causes problems, as effects are spawning in wrong places, resources get added and removed when client synchronizes them back and fake values inside of storage cells being presented client side.
Steps to reproduce
Make a processor, put code that randomizes two values with @mapw and @maph being saved as x and y Next put some code that shows a visual effect at the random positions. Start another instance and join the game. The effect will be spawned in 2 different locations for each client
Mods used
Vanilla
Save file
minedustry 4.msav.zip my map. The boulders spawn effect is played at a wrong place on a separate client and "mined boulders" variable at the top is wrong/fake.
(Crash) logs
No response
Submission