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

My map freezes after about 10-15 min of gameplay.

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
770
I have this problem for a long time but never asked for help to solve it until now. My Sailor Moon Castle Defence map seems to freeze after about 10-15 min of gameplay and it often is happening when wave 5 of enemy creeps is coming. My map worked without any problems before Reforged came out but when Reforged came out, this freeze problem started and I have no idéa how to solve it. Another wierd thing is that the map seems to work like it should if I playing it in single player but if it's full with player, this freeze problem starts... I hope someone can help and I send my map here because it's not protected.
 

Attachments

  • Sailor Moon Castle Defence v2.7.w3x
    8.6 MB · Views: 9

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
Freezes are usually caused by some kind of infinite loop.

A common cause would be a unit entering a region being moved to another location but the immediate vicinity of the other location is sufficiently blocked that the unit is displaced into another move region that moves it back. If both sides end up sufficiently blocked, such as ordering an army to enter such a region, it ends up in an infinite loop with the same unit bouncing between both locations due to being displaced back into the teleport regions. Of course there are many ways to trigger such an infinite loop, some I certainly do not know about.

Looking at the map script I see a ton of location leaks. Examples can be seen in all triggers like MonsterTLBug.... Every time a unit enters the region a location is leaked. Leaks should not cause freezes but have been known to generally make Warcraft III less stable, likely due to hitting some internal limits if enough leak.

The triggers MonsterYay and MonsterLvlEnd leak groups. These are the worst kind of leak. Also they use TriggerSleepAction which makes them hard to debug as that is not game time accurate, instead using network synchronised real time.

MonsterMoveSecond ... and Attack Move Order ... triggers are also using a `TriggerSleepAction`wait and also leak locations for every unit that enters.

The Player ... triggers that handle players leaving should disable themselves after the actions run since a player cannot un-quit. Ideally merge them into a single trigger and have that poll the player group of still active players.

You are using a lot of trigger enhanced abilities. I recommend disabling them and seeing if a freeze still happens. Could easily be a bug with one of them interacting with some other trigger.

Your map leaks a lot. Fixing these leaks can help as mentioned above. Generally if anything will run more than a few times it is worth fixing leaks.

Your map uses a lot of TriggerSleepAction (GUI Wait and Wait Game Time) which is not very accurate as far as game time goes and can cause race conditions if not careful. I recommend moving more towards timers for anything that runs frequently and requires a delay. It should be fine in once-off cinematic triggers.
 
Level 14
Joined
Jul 19, 2007
Messages
770
Freezes are usually caused by some kind of infinite loop.

A common cause would be a unit entering a region being moved to another location but the immediate vicinity of the other location is sufficiently blocked that the unit is displaced into another move region that moves it back. If both sides end up sufficiently blocked, such as ordering an army to enter such a region, it ends up in an infinite loop with the same unit bouncing between both locations due to being displaced back into the teleport regions. Of course there are many ways to trigger such an infinite loop, some I certainly do not know about.

Looking at the map script I see a ton of location leaks. Examples can be seen in all triggers like MonsterTLBug.... Every time a unit enters the region a location is leaked. Leaks should not cause freezes but have been known to generally make Warcraft III less stable, likely due to hitting some internal limits if enough leak.

The triggers MonsterYay and MonsterLvlEnd leak groups. These are the worst kind of leak. Also they use TriggerSleepAction which makes them hard to debug as that is not game time accurate, instead using network synchronised real time.

MonsterMoveSecond ... and Attack Move Order ... triggers are also using a `TriggerSleepAction`wait and also leak locations for every unit that enters.

The Player ... triggers that handle players leaving should disable themselves after the actions run since a player cannot un-quit. Ideally merge them into a single trigger and have that poll the player group of still active players.

You are using a lot of trigger enhanced abilities. I recommend disabling them and seeing if a freeze still happens. Could easily be a bug with one of them interacting with some other trigger.

Your map leaks a lot. Fixing these leaks can help as mentioned above. Generally if anything will run more than a few times it is worth fixing leaks.

Your map uses a lot of TriggerSleepAction (GUI Wait and Wait Game Time) which is not very accurate as far as game time goes and can cause race conditions if not careful. I recommend moving more towards timers for anything that runs frequently and requires a delay. It should be fine in once-off cinematic triggers.
Could you please fix these leaks for me then? I'm very bad at triggers, sry...
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
Could you please fix these leaks for me then? I'm very bad at triggers, sry...
 
Level 14
Joined
Jul 19, 2007
Messages
770
I would recommend learning about leaks and fixing them yourself. Since otherwise any triggers you make in future will continue to leak and you could end up with the same problem as currently.
I can't do it myself because I'm so afraid to do something wrong and fuck up the map even more... I don't know much about triggers and I'm trying to learn but it doesn't go that well, so please I would be happy if someone could help me fixing them!
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
I can't do it myself because I'm so afraid to do something wrong and fuck up the map even more... I don't know much about triggers and I'm trying to learn but it doesn't go that well, so please I would be happy if someone could help me fixing them!
Try. You are not going to break anything. Just fucking try and you'll learn something. If you're really paranoid make a copy of your map file and then there's literally nothing you can do to screw it up because you always have a restore point.
 
