HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Tests about sync

07-02-2004, 09:01 AM#1
danny760311
I just made a test with my friends with local trigger to see whether it de-syncs, and the results are:

(The following actions were run for 1 player ex: if GetLocalPlayer() == Player(0) then......)
("O" means sync; "X" means de-sync)
Code:
 1.Fade Filter (Fade Out)                                            - O
 2.Fade Filter (Fade In)                                             - X
 3.Fade Filter (Fade Out and back In)                                - X
 4.Advanced Fade Filter                                              - O
 5.Player Sound                                                      - O
 6.Player Sound at Center of (Playable Map Area)                     - X
 7.Player Sound at (X,Y)                                             - O
 8.Change Unit Vertex Color                                          - O
 9.Change Unit Size                                                  - O
10.Add a special effect on Unit                                      - X
11.Add a special effect on Unit and destroy                          - X
12.Do something while GetCurrentCameraTarget() is in rect            - X
13.Do something while (GetCurrentCameraX, GetCurrentCameraY) in rect - O
14.Display a random number                                           - X


So my conclusion is:
1.Creating an object for only 1 player (or create different objects for each player) will de-sync (even the object is destroyed immediately).
2.Get a random number for only 1 player will de-sync (I think it's because it masses the random seed).


P.S: Explanation of the results according my conclusion:

Code:
 2.Fade In creates a timer to fire for not displaying the fade filter, so the timer causes de-sync.
 3.Fade Out and back in creates 2 timers to fire for not displaying the fade filter, so the timers cause de-sync.
 6.Center of Playable Map Area creates a location and causes the de-sync.
10.The created effect causes the de-sync.
11.The created effect causes the de-sync.
12.GetCurrentCameraTarget() creates a location and causes the de-sync.
14.A random number causes the de-sync.

I don't know whether it's right, hope the test benefits.
07-02-2004, 01:54 PM#2
Cubasis
It is correct. When any handle object is created, it's address is one higher than the last one. So all players object addresses are usually synced. But if only one player creates a handle. His next handle will be 1 higher than all the other players.

And the random number theory is also correct, just look up how random numbers are generated (if you don't know it already).

Anyways, I still wish blizzard gave us a "Hide/Show Special Effect" function. And ofcourse a DestroyTrackable function.

~Cubasis
07-02-2004, 07:31 PM#3
Vexorian
I managed to add a special effect for a player, but only as point special effect, I have a caster (casters in my system use a model that is invisible but has attachment points) , give it the special effect and 0 alpha with the vertex coloring native for the local player...
07-02-2004, 11:25 PM#4
Cacodemon
Has anyone tested ShowUnit() desyncs or not?
07-03-2004, 03:18 AM#5
danny760311
de-sync I think.
07-03-2004, 07:51 AM#6
Cubasis
Hmm, this actually gave me a pretty wacky idea.

<thinks for awhile before going out to test it>

EDIT:

OMGWTFBBQ!!!! IT WORKED!!.

*goes mad and jumps around like a monkey screaming "IT WORKED"*

*Cools down a bit*

Ooookey.... My pretty insanely wacky idea actually worked. I actually ... managed to do.... Local .... Special Effects!. >_<

I just tested it online a few minutes ago...and it worked 100%.

Anyways, I'll submit it as a function to wc3sear.ch later today (running off for work now), but it has a qualm, so it isn't really globalizable, that is, it kinda needs a tiny implementation into every map.

~Cubasis
07-03-2004, 07:18 PM#7
weaaddar
what works?
07-03-2004, 09:05 PM#8
Vexorian
Quote:
Originally Posted by Cacodemon
Has anyone tested ShowUnit() desyncs or not?
It surely desyncs because I hidden unit can't be attacked.

weaaddar: Cubasis is talking about local player only special effects
07-05-2004, 03:11 PM#9
Cubasis
Ok, first, i'm sorry for not having posted it yet, as my last 2 days became very busy.

But yeah, basicly, here is my uber-funny function.

Code:
function CreateLocalSFX takes player P, location loc, string EffectName returns effect
   if(GetLocalPlayer() != P)then
	  set loc = udg_Hidden
   endif
   return AddSpecialEffectLoc(EffectName,loc)
endfunction

That's it, hillarious, right? Heh, as De-Syncs originate most of the time of out-of-sync Handle-pointers, I tried to think of ways to create a SFX for all players without everybody seeing it. Then that idea popped in. And in reality, as I booted up that map in BNet, I didn't really think it'd work. Cuz it involves showing a graphical stuff on different places for each player, which sounded majorly de-syncy. But .... it worked. I could create and Destroy effects without a problem as much as I wanted with this function, and only 1 of us would ever see the effect each time.

So yeah,

Basicly, udg_Hidden needs to be replaced with a constant location of a un-reachable and un-seeable spot on the map. In my example it was on the black boundaries of the map.

~Cubasis
07-05-2004, 04:57 PM#10
Vexorian
What about:

Code:
function CreateLocalSFX takes player P, location loc, string EffectName returns effect
   if(GetLocalPlayer() != P)then
	  set effectname = ""
   endif
   return AddSpecialEffectLoc(EffectName,loc)
endfunction
I don't know if it desyncs, but if yours worked trying this shouldn't harm
07-06-2004, 01:53 AM#11
Cubasis
Yeah, it should work.

Weaaddar actually told me that KaTTaNa had found this solution too (in a thread in the jass vault), in the same time I did, and he used that too (don't know why I didn't think of this :P).

Anyways, I just wonder:

Will it create a <no-model> effect for all players?
if not:
Won't it return NULL for all players which may or may not mess up later, perhaps when passed to DestroyEffect or sumtin.
or worse:
Won't the handle-list then be out-of-sync, if only 1 player gets a working model.

However, KaTTaNa most likely tested it to see if it worked already.

~Cubasis
07-06-2004, 04:15 PM#12
Vexorian
I think that When you add a "" special effects it creates a effect with no model, anyways, if it works, It will also work with AddSpecialEffectTarget which Is really a good thing
07-10-2004, 09:18 PM#13
Vexorian
Bumping cause I had an idea, what if we use the location trick to actually create a trackable in a position for a player, and in other position for the rest , then doing with one trackable per player, and using game cache, we can make Multiplayer compatible trackables
07-11-2004, 09:50 AM#14
PitzerMike
Quote:
Originally Posted by Lord Vexorian
Bumping cause I had an idea, what if we use the location trick to actually create a trackable in a position for a player, and in other position for the rest , then doing with one trackable per player, and using game cache, we can make Multiplayer compatible trackables

I doub't that it wouldn't desync because a trackable would have influence on the pathing map. So as soon as units wanted to cross that location we would prolly have a desync.
Then again we can only place trackables facing 0 degrees wich sucks even more.
07-12-2004, 11:58 AM#15
Cubasis
errrr....

Trackables don't affect pathing maps, do they? If I remember correctly while testing, my units walked through them model-wise.

~Cubasis