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

[Crash] War3.exe crashes every 20-30 minutes

Status
Not open for further replies.
Level 4
Joined
Dec 31, 2014
Messages
68
Hello all,
This is my first time using this forum & also the first time I have tried to make a multiplayer RPG map for Warcraft3. I'm using Warcraft 3 World Editor, not WEU or some other program. Also apologies for the length of this post, I wanted to try and be thorough in the explanation of the problem. I am relatively new to all of this.

What is happening is that whenever I go to test my map it works perfectly fine for about 20-30 minutes and then it crashes. I have tried to play it directly from the world editors with the 'test map' button, but also I have tried manually saving the map into warcraft's directory and opening Warcraft.
This is the usual error I get:

'This application has encountered a critical error:
Not enough storage is available to process this command.
War3.exe
File .\CDataAllocator.cpp
Line 152'

But I also occasionally get;
'This application has encountered a critical error:
Not enough storage is available to process this command.
War3.exe
Object: Handle2AgentReg (.?UHandle2AgentReg@@)

I have looked at a few other forums where people have reported the same sort of thing and the general response I have seen is memory leaks within the map. I have spent time looking up fixes for memory leaks and applying them to my triggers. I have gone through them all with Leakcheck and have made adjustments to them all based upon its 'suggested fixes'.

Look below for a few examples of the major triggers I have created.

My Map size is 8,154kb(7.96mb) and I am using Warcraft 3 version 1.26.0.6401 When the game has loaded the level; in the task manager, the Memory (Private Working Set) reads approx 426,280k. This number continues to rise, about 1,000k per 3 seconds. When I have seen it crash it reaches around 1,000,000k, is there a memory limit for war3.exe or something? (Also can I ask if this is the correct way to know if a map is leaking or not?)
 
Level 4
Joined
Dec 31, 2014
Messages
68
EXAMPLE TRIGGERS
Apologies for the length of this post, this is how I have done most of my triggers and if there' s a simpler/more optimised way of doing this please let me know.
Where I have typed 'EVERYPLAYER' it means I have duplicated the action and set it for each individual player. (player 1,2 & 3)


1.Spawn A New Enemy (I have approx 8 of these triggers)
  • Events
    • Unit - A Unit Enters (REGION) <gen>
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • Sound - Play Invaded <gen>
    • Set miscpoint = (Center of REGION <gen>)
    • Unit - Create 1 X for Player 11 (Dark Green) at miscpoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_miscpoint)
    • Game - Display to (All players) for 10.00 seconds the text: 'X'
    • Camera - Shake the camera for EVERYPLAYER with magnitude 8.00
    • Wait 1.00 seconds
    • Camera - Stop swaying/shaking the camera for EVERYPLAYER
    • Trigger - Turn off (This trigger)
    • Custom script: call DestroyTrigger(GetTriggeringTrigger())
2.Making destructibles Invulnerable, Opened or closed
  • Events
    • Time - Elapsed gametime is 0.01 seconds
  • Conditions
  • Actions
    • Destructible - Make X <gen> Invulnerable
    • Trigger - Turn off (This trigger)
    • Custom Script: Call DestroyTrigger(Get Triggering Trigger())
3.Npc's that send a transmission to all players (I have approx 10 of these triggers)
  • Events
    • Unit - A Unit Enters (REGION) <gen>
  • Conditions
    • (Triggering unit) is A Hero) Equal to True
  • Actions
    • Sound - Play X <gen>
    • Cinematic - Send transmission to (All players) from 'X' named 'X' Play No sound and display 'X' Modify duration: Add 25.00 seconds and Wait
    • Trigger - Turn off (This trigger)
    • Wait 30.00 seconds
    • Trigger - Turn on (This trigger)

4.When a unit types a specific word, it makes a sound (I have approx 5 of these triggers)
  • Events
    • Player - EVERYPLAYER types a chat message containing X as A substring
  • Actions
    • Sound - Play x <gen>
