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

[Crash] My map has begun crashing and don't know why

Level 8
Joined
Jun 13, 2010
Messages
344
Hi,

So I made a bunch of new heroes in my map and first I thought they were the ones causing a major glitch and crashing, but I am beginning to think it's caused by major leaks in my data generation. Because these heroes have a lot of triggers firing every 0.25 seconds making multiple groups and stuff.

Would you mind taking a look at it to maybe detect something I am not able to find myself?

This trigger fires every 0.25 seconds, first finding the players one and unique Hero (no MUI needed), places a dummy unit (Beast) to do -armor aura in the area. Then I calculate damage depending on buffs and damage a group of units and a primary target. Does it leak?

  • Rifleman Beast Channel
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroup_Heroes and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Unit) Equal to Rifleman
            • Then - Actions
              • Set VariableSet Unit1 = Unit
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Rifleman_Beast is alive) Equal to True
          • (Unit1 is alive) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
      • Set VariableSet Integer = (Agility of Unit1 (Include bonuses))
      • Set VariableSet Real = ((Real(Integer)) x 0.20)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[(Player number of (Owner of Unit1))] has buff Rifleman (Upgrade)) Equal to True
        • Then - Actions
          • Set VariableSet Integer = (Level of Rifleman R for Unit1)
          • Set VariableSet Real1 = (0.20 x (Real(Integer)))
          • Set VariableSet Real1 = (Real1 + 1.00)
          • Set VariableSet Real = (Real x Real1)
        • Else - Actions
      • Set VariableSet PointDefault = (Position of Rifleman_Beast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of PointDefault.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit is alive) Equal to True
              • (Owner of Unit) Equal to Player 12 (Brown)
              • Unit Not equal to Rifleman_Beast
            • Then - Actions
              • Set VariableSet PointDefault1 = (Position of Unit)
              • Special Effect - Create a special effect at PointDefault1 using Abilities\Weapons\Rifle\RifleImpact.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation (udg_PointDefault1)
              • Unit - Cause Unit1 to damage Unit, dealing Real damage of attack type Normal and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation (udg_PointDefault)
      • Set VariableSet Integer = (Base Damage of Unit1 for weapon index 1)
      • Set VariableSet Real = (Real(Integer))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[(Player number of (Owner of Unit1))] has buff Rifleman (Upgrade)) Equal to True
        • Then - Actions
          • Set VariableSet Integer = (Level of Rifleman R for Unit1)
          • Set VariableSet Real1 = (0.20 x (Real(Integer)))
          • Set VariableSet Real1 = (Real1 + 1.00)
          • Set VariableSet Real = (Real x Real1)
        • Else - Actions
      • Unit - Cause Unit1 to damage Rifleman_Beast, dealing Real damage of attack type Normal and damage type Normal

This second trigger does pretty much the same but just damage everyone in a target area.

  • Rifleman Suppressive Fire Channel
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroup_Heroes and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Unit) Equal to Rifleman
            • Then - Actions
              • Set VariableSet Unit1 = Unit
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Rifleman_EDummyUnit is alive) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
      • Set VariableSet Integer1 = (Agility of Unit1 (Include bonuses))
      • Set VariableSet Real = ((Real(Integer1)) x 2.00)
      • Set VariableSet Integer = (Level of Rifleman E for Unit1)
      • Set VariableSet Integer = (Integer x 25)
      • Set VariableSet Real = (Real + (Real(Integer)))
      • Set VariableSet Real = (Real / 24.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[(Player number of (Owner of Unit1))] has buff Rifleman (Upgrade)) Equal to True
        • Then - Actions
          • Set VariableSet Integer = (Level of Rifleman R for Unit1)
          • Set VariableSet Real1 = (0.20 x (Real(Integer)))
          • Set VariableSet Real1 = (Real1 + 1.00)
          • Set VariableSet Real = (Real x Real1)
        • Else - Actions
      • Set VariableSet PointDefault = (Position of Rifleman_EDummyUnit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of PointDefault.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit is alive) Equal to True
              • (Owner of Unit) Equal to Player 12 (Brown)
              • (Unit has buff Rifleman (Suppressive Fire)) Equal to True
            • Then - Actions
              • Set VariableSet PointDefault1 = (Position of Unit)
              • Special Effect - Create a special effect at PointDefault1 using Abilities\Weapons\Rifle\RifleImpact.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation (udg_PointDefault1)
              • Unit - Cause Unit1 to damage Unit, dealing Real damage of attack type Normal and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation (udg_PointDefault)

