Weird Map Crash - Can a guru mapper tell me why?

Jarko89

New Member
Reaction score
1
Hi guys, the more i use this forum the more i see it is just incredibile for n00b mappers like me :)

btw, here my problem. every time i play my map online, during the game, the map crashes. i know it happens to all players coz there were some friends of mine playing with me.

the real problem is i dunno why it happens!

could it be a spell? i dont think so, there are no spells made with triggers (but a hook pudge-style, there is the trigger but no hero has this spell yet, so its not her fault)

could it be a trigger? all my triggers are so simple...

moreover it seem to happen randomly: after 10 minutes, after 4 minutes, while fighting, while creeping, with different heroes... but it ALWAYS HAPPENS i cant play the map for more than 15 minutes.

the error is a FATAL ERROR involving an ACCESS_VIOLATION, memory cannot be read (or written)

here there is the map. i hope some guru can find the reason, i'll give him +rep till im old.

PS: can u also tell me the most common reasons for crash?
 

Attachments

  • Opposite Forces Editing.w3x
    463 KB · Views: 133

Cloak_Master

Active Member
Reaction score
41
1. Remove all memory leaks.

2. Infinite loops will also cause this type of crash.

Also I think dividing by zero may cause this.
 

Romek

Super Moderator
Reaction score
964
1. Remove all memory leaks.

2. Infinite loops will also cause this type of crash.

Also I think dividing by zero may cause this.
Leaks cause lag, not crashes.

Infinite loops can cause it though.

I'll look through the map if noone else does in 3 minutes :p

