• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

SetBlight Desync Issues

Level 5
Joined
Jan 5, 2017
Messages
9
I haven't seen anyone post about this but thanks to the guys working on W3CE it's been revealed that the SetBlight native has a major problem: it will remove blight (regardless of the value of the addBlight argument) for any player that is holding down the shift key. This can easily cause a desync.

Link to conversation

The solution is to use the other natives, which aren't affected by the shift key:
JASS:
native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing
native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing
native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing

Abilities that create blight, such as the Sacrificial Skull and Undead building creation, also don't suffer from the issue.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
542
Interesting. Has this always been there or just in recent patches?
Do you fancy writing a PR for my jassdoc as i'm not really into discord. Also i cannot recreate this in singleplayer so mp only effect?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Can neither reconstruct it in singleplayer nor multiplayer using SetBlight(Player(0), 0, 0, 512, true).

But in the World Editor, in the terrain editor, you can invert the effect of placing Blight, placing Boundary or removing Boundary by holding left or right shift (regardless of capslock).

Also with SetTerrainType(0, 0, 'NOTH', 0, 3, 0), you can place boundary or remove boundary when holding left or right shift (regardless of capslock) ingame both in singleplayer and multiplayer, but it's only a graphical overlay without changes to pathing.
 
Level 20
Joined
Jan 3, 2022
Messages
355
The SetBlight comment was mistaken, the discussion evolved into why the SHIFT check is there. I tested SetBlight in 1.27 and 1.36. NOT AFFECTED BY SHIFT.
Instead SetTerrainType(0, 0, FourCC('NOTH'), 0,5,1) is affected by the SHIFT key. Water explained above.

Detailed explanation in jassdoc issue
PS: It'd be great if you removed the desync tag and changed the title @SwissDerd
 
Top