Regarding memory leaks

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Stardragon said:
Does anyone know of a tutorial on how to prevent memory leaks in custom maps and what kind of triggers cause memory leaks?
I don't have any tutorials, but usually it is bad trigger design.

A few examples:

Giving an item to a unit that cannot hold an item.
Attempting to change player properties of a player that is not playing.
Attempting to create 100000000 units at once and thinking it works on your GeForce Infinity XXX Pro but not realising the guy with a GeForce 0 can't.
In general, changing properties of units, heroes or items that are not alive or considered dead - they are 'undefined'.
Infinite triggers that never stop and have zero delay between them.

Can't think of anything more.*
 

Icedragon

BattleForums Addict
Joined
Aug 2, 2002
Messages
836
Reaction score
0
Location
The Swiming Pools
by Memory Leaks you mean game crashes right?
sorry but i have never run into this problem but x42 seems to know what he is talking about

x42bn6 said:

Attempting to create 100000000 units at once and thinking it works on your GeForce Infinity XXX Pro but not realising the guy with a GeForce 0 can't.
ZTd does this dont ever look at the spawn befor they move it makes me lag like a mofo
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Icedragon said:
by Memory Leaks you mean game crashes right?
sorry but i have never run into this problem but x42 seems to know what he is talking about



ZTd does this dont ever look at the spawn befor they move it makes me lag like a mofo
Crashes or memory errors (a red circle with an X through it, giving a FATAL ERROR! Memory address 0x01234567 or something).

Oh, another thing is when a spell or trigger transforms a hero that has an item into a unit that cannot hold an item. Make sure you trigger it to drop all the items first! Otherwise the item drops, the unit transforms, Warcraft freezes and a memory error occurs.*
 

Stardragon

Member!
Joined
Nov 9, 2003
Messages
106
Reaction score
0
Location
Sweden
Website
www.beelzebub.se
What I mean by memory leaks, are triggers that makes the game lagg more than it should.

For instance, if you use a lot of trigger picking units inside regions and triggers targeting center of region you'll get more lagg than usually. I was able to remove a lot of lagg in my map by using variables and stuff instead of always doing triggers like the ones above.
 

Icedragon

BattleForums Addict
Joined
Aug 2, 2002
Messages
836
Reaction score
0
Location
The Swiming Pools
Yes as to reducing lag yeah varibles and other things can reduce lag... funny there was a guy on here trying to recreate magic the card game and i dont think he knew how to use varibles cause he said it slows the game down... i havnt ever had a problem with lag in any of my maps even my never ending defence on the hardest difficulty(it spawned a unit every half or quarter of a second i dont remember)
 

NewPosts

New threads

Top