5.'Area Titles' using Floating Text
  • Events
    • Time - Elapsed gametime is 0.01 seconds / Map Initialization
  • Actions
    • Set (FLOATINGTEXTVARIABLE) = (REGION)
    • Floating Text - Create floating text that reads 'X' at FLOATINGTEXTVARIABLE with Z offset 0.00,using fontsize 10.00, colour (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Custom script: call RemoveLocation(udg_FLOATINGTEXTVARIABLE)
    • Trigger - Turn off (This Trigger)
    • Custom script: call DestroyTrigger(Get Triggering Trigger())
6.Portals (I have well over 100 of these triggers)
  • Events
    • Unit - A unit enters (REGION)
  • Actions
    • Set POINTVARIABLE = (DESTINATION REGION)
    • Unit - Move (Triggering unit) instantle to POINTVARIABLE
    • Custom script: call RemoveLocation(udg_POINTVARIABLE)
7.Areas of the floor that the player walks over that displays messages to them (I have approx 20 of these triggers)
  • Events
    • Unit - A unit enters REGION <gen>
  • Actions
    • If (All conditions are True) then do (Then Actions) else do (Else actions)
      • If ((Entering unit) is A Hero) Equal to True
      • If (Owner of (Entering unit)) Equal to EVERYPLAYER
    • Then - Actions
      • Game - Display to Player Group - EVERYPLAYER for x seconds the text: 'x'
    • Else - Actions

8.Regions that inflict damage every x seconds of gametime to all players except Player12 Brown (I have well over 100 of these triggers)

  • Events
    • Time - Every 0.10 seconds of gametime
  • Actions
    • Set (GROUPVARIABLE) = (units in REGION <gen>)
    • Unit Group - Pick every unit in GROUPVARIABLE and do (actions)
      • Loop - Actions
      • If ((Owner of (Picked unit)) Not Equal to Player 12 (Brown) then to (Unit - Cause (Picked unit), dealing 50.00 damage of attack type pierce and damage type Normal) else do (do nothing)
      • Custom Script: call DestroyGroup (udg_GROUPVARIABLE)
9.Specific Unit Type dies (I have approx 50 of these triggers)
  • Events
    • Unit - A Unit Dies
  • Conditions
    • (Unit-type of (Dying unit)) Equal to X
  • Actions
    • Player - Add X to EVERYPLAYER Current gold
    • Game - Display to (All Players) the text 'X'
    • Sound - Play X <gen>
10.When a Unit finds an item, it rewards all players Gold (I have approx 10 of these triggers)
  • Events
    • Unit - A Unit owned by EVERYPLAYER Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to X
  • Actions
    • Player - Add X to EVERYPLAYER Current gold
    • Game - Display to (All players the text) :'X'
11.When a unit enters a region it rewards all players Lumber (I have approx 10 of these triggers)
  • Events
    • Unit - A Unit Enters REGION <gen>
  • Conditions
    • ((Triggering unit is A Hero) Equal to True) and ((Owner of (Triggering unit)) Not equal to Player 12 (Brown)
  • Actions
    • Sound - Play X
    • Player - Add X to EVERYPLAYER Current lumber
    • Game - Display to (All players) for X seconds the text 'X'
    • Trigger - Turn off (This trigger)
    • Custom script: call DestroyTrigger(GetTriggeringTrigger())
12.'Check point regions' When enters a region it allows the unit to respawn at that region if they die (I have approx 20 of these triggers)
  • Events
    • Unit - A unit enters REGION <gen>
  • Conditions
    • (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to EVERYPLAYER
  • Actions
    • Trigger - Turn on TRIGGER TO RESPAWN <gen>
    • Trigger - Turn off (This and all other triggers for this)
13.TRIGGER TO RESPAWN (I have approx 20 of these triggers)
  • Events
    • Unit - A unit owned by EVERYPLAYER Dies
  • Conditions
    • (((Triggering unit) is A Hero) Equal to True)
  • Actions
    • Wait X Seconds
    • Hero - Instantly revive (Dying unit) at REGION
    • Game - Display to Player Group - EVERYPLAYER the text : 'X'
14.When a Hero gains a level remove a set number of gold (I have over 100 of these triggers as they have been duplicated for each player also)
  • Events
    • Unit - A Unit owned by EVERYPLAYER Gains a level
  • Conditions
    • (Level of (Triggering unit)) Equal to X
  • Actions
    • Player - Add -x to EVERYPLAYER Current gold
    • Hero - Set (Leveling Hero) experience to 0
    • Custom script: Call DestroyTrigger( Get Triggering Trigger())
15.When a Hero Levels up they get given a Permanent health bonus
  • Events
    • Unit - A unit Gains a level
  • Conditions
  • Actions
    • Set VARIABLE = (Center of REGION <gen>)
    • Item - Create X at VARIABLE
    • Hero - Give (Last created item) to (Triggering unit)
    • Custom script: call RemoveLocation(udg_VARIABLE)

16.Dialog box at beginning of the game to choose character
  • Events
    • Time - Elapsed gametime is x seconds
  • Actions
    • Dialog - Clear CHARACTERCHOICE
    • Dialog - Change the title of CHARACTERCHOICE to 'X'
    • Dialog - Create a dialog button for CHARACTER CHOICE labelled 'X'
    • Set ARRAYVARIABLE[X] = (Last created dialog Button)
    • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
    • Dialog - Show CHARACTERCHOICE for EVERYPLAYER
17.Dialog button has been clicked
  • DoDialogue
    • Events
      • Dialog - A dialog button is clicked for CHOOSEYOURCHARACTER
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DIALOGBUTTONS[(Integer A)]
            • Then - Actions
              • Sound - Stop X <gen> After fading
              • Sound - Destroy X <gen>
              • Camera - Pan camera for (Triggering player) to ((Triggering player) start location) over 0.10 seconds
              • Unit - Create 1 Heroes[(Integer A)] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
              • Selection - Select (Last created unit) for (Triggering player)
              • Game - Display to (Player group((Triggering player))) the text: (Name of (Last created unit))
              • Player - Change color of (Triggering player) to (Color of Player 9 (Gray)), Changing color of existing units
              • Sound - Play revived <gen>
              • Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
              • Camera - Set (Triggering player)'s camera Distance to target to 1500.00 over 0.00 seconds
            • Else - Actions
Thank you
 
Last edited:
Level 4
Joined
Dec 31, 2014
Messages
68
Thanks for your replies, Yeah iv been looking over that website when I was trying to fix what I already had and I thought I had it all done. as I mentioned most of the triggers don't display any errors when I'v used the leakchecker tool :/

Ah [ Trigger ] Tags, sorry I didn't know how to do them when I posted - I've edited the post now.

Which triggers seemed the leakiest to you?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
My Map size is 8,154kb(7.96mb) and I am using Warcraft 3 version 1.26.0.6401 When the game has loaded the level; in the task manager, the Memory (Private Working Set) reads approx 426,280k. This number continues to rise, about 1,000k per 3 seconds. When I have seen it crash it reaches around 1,000,000k, is there a memory limit for war3.exe or something? (Also can I ask if this is the correct way to know if a map is leaking or not?)
Obviously there is a memory limit for WC3. This is the virtual memory address limit of x86 built programs which should be around 2-3 GB (as they sure did not build it to use the full 4GB).

If the map was made by you then you must have neglected some pretty serious trigger leaks.
 
Level 5
Joined
May 12, 2014
Messages
133
EXAMPLE TRIGGERS

8.Regions that inflict damage every x seconds of gametime to all players except Player12 Brown (I have well over 100 of these triggers)

  • Events
    • Time - Every 0.10 seconds of gametime
  • Actions
    • Set (GROUPVARIABLE) = (units in REGION <gen>)
    • Unit Group - Pick every unit in GROUPVARIABLE and do (actions)
      • Loop - Actions
      • If ((Owner of (Picked unit)) Not Equal to Player 12 (Brown) then to (Unit - Cause (Picked unit), dealing 50.00 damage of attack type pierce and damage type Normal) else do (do nothing)
      • Custom Script: call DestroyGroup (udg_GROUPVARIABLE)

This is just my two cents here, but I don't think you should have so many of these kinds of triggers. You could actually try merging some of these triggers since some of them probably do have similar timers right? For example combine all of these triggers that run every 0.1 seconds into one trigger. You could do something like this.

  • Temp Trigger
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • -------- Instance 1 --------
      • Set Temp_UGroup = (Units in Region 1 <gen>)
      • Unit Group - Pick every unit in Temp_UGroup and do (Actions)
        • Loop - Actions
          • Set Temp_PickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of Temp_PickedUnit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Unit - Cause Temp_PickedUnit to damage Temp_PickedUnit, dealing 50.00 damage of attack type Pierce and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Temp_UGroup)
      • -------- --------------------- --------
      • -------- Instance 2 --------
      • Set Temp_UGroup = (Units in Region 2 <gen>)
      • Unit Group - Pick every unit in Temp_UGroup and do (Actions)
        • Loop - Actions
          • Set Temp_PickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of Temp_PickedUnit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Unit - Cause Temp_PickedUnit to damage Temp_PickedUnit, dealing 150.00 damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Temp_UGroup)
      • -------- --------------------- --------
      • -------- Instance 3 --------
      • Set Temp_UGroup = (Units in Region 3 <gen>)
      • Unit Group - Pick every unit in Temp_UGroup and do (Actions)
        • Loop - Actions
          • Set Temp_PickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of Temp_PickedUnit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Unit - Cause Temp_PickedUnit to damage Temp_PickedUnit, dealing 100.00 damage of attack type Chaos and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Temp_UGroup)
      • -------- --------------------- --------
This reduces the amount of triggers that you have, and it sort of simplifies things. Like if you want to add or remove conditions on when to damage a unit, you can easily add/remove another condition in the ITE statement. Also, using ITE this way is also cleaner and easier to read. :goblin_good_job:

Also, having less triggers that runs so often puts less stress on potatoes all across the world. :ogre_haosis:
 
Level 4
Joined
Dec 31, 2014
Messages
68
Thanks Yugata! I loaded the game after grouping all of them (150.. oops..) I didn't play and wait 30 minutes (I'll try that tomorrow) but I opened the task manager and watched how quickly the bytes were increasing. It was still happening but at a much slower rate than it was before I grouped them damaging triggers.

Perhaps I can do the same sort of thing with other individual triggers.
 
Level 5
Joined
May 12, 2014
Messages
133
Thanks Yugata! I loaded the game after grouping all of them (150.. oops..) I didn't play and wait 30 minutes (I'll try that tomorrow) but I opened the task manager and watched how quickly the bytes were increasing. It was still happening but at a much slower rate than it was before I grouped them damaging triggers.