I have another example of a healing spray ability that does a lot of stuff every 0.25 seconds.

  • Furbolg Healing Waves Periodic
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroup_Heroes and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Unit) Equal to Furbolg
            • Then - Actions
              • Set VariableSet Player = (Owner of Unit)
            • Else - Actions
      • Set VariableSet Integer = (Level of Furbolg E for Hero[(Player number of Player)])
      • Set VariableSet Integer1 = (Intelligence of Hero[(Player number of Player)] (Include bonuses))
      • Set VariableSet Real = ((Real(Integer1)) x 0.12)
      • Set VariableSet Real1 = (10.00 x (Real(Integer)))
      • Set VariableSet Real = (Real + Real1)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 250.00 of Point_FurbolgHealingWaves.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit is alive) Equal to True
              • (Owner of Unit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Set VariableSet PointDefault = (Position of Unit)
              • Special Effect - Create a special effect at PointDefault using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCasterOverhead.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation (udg_PointDefault)
              • Unit - Set life of Unit to ((Life of Unit) + Real)
            • Else - Actions

Do you find anything I am overseeing regarding to crashing or leaking?
 

Attachments

  • Siege of Lords.w3x
    519.6 KB · Views: 10
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557

It's near impossible to read those triggers as they are now.

If you're experiencing crashes (not desyncs) then my first bet would be an infinite damage loop. That's how I always wind up crashing the game. A unit takes damage -> Deal damage.
 
Level 8
Joined
Jun 13, 2010
Messages
344

It's near impossible to read those triggers as they are now.

If you're experiencing crashes (not desyncs) then my first bet would be an infinite damage loop. That's how I always wind up crashing the game. A unit takes damage -> Deal damage.
Thanks, sorry dunno why I picked that. The text is fixed now.

My game crashes if i do damage taken events so never used them.

The thing is it doesn't crash at the action of anything specific, but it does at about the same ingame time with maybe 3 minutes apart, it suddenly freezes and you have to alt+F4 to get out. So technically i guess its not a crash
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
Thanks, sorry dunno why I picked that. The text is fixed now.

My game crashes if i do damage taken events so never used them.

The thing is it doesn't crash at the action of anything specific, but it does at about the same ingame time with maybe 3 minutes apart, it suddenly freezes and you have to alt+F4 to get out. So technically i guess its not a crash
That is a crash. Something is happening an infinite number of times around that time. Do you know of any Elapsed Time or Timers events that happen around then? Find those triggers and show them here if there's not too many.

Edit: Well, it could be many other reasons as well, this is just my educated guess. Maybe a bad model?
 
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,478
When is it supposed to crash?
Played with the Rifleman up until the Lord of Death (second form got me).
Also from what i can tell, no leaks or infinite loops.

Suggestions: You might want to use a brighter tileset @ heroselection area, so they stand out more.
 
Level 25
Joined
Sep 26, 2009
Messages
2,380
I also took a look, but didn't really see anything problematic. Since you wrote the freeze happens around same time, I checked some of the boss fights (which I assume are timed), but again, nothing really glaring. The only thing that could be potentially problematic would be all those wait actions, since during the time the trigger is suspended another trigger could be executed which in conjunction with the suspended trigger could lead to some issues (but that is just a guess with the waits, no actual proof).
I would also advise you to start using loops :D For example when you are summoning boss minions it seemed like you just copy pasted the action a bunch of times, etc. - just creates more code to check.

Are you playing this with HD models? I remember when WC3 was crashing even for melee maps when using HD. I would not be surprised if the game crashed due to that rather than trigger issue.

Also, maybe try to pinpoint the issue yourself - for example if during the time crash occurs there is some event or boss fight going on, then disable that fight/event. If suddenly you don't crash, try to enable only a part of the triggers you have disabled (for example only some boss abilities, but not all). Try to find out the issue this way.
 
Level 20
Joined
Feb 27, 2019
Messages
592
It looks like the spell Furbolg R (ally), because how its set up, will cause a freeze. Having 0.00 as damage interval looks dangerous considering the interval bug that starts take effect after about ~8 minutes of game time.
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
^ good find!

In general, manipulating default abilities beyond what they were supposed to do can be problematic.
If you want to have a non-damaging acid bomb, better use a dummy unit to cast it (which you already do) and nullify its damage via damage engine/newer patches damage natives.
 
Level 8
Joined
Jun 13, 2010
Messages
344
It looks like the spell Furbolg R (ally), because how its set up, will cause a freeze. Having 0.00 as damage interval looks dangerous considering the interval bug that starts take effect after about ~8 minutes of game time.
Edit: Just tested the Furbolg and reduced R cooldown to 0 and just spammed it for 8 minutes of gameplay. Didn't crash until then finally at that average moment. Thing is the game crashed once without the Furbolg in it. And it doesn't crash if I use old heroes.
 
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
When is it supposed to crash?
Played with the Rifleman up until the Lord of Death (second form got me).
Also from what i can tell, no leaks or infinite loops.

Suggestions: You might want to use a brighter tileset @ heroselection area, so they stand out more.
About at level 6-9 it usually crashes. So probably 10 minutes in-game. Thing is if my oldest heroes are picked, there is no crash. If my newest heroes are picked: Sea Witch, Rifleman, Furbolg or Ranger, the game will crash at that time, not later. So its some issue with those heroes and most likely their triggers.
And thanks for the tip ill look into it.

I also took a look, but didn't really see anything problematic. Since you wrote the freeze happens around same time, I checked some of the boss fights (which I assume are timed), but again, nothing really glaring. The only thing that could be potentially problematic would be all those wait actions, since during the time the trigger is suspended another trigger could be executed which in conjunction with the suspended trigger could lead to some issues (but that is just a guess with the waits, no actual proof).
I would also advise you to start using loops :D For example when you are summoning boss minions it seemed like you just copy pasted the action a bunch of times, etc. - just creates more code to check.

Are you playing this with HD models? I remember when WC3 was crashing even for melee maps when using HD. I would not be surprised if the game crashed due to that rather than trigger issue.

Also, maybe try to pinpoint the issue yourself - for example if during the time crash occurs there is some event or boss fight going on, then disable that fight/event. If suddenly you don't crash, try to enable only a part of the triggers you have disabled (for example only some boss abilities, but not all). Try to find out the issue this way.
Yes my triggering is pretty primal 😅. But they actually work and do not bug (for the most part). But i will definitely follow your advice to make a smoother system.
But they are not the issue because game crashes before that. Its the hero. I explained in the text above in this message. 😊

Hope it makes sense
 
Level 8
Joined
Jun 13, 2010
Messages
344
Bump.

Sorry but I am literally stuck here and I would love some more help, because else I won't be able to fix this by myself. 😬
 
Level 8
Joined
Jun 13, 2010
Messages
344
Sounds like you narrowed it down, can't you test it even further? Test each "new" hero, see which one causes the issue. Disable the ones that aren't being tested.
I tried that. Crashed in Singleplayer with Furbolg alone. But it has crashed without the Furbolg in the game too. And I haven't experienced it crashing ever before the Furbolg was made (along with the other new heroes). And I haven't made changes to the map in that time.

Does it only crash in multiplayer btw?
I played around with the Furbolg and Ranger, no crashes whatsoever.
Both. I just played the Furbolg in singleplayer and it crashed. That's what makes it weird.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
I tried that. Crashed in Singleplayer with Furbolg alone. But it has crashed without the Furbolg in the game too. And I haven't experienced it crashing ever before the Furbolg was made (along with the other new heroes). And I haven't made changes to the map in that time.


Both. I just played the Furbolg in singleplayer and it crashed. That's what makes it weird.
Alright, I went through the four Heroes and modified their abilities / triggers in hopes that it'll stop crashing. Nothing really stood out to me though, so I can't say that I actually fixed anything. Here's a list of some random things I changed:

1) I changed your hero's Summon triggers to use the summon Event:
  • Unit - A unit Spawns a summoned unit