Edit:
This and the other similar triggers have an infinite loop:
Code:
Legendary Armor
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Triggering unit) has an item of type Emah's Robe) Equal to True
        ((Triggering unit) has an item of type Lhong's Belt) Equal to True
        ((Triggering unit) has an item of type Tyeo's Boots) Equal to True
        ((Triggering unit) has an item of type Legendary Armor Scroll) Equal to True
    Actions
        Item - Remove (Item carried by (Triggering unit) of type Emah's Robe)
        Item - Remove (Item carried by (Triggering unit) of type Lhong's Belt)
        Item - Remove (Item carried by (Triggering unit) of type Tyeo's Boots)
        Item - Remove (Item carried by (Triggering unit) of type Legendary Armor Scroll)
        Hero - Create Legendary Armor and give it to (Triggering unit)
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
        Sound - Play LightningBolt1 <gen> at 100.00% volume, attached to (Triggering unit)

The unit gets an item, firing the trigger, which gives it an item again.. Although there are conditions, it could fire the other triggers with the same event.

It seems infinite loops are common in your map :p
 

Cloak_Master

Active Member
Reaction score
41
Leaks cause lag, not crashes.

Infinite loops can cause it though.

I'll look through the map if noone else does in 3 minutes :p

Incorrect. If a map over-extends it's allocated use of resources because of leaks, it tries to access more memory, hence "access violation" and crashes.

At first glance, I think the Createhooks trigger might be causing this. Too many random calculations (as in, get randoms) at once and you'll get a fatal error.
 

Jarko89

New Member
Reaction score
1
Leaks cause lag, not crashes.

Infinite loops can cause it though.

I'll look through the map if noone else does in 3 minutes :p

Edit:
This and the other similar triggers have an infinite loop:
Code:
Legendary Armor
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Triggering unit) has an item of type Emah's Robe) Equal to True
        ((Triggering unit) has an item of type Lhong's Belt) Equal to True
        ((Triggering unit) has an item of type Tyeo's Boots) Equal to True
        ((Triggering unit) has an item of type Legendary Armor Scroll) Equal to True
    Actions
        Item - Remove (Item carried by (Triggering unit) of type Emah's Robe)
        Item - Remove (Item carried by (Triggering unit) of type Lhong's Belt)
        Item - Remove (Item carried by (Triggering unit) of type Tyeo's Boots)
        Item - Remove (Item carried by (Triggering unit) of type Legendary Armor Scroll)
        Hero - Create Legendary Armor and give it to (Triggering unit)
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
        Sound - Play LightningBolt1 <gen> at 100.00% volume, attached to (Triggering unit)

The unit gets an item, firing the trigger, which gives it an item again.. Although there are conditions, it could fire the other triggers with the same event.

It seems infinite loops are common in your map :p

mhh i dont think this can cause crash, it never did... i tested it... btw it might be, but i dont understand why :) if an hero picks an item and has those items listed in conditions, than he will get a new item (and lose those items). this is the trigger i made to create melting items, i did never read guides, im self-taught... and what does i mean "fire a trigger"? run it? and then, why could it run other triggers which are not that trigger? sry for noobness :(

At first glance, I think the Createhooks trigger might be causing this. Too many random calculations (as in, get randoms) at once and you'll get a fatal error.

impossible, i said no heroes have this spell, nobody can use it... its not active :)

PS: what is memory leak and how it happens?
 

Romek

Super Moderator
Reaction score
964
Incorrect. If a map over-extends it's allocated use of resources because of leaks, it tries to access more memory, hence "access violation" and crashes.

At first glance, I think the Createhooks trigger might be causing this. Too many random calculations (as in, get randoms) at once and you'll get a fatal error.

You'd need an incredible amount of leaks before that would happen.
You'd probably get 0.01 FPS (And would leave the map) before that happened :p
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Leaks cause lag, not crashes.

Infinite loops can cause it though.

I'll look through the map if noone else does in 3 minutes :p

Edit:
This and the other similar triggers have an infinite loop:
Code:
Legendary Armor
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Triggering unit) has an item of type Emah's Robe) Equal to True
        ((Triggering unit) has an item of type Lhong's Belt) Equal to True
        ((Triggering unit) has an item of type Tyeo's Boots) Equal to True
        ((Triggering unit) has an item of type Legendary Armor Scroll) Equal to True
    Actions
        Item - Remove (Item carried by (Triggering unit) of type Emah's Robe)
        Item - Remove (Item carried by (Triggering unit) of type Lhong's Belt)
        Item - Remove (Item carried by (Triggering unit) of type Tyeo's Boots)
        Item - Remove (Item carried by (Triggering unit) of type Legendary Armor Scroll)
        Hero - Create Legendary Armor and give it to (Triggering unit)
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
        Sound - Play LightningBolt1 <gen> at 100.00% volume, attached to (Triggering unit)

The unit gets an item, firing the trigger, which gives it an item again.. Although there are conditions, it could fire the other triggers with the same event.

It seems infinite loops are common in your map :p

That is not an infite loop, to be an inf loop it will have to be self reapeating which that is not.
 

Cloak_Master

Active Member
Reaction score
41
You'd need an incredible amount of leaks before that would happen.
You'd probably get 0.01 FPS (And would leave the map) before that happened :p

Not true. I've made this mistake in my younger days, the FPS was fine until it would shut down. Fixing the leaks fixed the problems.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
I think this might be causeing it

Code:
Generic Spawn
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        (Unit-type of (Dying unit)) Not equal to Gondar
    Actions
        Wait 90.00 game-time seconds
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing Default building facing degrees

Here is another problim one

Code:
Hero Revival No Timer
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Game - Display to (Player group((Owner of (Dying unit)))) the text: (Seconds to wait for hero revival:  + (String(((Level of (Dying unit)) + 5))))
        Wait (5.00 + (Real((Level of (Dying unit))))) seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Dying unit)) is an ally of Player 11 (Dark Green)) Equal to True
            Then - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolTroiani <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolTroiani <gen>) over 0.00 seconds
            Else - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolAchaei <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolAchaei <gen>) over 0.00 seconds

After waits the game loses things like dieing unit and attacking unit and such, you might want to change every thing after the waits to triggering unit.

Ps your map has a lot of leaks, go here

http://www.thehelper.net/forums/showthread.php?t=27219&highlight=Leak+tutorial
 

Jarko89

New Member
Reaction score
1
I think this might be causeing it

Code:
Generic Spawn
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        (Unit-type of (Dying unit)) Not equal to Gondar
    Actions
        Wait 90.00 game-time seconds
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing Default building facing degrees

Here is another problim one

Code:
Hero Revival No Timer
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Game - Display to (Player group((Owner of (Dying unit)))) the text: (Seconds to wait for hero revival:  + (String(((Level of (Dying unit)) + 5))))
        Wait (5.00 + (Real((Level of (Dying unit))))) seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Dying unit)) is an ally of Player 11 (Dark Green)) Equal to True
            Then - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolTroiani <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolTroiani <gen>) over 0.00 seconds
            Else - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolAchaei <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolAchaei <gen>) over 0.00 seconds

After waits the game loses things like dieing unit and attacking unit and such, you might want to change every thing after the waits to triggering unit.

Ps your map has a lot of leaks, go here

http://www.thehelper.net/forums/showthread.php?t=27219&highlight=Leak+tutorial

oh nice, i didnt know that! i'll fix all asap... i understood what leaks are now and how to fix them, but not where are most important leaks in my map... do the two triggers u quoted cause a leak?

and moreover, if i use custom script to remove a leak, like this:

Code:
Unit Group Good
    Events
    Conditions
    Actions
        Set Temp_Group = (Units in (Playable map area))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        Custom script:   call DestroyGroup (udg_Temp_Group)

i understood it destroys that variable. so this trigger wont work anymore... how to make the trigger work more than once without causing a leak?
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
the two triggers I posted will also cause the most leaks, but they are point leaks not group leaks.

Code:
Generic Spawn
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        (Unit-type of (Dying unit)) Not equal to Gondar
    Actions
        Wait 90.00 game-time seconds
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Point Leak) (Position of (Dying unit)) (/Point Leak) facing Default building facing degrees

Edit you can always reset the varible useing set varible, so when you destroy it all it is doing is eraseing the data stored in it. So you can use the same varible over and over again.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I think this might be causeing it

Code:
Generic Spawn
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        (Unit-type of (Dying unit)) Not equal to Gondar
    Actions
        Wait 90.00 game-time seconds
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing Default building facing degrees

Here is another problim one

Code:
Hero Revival No Timer
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Game - Display to (Player group((Owner of (Dying unit)))) the text: (Seconds to wait for hero revival:  + (String(((Level of (Dying unit)) + 5))))
        Wait (5.00 + (Real((Level of (Dying unit))))) seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Dying unit)) is an ally of Player 11 (Dark Green)) Equal to True
            Then - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolTroiani <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolTroiani <gen>) over 0.00 seconds
            Else - Actions
                Hero - Instantly revive (Dying unit) at (Random point in PoolAchaei <gen>), Show revival graphics
                Camera - Pan camera for (Owner of (Dying unit)) to (Center of PoolAchaei <gen>) over 0.00 seconds

