HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetLocationZ desync

01-04-2007, 03:30 PM#1
Vexorian
GetLocationZ can desync if there are terrain deformations around, I am not sure about trigger-create terrain deformations but certainly thunderclap causes GetLocationZ to return different values for different players.

This issue should not affect you unless something in your map affects gameplay according to GetLocationZ() , I have some bouncing stuff in my map that would kill you sometimes depending on height, for example.
01-04-2007, 03:32 PM#2
iNfraNe
Trigger created do not desync, and the thunderclap probably only desyncs cus some ppl have spell detail on low?
01-04-2007, 03:38 PM#3
Vexorian
It could be it
01-04-2007, 03:55 PM#4
Joker
What is locationZ?
01-04-2007, 04:01 PM#5
Rising_Dusk
A location's distance above the X/Y plane in the WC3 world.
Basically a height value.
01-04-2007, 04:46 PM#6
Ammorth
Quote:
Originally Posted by INfraNe
Trigger created do not desync

unless they are player local deformations.
01-04-2007, 06:49 PM#7
Daelin
Well, playing with terrain height can be quite a mess. Because of Fog Of War, different players can see different areas in a different way (take for example trees, or buildings, or even spells). But it's a bit odd that GetLocationZ causes desync, because it WILL return a value for all the players (just not the same). After all, we've done stuff such as storing different values for different players. Hmm... Weird!

~Daelin
01-04-2007, 07:52 PM#8
Captain Griffen
The second paragraph indicates Vex is saying that it won't desync on it's own, just that using the value may cause a desync.
01-04-2007, 11:22 PM#9
Ammorth
The only time GetLocationZ() desyncs is when it gets the z height of an effect created within part of GetLocalPlayer(). Exmaples include player-only terrain deformations and thunder clap (apperently when the spell detail is different). Other than that, the value should always be syncronized between players, at least it always has been for me.
01-05-2007, 12:46 AM#10
BlinkBoy
Is easy to solve the desync, just in case. All you do, is that you insert the different values in a gamecache, sync them to the host's, and get it back. The only problem is that it is a slow function, use it, in those places where a desync may occur.

Collapse JASS:
//! library Z initializer Init_Z
globals
        gamecache G
endglobals

private function Init_Z takes nothing returns nothing
set G = InitGameCache("justanothergamecache.jag")
endfunction

function GetLocZ takes location l returns real
call StoreReal(G, "desyncs", "zloc", GetLocationZ(l))
call TriggerSyncStart()
call SyncStoredReal(GameCache(), "desyncs", "zloc")
call TriggerSyncReady()
return GetStoredReal(GameCache(), "desyncs", "zloc") 
endfunction

//! endlibrary
01-05-2007, 10:47 AM#11
iNfraNe
yes, but that would take ages to sync. Not an option in most cases.
01-05-2007, 10:54 AM#12
Toadcop
Blizzs warn about this... don't use terrain deforms ?
01-05-2007, 11:29 AM#13
Vexorian
Quote:
Blizzs warn about this...
Doesn't really warn about this, common.j actually says it would always desync which is totally false.

...

Blinkboy: That doesn't help too much for movement systems.
01-05-2007, 12:03 PM#14
DioD
Dont ever think about getting locationZ only for host and run functions globally only by hosts check?
01-05-2007, 02:31 PM#15
BlinkBoy
hmm, I ask myself if there's another way to sync every value.