This is more efficient than "A unit Enters playable map area".

2) I changed your hero's Channel abilities to use different Base Order Id's making sure that the Id I chose matched the Targeting Type of the ability. IE: A Point targeted ability should use a Base Order Id like shockwave.

3) I changed any ability related timers (0.00 damage interval for example) in hopes to avoid the issue that others have pointed out.

4) I glossed over your hero ability triggers and tried to address any little issues I saw. Nothing really stood out to me though.

5) Most if not all of your Dummy units are setup incorrectly. I created a new Dummy unit named Dummy (Uncle - Fixed) that you should use whenever you need a standard Dummy unit. By standard I mean an invisible and temporary unit that casts an ability or abilities via triggers.

A standard Dummy unit should have the following settings:

Movement Type = None
Speed Base = 0
Art - Cast Point = 0.00
Art - Cast Backswing = 0.00
Death Type = Can't raise, Does not decay
Attacks Enabled = None (if you want your Dummy to attack then you should enable this!)

It's really just the Movement and Cast stuff that allows it to cast abilities instantly. If you need your Dummy unit to move around then you'll have to change the Movement settings. I created this new Dummy unit but I didn't actually change any triggers to use it.
 

Attachments

  • Siege of Lords Uncle1.w3x
    514.2 KB · Views: 2
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
3) I changed any ability related timers (0.00 damage interval for example) in hopes to avoid the issue that others have pointed out.
I saw it was mentioned with the 0.00 damage interval. I can't seem to find what you are referring to. Can you come with some examples? Is it triggers or actual abilities and which?