Perhaps I can do the same sort of thing with other individual triggers.


Have you been cleaning out the leaks also? Because just merging alone won't be enough. Within each instance of damage, you also need to capture the unit groups in a variable and delete them after the damage action. To clean the group, you can use the custom action and type "call DestroyGroup (udg_VARIABLENAME)" without the " ". If you've already been doing this, then just ignore what I just said since it's pointless mumbling.

EXAMPLE TRIGGERS
13.TRIGGER TO RESPAWN (I have approx 20 of these triggers)
  • Events
    • Unit - A unit owned by EVERYPLAYER Dies
  • Conditions
    • (((Triggering unit) is A Hero) Equal to True)
  • Actions
    • Wait X Seconds
    • Hero - Instantly revive (Dying unit) at REGION
    • Game - Display to Player Group - EVERYPLAYER the text : 'X'
Also, be sure to capture location leaks as well. Like in the example trigger 13, you didn't capture the leak, and that can also be a serious one as well, depending on how often heroes die. To do this, set the center of the region to a point variable, and then type in the custom action "call RemoveLocation (udg_POINTVARIABLE)". Again, that's without the " ". I know it's just an example trigger, but you can never be too sure.:goblin_good_job:

Wait a second..... Are you saying that you took 150 triggers, and merged them into a single one? I would not even attempt to do something that massive! You get brownie points for accomplishing something so massively dull and repetitive!
 