After waits the game loses things like dieing unit and attacking unit and such, you might want to change every thing after the waits to triggering unit.

At least Dying unit and Triggering unit are MUI. At least Casting Unit, Target Unit of Ability Being Cast, and cast even units are not. I haven't tested the other ones. However, these both only use the Dying unit, so they work fine.

Leaks lag your map, not crash it. The only way it can crash without lag is in single player (and when you're the host of an online game, however other players will probably lag). When the game is being run off of your computer, leaks are much less noticeable.

Common things to crash your map: Infinite loops without waits, improper useage of GetLocalPlayer(), and Pan Camera as Necessary.

These are the -common- ones, FYI. There are PLENTY of other ways to crash a map, but most of them are in JASS, and because of some mistake on your part.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
....

Dieing unit is lost after waits. So the triggers wont work fine.

ps pan camara causes server splits, not crashes.

Also if you host you lag to even if it is not you causeing the lag.

If you build up enought leaks it will crash your map. This was already talked about in this thread.
 

Jarko89

New Member
Reaction score
1
Ok men tnk u all again, particularly dameon!!

I've got the last question for you. How can I remove leaks for point? I think I should create a real variable with array 2 and set them as X and Y coordinates of dying unit, then wait 90 seconds, make the unit revived at those coordinates and destroy the variable... But the question is: how can I make a custom script to delete the specific array of a variable? And moreover, will the system I wrote work or do I have to create 2 real variables? And how to make em work with every unit (because many creeps die togheter in my map, for example the trigger to revive creeps might be run many times in a few seconds)

Thank u again!
 

Dregonx

TH.net Regular
Reaction score
21
Ok men tnk u all again, particularly dameon!!

I've got the last question for you. How can I remove leaks for point? I think I should create a real variable with array 2 and set them as X and Y coordinates of dying unit, then wait 90 seconds, make the unit revived at those coordinates and destroy the variable... But the question is: how can I make a custom script to delete the specific array of a variable? And moreover, will the system I wrote work or do I have to create 2 real variables? And how to make em work with every unit (because many creeps die togheter in my map, for example the trigger to revive creeps might be run many times in a few seconds)

Thank u again!

call RemoveLocation(udg_variable[number])

Example: call RemoveLocation(udg_DeathPoint[5])
 

Dregonx

TH.net Regular
Reaction score
21
Oh tnx a lot man... Btw u gave me an example of how to destroy a variable with array1, what about a variable with array2?

Not really sure what you mean.

Code:
call RemoveLocation(udg_DeathPoint[5])

Change the number to whatever number it is your getting rid of so if you're removing say two variables at once then it'd be like this:

Code:
call RemoveLocation(udg_YourVariable[1])
call RemoveLocation(udg_YourVariable[2])

or like this:

Code:
call RemoveLocation(udg_YourVariable[5])
call RemoveLocation(udg_YourVariable[17])

Keep adding on to get as many as you need, unless I am misunderstanding you, then post back.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
It might be better just to create a region for them to revive in, if you use the set point with out an array it will just over write where the units will be spawned at every time a new unit dies. As for the array ones, those can be tricky to use in a case like this. You would need to set it to a high number and then do a check to see where the point is located.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
1. Dieing unit is lost after waits. So the triggers wont work fine.

2. ps pan camara causes server splits, not crashes.

3. Also if you host you lag to even if it is not you causeing the lag.

4. If you build up enought leaks it will crash your map. This was already talked about in this thread.

1. Dieing unit IS MUI. I just tested it. It will work fine.

2. Yep, my mistake. I forgot that server splits != crashing. Disconnection and players ending up in there own games is what happens if you use Camera - Pan Camera as necessary...

3. "When the game is being run off of your computer, leaks are much less noticeable."

I didn't say absolutely no lag. I said leaks are less noticeable when the game is being run off of your computer.

4. I'm going to test this on a single player game, just to show you how many leaks it takes and how much lag it creates for a single player before a game will crash.

I'm creating a trigger that runs every 0.01 seconds, and creates 25 locations every time it runs.

It is also incrementing a number, which I will use to keep track of the amount of leaks created. (I am using "call Location(0,0)" to create a generic location leak).

While I wait, I will be using my army of riflemen to attack blue's army of riflemen. :p

Hmm. I've killed all of blue's units. I currently have 215825 leaks in the map, and it's running smoothly. 25 leaks per 0.01 seconds is equivalent to 2500 leaks per second. 1 player seems to be running just fine.

It's up to 401025 leaks. It is taking too long, so I'm going to make it 25 leaks every 0.001 seconds. (This took about 10 seconds to exit, by the way).

700000 leaks is starting to lag, but this may be because I have 25000 leaks per second. I'm going to tone it down a bit to see if I can make the game run smooth, while still seeing if it is the leaks or the amount of processing being done by the game that is making it lag. (This took about 1:30 to close the game).

I'm going to try 10 leaks every 0.001 seconds (10,000 leaks per second).

OK, 935340 leaks, and it is just starting to have its effect on the game. Now I'm going to wait for crash.

2,842,220 is the last number I saw before it crashed. For the game to get to that amount of leaks, it took 4.747 minutes for that to happen. Lets say that you have 100 leaks per second. It would take almost 8 hours of constant 100 leaks per second for it to crash the game. However, if it was leaks causing the crash, the thread would not be complaining about a crash. It would be complaining about major lag, since I was unable to even move the camera after about 1,800,000 leaks.

My advice to the OP is to check the map for infinite loops. That is most often the cause of random crashes.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
1. Dieing unit IS MUI. I just tested it. It will work fine.


What is your decay time set to for the bones? With most people such as my self the value is altered, change the decay time of the bones to 15 secounds then do a trigger trying to revive the unit 30 secounds after it died.

you dont only want to take into account how many leaks thru out the game but also how many leaks at one time, I have been able to run a map with no lag with more them 1 million leaks, but if I create 1,000 leaks at once it crashes.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top