Thanks I have adjusted the dummy value.

But yes, it's super frustrating since nothing was wrong a week ago and then I made the 3 heroes and now it crashes randomly. I guess I gotta be patient and do a controlled environment for testing. Poor people I gotta test it with. :D
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
I saw it was mentioned with the 0.00 damage interval. I can't seem to find what you are referring to. Can you come with some examples? Is it triggers or actual abilities and which?

Thanks I have adjusted the dummy value.

But yes, it's super frustrating since nothing was wrong a week ago and then I made the 3 heroes and now it crashes randomly. I guess I gotta be patient and do a controlled environment for testing. Poor people I gotta test it with. :D
I think it was an ability based on Acid Bomb, you had the Damage Interval set to 0.00. Got to be careful because you never know how Blizzard coded these spells. Setting this value to 0 could very well start a 0 second Repeating timer which seems like a bad idea.

Anyway, you can test the map on LAN. Hit the Play button on the BNET app to launch the game, then minimize and hit Play again. Then maximize the first client you launched and click "play offline" since it'll have been kicked off by the second client. From there you can host and join a LAN game with yourself. It helps to have two monitors.
 
Last edited:
Level 35
Joined
Feb 5, 2009
Messages
4,560
If you haven't done so already, it might be worth using some debug messages within your code to get the game to tell you what it's doing at separate intervals. This could help you determine if your code is behaving the way you intended it to. For example, I am seeing a couple of conditions in the Rifleman code that turns the trigger off and skips the remaining actions, which to my awareness would not allow the trigger to function again unless you have a trigger elsewhere that turns it back on.

But then if that is the case, that would imply the existence of other triggers within your map, any of which could be responsible for the difficulties you are experiencing. Without seeing a comprehensive list, we may not be able to see what is actually happening in its entirety to fix the issue. From what I can gather, you appear to have appropriately handled any potential memory leaks within the triggers you have posted. Or it could be like Uncle is suggesting and might be something in your ability data which conflicts with some hard coded facets within the game.
 
Top