Level 4
Joined
Dec 31, 2014
Messages
68
Thanks for your replies. Yeah I have been catching the leaks for that damaging area (as far as I'm aware)
This is what i'v done
  • Events
    • Time - Every 0.30 seconds of game time
  • Actions
  • -------- Number1 --------
  • Set POISONAREA = (Units in damagingarea1 <gen>)
  • Unit Group - Pick every unit in POISONAREA and do (Actions)
    • Loop - Actions
      • Set Temp_Pickedunit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of Temp_Pickedunit) Not equal to Player 12 (Brown)
        • Then - Actions
          • Unit - Cause (Picked unit) to damage Temp_Pickedunit, dealing 50.00 damage of attack type Pierce and damage type Normal
        • Else - Actions
  • Custom script: call DestroyGroup (udg_POISONAREA)
  • -------- Number2 --------
  • Set POISONAREA = (Units in Damagingarea2 <gen>)
  • Unit Group - Pick every unit in POISONAREA and do (Actions)
    • Loop - Actions
      • Set Temp_Pickedunit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of Temp_Pickedunit) Not equal to Player 12 (Brown)
        • Then - Actions
          • Unit - Cause (Picked unit) to damage Temp_Pickedunit, dealing 50.00 damage of attack type Pierce and damage type Normal
        • Else - Actions
  • Custom script: call DestroyGroup (udg_POISONAREA)
