• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Short trigger desync's

Status
Not open for further replies.
Hello,

In my map I have the following trigger as part of a shop system :

  • Open List
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Level of Select Hero [Arrow] for (Triggering unit)) Not equal to 0
    • Actions
      • -------- Open List --------
      • Set VariableSet POINT = (Position of (Triggering unit))
      • Set VariableSet UG = (Units within 0.01 of POINT matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Sold unit))).)
      • Selection - Select UG for (Owner of (Buying unit))
      • Unit - Remove (Sold unit) from the game
      • Custom script: call DestroyGroup(udg_UG)
      • Custom script: call RemoveLocation(udg_POINT)
It causes desync systematically when I (player one) trigger it. Anybody has an idea of why ?
Maybe because I remove the sold unit inside a callback trigger on unit sold event ?

Explaination notes:
- There is a visible shop that sells units (1 unit = 1 item category: weapons, shields, wand...), and 6 dummy units at the same position that sell the items (one dummy unit per item category).
- When the player clicks a category in the visible shop, the trigger executes. I use the sold unit-type to retrieve the good dummy unit & select it. Thus the player can buy the items of this category.

Edit : I think it did not desync before Reforged release..
 

Attachments

  • SelectGroupForPlayerBJ desync.w3m
    16.6 KB · Views: 21
Last edited:
Level 2
Joined
Jul 1, 2020
Messages
22
Hello,

In my map I have the following trigger as part of a shop system :

  • Open List
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Level of Select Hero [Arrow] for (Triggering unit)) Not equal to 0
    • Actions
      • -------- Open List --------
      • Set VariableSet POINT = (Position of (Triggering unit))
      • Set VariableSet UG = (Units within 0.01 of POINT matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Sold unit))).)
      • Selection - Select UG for (Owner of (Buying unit))
      • Unit - Remove (Sold unit) from the game
      • Custom script: call DestroyGroup(udg_UG)
      • Custom script: call RemoveLocation(udg_POINT)
It causes desync systematically when I (player one) trigger it. Anybody has an idea of why ?
Maybe because I remove the sold unit inside a callback trigger on unit sold event ?

Explaination notes:
- There is a visible shop that sells units (1 unit = 1 item category: weapons, shields, wand...), and 6 dummy units at the same position that sell the items (one dummy unit per item category).
- When the player clicks a category in the visible shop, the trigger executes. I use the sold unit-type to retrieve the good dummy unit & select it. Thus the player can buy the items of this category.

Edit : I think it did not desync before Reforged release..
Try with out Selection action i had problems with it before.
 
Desync or crash? Have you tested which line is the cause of it? Anyways, I experienced weird behaviour some months ago with "Selection" actions. I would try not to use event responses after it. In my case I experienced also locals sometimes had wrong values (empty) after the select. I could fix it in my case not to use variables after the select, but it anyways ran into very werid gameplay problems sometimes, which I could not prevent programatically, which forced me not to use it completly..
(it could be patched out, eventually)
 
Desync or crash? Have you tested which line is the cause of it? Anyways, I experienced weird behaviour some months ago with "Selection" actions. I would try not to use event responses after it. In my case I experienced also locals sometimes had wrong values (empty) after the select. I could fix it in my case not to use variables after the select, but it anyways ran into very werid gameplay problems sometimes, which I could not prevent programatically, which forced me not to use it completly..
(it could be patched out, eventually)

Desync, not crash (a file got generated in the Logs folder, and i got the game score screen).
I added logs, the whole trigger seems to execute on my computer (player 1). I could log X/Y coords & dummy unit name without an y issue.

call Preload( "[DEBUG] [00:00:9.781] Trigger gg_trg_Open_List executed" )
call Preload( "[DEBUG] [00:00:9.781] shop X = 0.000" )
call Preload( "[DEBUG] [00:00:9.781] shop Y = -8704.000" )
call Preload( "[DEBUG] [00:00:9.781] dummy = [List 3 Jewelery]" )
call Preload( "[DEBUG] [00:00:9.781] all done" )
call Preload( "[DEBUG] [00:00:9.906] Trigger gg_trg_Disconnect executed" )
call Preload( "[DEBUG] [00:00:9.906] Disconnect - Player 1 Ricola3D#2941" )

