• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Can we sync local values from 1 Player to every other and how?

Status
Not open for further replies.
Level 6
Joined
Mar 27, 2019
Messages
51
Hey there,

I'm currently experiencing desyncs in my map. I mostly think that they are caused by functions like these ones:

  • Test
    • Events
      • Player - Player 1 (Red) issues Mouse Down event
    • Conditions
    • Actions
      • -------- Example 1 --------
      • Set VariableSet Temp_Point = (Point((Source X of current camera view), (Source Y of current camera view)))
      • -------- Example 2 --------
      • Set VariableSet Temp_Point_2 = (Point((Mouse Position X for Triggered Mouse Event), (Mouse Position Y for Triggered Mouse Event)))
      • -------- Clear up --------
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call RemoveLocation(udg_Temp_Point_2)
If I wanted to use GetLocalPlayer (or not), is there a way to sync the value to the other 11 players?
For example Player 1 has a different Mouse Position X/Y or Source of current Camera is there a way to share the value to the others so they dont desync if a If-Statements or else occurs? Or am I on the wrong way and those functions dont cause desyncs?

Help and clarification would be great!
 
(Point((Source X of current camera view), (Source Y of current camera view))) is different for each player.
While the Mouse Point is the same for all players (inside the event).

One can Send Strings to other players using BlzSendSyncData which is not ported to GUI. An jass example [Solved] - Target of (Current Camera) desync
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
is there a way to sync the value to the other 11 players?
Yes there is. This is used by all modern save/load system as part of their loading I/O.

There are 2 traditional approaches. The first is to sync local game cache content with all players but this is very slow. A faster approach was found which used unit selection orders to sync data and is what a lot of maps used for their save/load synchronization.

I think new natives were recently added which can bulk sync data more efficiently than the above. I am not sure.

One might have to convert the location/coordinates into binary data for synchronization and then recreate them once synchronized.

@TriggerHappy may know more since he was involved in file I/O based save/load systems for a while.
 
Level 6
Joined
Mar 27, 2019
Messages
51
Yes there is. This is used by all modern save/load system as part of their loading I/O.

There are 2 traditional approaches. The first is to sync local game cache content with all players but this is very slow. A faster approach was found which used unit selection orders to sync data and is what a lot of maps used for their save/load synchronization.

I think new natives were recently added which can bulk sync data more efficiently than the above. I am not sure.

One might have to convert the location/coordinates into binary data for synchronization and then recreate them once synchronized.

@TriggerHappy may know more since he was involved in file I/O based save/load systems for a while.

I'm gonna take a look into unit selection orders. Thank you.

Thanks @Tasyen for the Thread. Gonna look it up & try to get it working.
 
Status
Not open for further replies.
Top