• 🏆 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!

dc / server split problems

Status
Not open for further replies.
Level 19
Joined
Apr 25, 2006
Messages
1,309
So my main problem with my map is that whenever I play it online then in some games suddenly like half of the people drop put. Any ideas what could cause this? I'm not so sure why it is happening but I know I had problems earlier with this function if I put something too much inside for one player. Here is the function thing I use to do something for one player. The things I do is I play sounds, change fog and hide multiboards. Still I have no idea why people get always a random dc, it might not even be because of this function I don't know.
  • Set player = Player 1 (Red)
  • Custom script: if GetLocalPlayer() == udg_player then
  • Sound - Play BUTCHER <gen>
  • Custom script: endif
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
if you create any objects for 1 player only (units, multiboards, etc.) all players but the host will desync

you might try to play the sound for all players but set volume to different values for every player like this:
  • Actions
    • Set value = 0.00
    • Custom script: if GetLocalPlayer() == udg_player then
    • Set value = 100.00
    • Custom script: endif
    • Sound - Set volume of (Last played sound) to value%
hiding and showing stuff localy will work in most cases except it would modify the gameplay (hiding units for local players will desync for example)
special effect strings have to be setted for all players
this will desync:

if GetLocalPlayer == player then
create effect a
else
create effect b
endif

however, many GUI functions of blizzard cause desync as well (some stuff with cameras, unit selection and more)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You can also play the sound like you already do but then you should not kill it with fadeout time or read data from it that could then be asynchronous like GetSoundIsPlaying if you want to use that data for another part of code that should be sync.

special effect strings have to be setted for all players

Code:
function AddSpecialEffectTargetForPlayer takes string modelPath, widget targetWidget, string attachPoint, player whichPlayer returns effect
    if ( GetLocalPlayer() != whichPlayer ) then
        set modelPath = ""
    endif

    return AddSpecialEffectTarget( modelPath, targetWidget, attachPoint )
endfunction

That's okay because a special effect object is created for all players anyway, the model does not matter unless you bomb the memory of one player/have an invalid model that creates locally different problems, then the fatal error of course would not be synced :D I do not know whether a null model/non-existing attachPoint would fabricate a null effect though.

this will desync:

if GetLocalPlayer == player then
create effect a
else
create effect b
endif

Why would it? When you create one at ground and the other one on unit, these could be handled differently when the effect is destroyed/unit vanishes. But when they are both of one type and "at the same" time, the handle counter won't be corrupt and the destroy function would work likewise. The model/attachPoint does not really influence it.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Why would it? When you create one at ground and the other one on unit, these could be handled differently when the effect is destroyed/unit vanishes. But when they are both of one type and "at the same" time, the handle counter won't be corrupt and the destroy function would work likewise. The model/attachPoint does not really influence it.

unfortunately warcraft 3 does not care about this
I had various problems with my inventory system and tested like 100 different cases online in multiplayer
it might work in special cases but for me it did not
safest way is to do it like I mentioned (changing the string and creating the effect for all players what you pointed out in your jass trigger)
 
Status
Not open for further replies.
Top