I only use globals (POINTS & UG), and their value is set at the beginning, and reset at the end.
I tried increasing the distance from 0.01 to 1 in case Reforged vs old would have different precision, it still desyncs...
I also replaced the "remove sold unit" by en expiration timer of 1s.

If I comment the "select unit group" instruction : no desync but the feature doesn't work.
So I guess 2 options:
- The groups are different between player PCs due to a reforged/classic thing
- owner of buying unit is defferent between players PC due to a bug ?
- The "select unit group" primitive is bugged

no ?
 
Desync or crash? Have you tested which line is the cause of it? Anyways, I experienced weird behaviour some months ago with "Selection" actions. I would try not to use event responses after it. In my case I experienced also locals sometimes had wrong values (empty) after the select. I could fix it in my case not to use variables after the select, but it anyways ran into very werid gameplay problems sometimes, which I could not prevent programatically, which forced me not to use it completly..
(it could be patched out, eventually)

I replaced "Select unit group for player" by clear + "select unit for player" in a "For each unit in unit group" and it seems better.

WTF...

If we look code, the only difference is that if for some reason the group contains many units, only the last one will be selected. But with my logs I did see only 1 unit in it.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
What is the point of this trigger? it looks like you are forcing the player to select a unit and then instantly removing it after it is selected?

Possibly the selection action is causing a net synchronization that breaks due to the unit being removed.

Set VariableSet UG = (Units within 0.01 of POINT matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Sold unit))).)
Why not create an empty unit group and explicitly add sold unit to it?
 
What is the point of this trigger? it looks like you are forcing the player to select a unit and then instantly removing it after it is selected?

Possibly the selection action is causing a net synchronization that breaks due to the unit being removed.


Why not create an empty unit group and explicitly add sold unit to it?

It is from this system : Item Lists v1.01

There is one visible shop that sell units, and 5 hidden units that sell items. 1 dummy per item category of the shop.
When the user clicks a category button from the shop, it buys a temp unit, from it we retrieve the dummy unit of same type & select it. Then items from this category are displayed & can be bought.
 
Can you confirm the desync is present in that map with the latest version of Warcraft III? If necessary apply minimal modifications so it can be tested in multiplayer. This is to rule out other trigger interactions being a cause.

This system map doesn't work anymore in patch 1.32 unfortunately, dummy units that should be placed at the exact same position of the shop are missplaced (if I remember well, it's because of "building requires - buildable" that do not allow building collisions anymore).

I could try editing it a little bit to fix this issue + add other players and test ?
 
Last edited:
Can you confirm the desync is present in that map with the latest version of Warcraft III? If necessary apply minimal modifications so it can be tested in multiplayer. This is to rule out other trigger interactions being a cause.

I bought W3 reforged so I can test myself desyncs (by launching the game twice on my PC^^).
I edited the map from Shop Lists v1.01 by replacing "Building requires - buildable" by "Building requires - <empty>" & adding 3 user players.
I launched a bnet game and joined with 2 accounts : systematic desync when clicking a category in the shop.

:S


You can also reproduce it with this minimal map:
- 2 players
- 1 unit
- 1 trigger : type "test" => select all units & call SelectGroupForPlayerBJ for the selected unit group = desync
 
Last edited:
Would you post your test map that produced the desync?

The attached map is the simplest one to reproduce the desync, a new custom map with:
- 2 players
- 1 random unit
- 1 test trigger of 4 lines

Just start a bnet game with it and 2 players, and type "test" message.
For ex if player one types "test", player 2 desyncs 100% of the time.
 

Attachments

  • SelectGroupForPlayerBJ desync.w3m
    16.6 KB · Views: 23
  • Like
Reactions: Kam
Status
Not open for further replies.
Top