• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Replays break on trigger created units

Status
Not open for further replies.
Level 9
Joined
Mar 26, 2017
Messages
376
In my map, I create all starting units in a trigger. It checks if a player slot is playing and then creates the player's units.

The logic works correctly and all units are created. But in a replay the unit orders are no longer transmitted, essentially breaking the replay. The units just stay static for the whole replay.

Now I tested this parallel with preplaced units, and orders on these units are transmitted correctly. So its not the entire replay breaking, but just that orders on script created units are not registered.

Anyone know what it could be? I'd rather not have to change the entire unit creation process into preplaced units. Because I do a fair amount of indexing.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Sounds like the unit reference values used by replays to record targets of orders desync. Or possibly the replay did not record the information at all.

Make sure the units are created in response to a trigger event firing, or trigger being run by the initialization thread. Anything that creates objects or manipulates the game in the script load thread (run in the root of the script, outside functions) can be highly bug prone, including being subject to garbage collection when the object is still referenced as part of another object.
 
Level 9
Joined
Mar 26, 2017
Messages
376
The function is part of the initialization thread, and the units are properly created in the replay.

It must be related to a desync then. Perhaps I am using a function that desyncs in a replay.
I have previously found that manipulating this particular frame causes replays to crash instantly: BlzFrameGetChild(BlzGetFrameByName("ConsoleUI", 0), 7)

Now currently I'm manipulate that frame in a block with a check on ReloadGameCachesFromDisk() to determine if in a replay.
Perhaps this may disrupt the handle count.

I will attempt removing this function, and some other initialization functions to check what is the cause.
 
Level 29
Joined
May 14, 2021
Messages
1,118
This problem occurred for me after made several changes for AI Script.
The replay works as intended, but after 10 minutes mark, computer starts doing strange behavior and my heroes didn't get resurrected. Regular units train indefinitely.
 
Level 9
Joined
Mar 26, 2017
Messages
376
I found the issue. Even just using BlzGetFrameByName without any manipulation already breaks/desyncs replays.
Solved this by putting all such calls in a block that checks if the user is in a replay.
 
Status
Not open for further replies.
Top