Level 14
Joined
Jul 19, 2007
Messages
770
Try. You are not going to break anything. Just fucking try and you'll learn something. If you're really paranoid make a copy of your map file and then there's literally nothing you can do to screw it up because you always have a restore point.
Well it's a little bit hard for me to try when I don't know what specificy that's wrong with the triggers :con:
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
Pyrogasm said:

Twice now I have linked you a thread that shows examples of "bad" and how to make it "good". It's very simple, and you don't even have to understand why in order to do it. Just copy the method. In addition, that thread links/refers to a different thread that is a structured tutorial on what exactly a leak is, why you need to fix them, and what's going on under the hood during the process. So in case you are curious or want to understand to do it right (cool) you can.

Please use the resources I am trying to direct you toward.
 
Level 14
Joined
Jul 19, 2007
Messages
770
Twice now I have linked you a thread that shows examples of "bad" and how to make it "good". It's very simple, and you don't even have to understand why in order to do it. Just copy the method. In addition, that thread links/refers to a different thread that is a structured tutorial on what exactly a leak is, why you need to fix them, and what's going on under the hood during the process. So in case you are curious or want to understand to do it right (cool) you can.

Please use the resources I am trying to direct you toward.
Believe me I'm trying to learn it but it seems to be too comlicated for me. I just don't see what's wrong with the triggers in my map. What exactly is wrong with these 2?
  • MonsterYay
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Castle <gen>) and do (If ((Life of (Picked unit)) Greater than 0.00) then do (Animation - Play (Picked unit)'s Stand Victory animation) else do (Do nothing))
      • Wait (Real(YAYWait)) seconds
      • Unit Group - Pick every unit in (Units in Castle <gen>) and do (If ((Life of (Picked unit)) Greater than 0.00) then do (Animation - Reset (Picked unit)'s animation) else do (Do nothing))
  • MonsterLvlEnd
    • Events
      • Player - Player 11 (Dark Green)'s Food used becomes Less than 1.00
    • Conditions
    • Actions
      • Trigger - Run MonsterYay <gen> (checking conditions)
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 11 (Dark Green)) and do (Unit - Explode (Picked unit).)
      • Set VariableSet BountyRound = (BountyRound + (BountyRound / 25.00))
      • Set VariableSet Lumber = (Lumber + (Lumber / 15.00))
      • Sound - Play Success <gen>
      • Game - Display to (All players) the text: ((You recieved + ((String(BountyRound)) + ( gold for completing + (Level + (Level + !))))) + )
      • Player Group - Pick every player in (All players) and do (Player - Add BountyRound to (Picked player).Current gold)
      • Wait 1.50 seconds
      • Trigger - Run MonsterLevelTrig (checking conditions)
      • Wait 2.00 seconds
 
Level 14
Joined
Jan 24, 2017
Messages
246
Dr Super Good told you exactly the issues:
The triggers MonsterYay and MonsterLvlEnd leak groups. These are the worst kind of leak. Also they use TriggerSleepAction which makes them hard to debug as that is not game time accurate, instead using network synchronised real time.

MonsterMoveSecond ... and Attack Move Order ... triggers are also using a `TriggerSleepAction`wait and also leak locations for every unit that enters.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,873
Timers are more accurate, Waits are slightly more inacurate, but it doesn't matter depending on the case. Waits also have a risk of desync (which is small), but again, replacing waits with timers in GUI is asking to go deliberately to a mental institute and to be a masochist.
The link clearly states how to fix several type of leaks. Asking someone to fix a map who knows how many triggers and their leaks is ridiculous, no one has the time to do that. None of us know this map intrinsically.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
Hmm ok but what's different with waits and timers, isn't the result the same just that timers are more complicated to do?
TriggerSleepAction (Wait and Wait game time) use network synchronisation to try to approximate real time. Timers and timed events work with game time.

This means that the amount of simulated time with wait actions will vary based on game speed while with timers it does not vary at all. It also means that network latency will influence how much simulated time passes with wait actions. Waiting for player dialogs or pausing the game do not pause wait.

Generally for anything gameplay related you want a timer since you want it to tie into simulated speed. Wait is useful if you are dealing with sound playback or anything that is client local and dependent on real time instead of game time.
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
589
Did you fix the freeze issue? I dont see the thread as solved. This freeze happens because of the known interval issue. It exists on the ability Ziadoma mentioned that is based on cluster rockets. You can fix it by changing the interval from 0 to something else. I also saw it mentioned that setting damage to 0 can cause the issue too but I dont know if thats true. You can always set targets to none so that it doesnt affect anything. The freeze only occurs if the spell is cast after between 8-20 minutes of gameplay which in my experience seems to be the case for all of those interval spell issues. For that reason it may be hard to realize whats causing the issue since the ability will work fine from the start and some time onward.
 
Level 14
Joined
Jul 19, 2007
Messages
770
Did you fix the freeze issue? I dont see the thread as solved. This freeze happens because of the known interval issue. It exists on the ability Ziadoma mentioned that is based on cluster rockets. You can fix it by changing the interval from 0 to something else. I also saw it mentioned that setting damage to 0 can cause the issue too but I dont know if thats true. You can always set targets to none so that it doesnt affect anything. The freeze only occurs if the spell is cast after between 8-20 minutes of gameplay which in my experience seems to be the case for all of those interval spell issues. For that reason it may be hard to realize whats causing the issue since the ability will work fine from the start and some time onward.
Yes it's solved. It was indeed caused by the spell "Shabon Spray".
 
Status
Not open for further replies.
Top