Is this correct?

Also, yeah I completely missed making variable points for dying hero's.
I'v now updated it.


Since we're on the subject of player revival, I thought id try and show how i'v done it. (I hope this makes sense, also again sorry for the post lenght)

So, I have 3 categories each with about 30 triggers inside them (Each Category is for each player (1,2 & 3).
As my map is an open world RPG I wanted it so that when a Specific Player hero enters a region, it turns on 1 respawning trigger but then turns off all of the others for that player.
But say they walk to the checkpoint2 activation region (which turns off all checkpoint triggers except checkpoint2), they can then walk back to the checkpoint1 region to turn it back on again.
The idea is that it is up to each individual player to visit the checkpoint regions in effect choosing where they respawn if they die in a certain area.
i.e

  • Player1 Checkpoint1
    • Events
      • Unit - A unit enters SpawnatCheckpoint1 <gen>
    • Conditions
      • (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 1 (Red))
    • Actions
      • Game - Display to Player Group - Player 1 (Red) the text: Checkpoint 1 Dis...
      • Sound - Play Checkpoint <gen>
      • Trigger - Turn on p1 Respawn at Checkpoint1 <gen>
      • -------- Turnoff --------
      • Trigger - Turn off p1 Respawn at Checkpoint2 <gen>
      • Trigger - Turn off p1 Respawn at Checkpoint3 <gen>
      • Trigger - Turn off p1 Respawn at Checkpoint4 <gen>
      • Trigger - Turn off p1 Respawn at Checkpoint5 <gen>
Etc

So it has turned on p1 Respawn at Checkpoint1 which is ;
  • p1 Respawn at Checkpoint1
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Wait 10.00 seconds
      • Set Point = (Center of Checkpoint1 <gen>)
      • Hero - Instantly revive (Dying unit) at Point, Hide revival graphics
      • Custom script: call RemoveLocation(udg_Point)
      • Game - Display to Player Group - Player 1 (Red) the text: You have been respaw...
Does this look alright to you? As I have mentioned I have these triggers duplicated for Player 2 and Player 3 so there are quite a few again.

Also Yeah.. 150 of them.. I'm kinda desperate to get this map done and playable! (Yes it was painfully repetitive)



Hi Daffa, Ah right ok. Could you provide an example of where I could maybe do this? I'm quite triggered-out to be honest! I did an array for the 'choose your character' section based upon a tutorial but I can't say I really understand it other than that.
 
Status
Not open for further replies.
Top