• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Cant find the leak

Status
Not open for further replies.

sentrywiz

S

sentrywiz

EDIT

All the triggers and and everything I've tried resulted in nothing. So I tested with just a normal ability.

There is nothing wrong with the spells.

The doodads are causing the lag. Either the pathing blockers (there are too many of those)
or the doodads I've created with a bad base. Like for example a library with a base of torch so I can place it anywhere.

Therefor this thread isn't needed anymore. I request either a delete or closed status because I thought I coded the triggers in a wrongly manner and true some of them were coded badly but none of them were the cause of the lag. The map itself or the terrain is.
 
Last edited by a moderator:
Level 19
Joined
Aug 8, 2007
Messages
2,765
leaks will not cause this that fast fyi, your problem lies in your coding.

e/

Unit - Move moving_spear instantly to (loc_move offset by 35.00 towards (Facing of moving_spear) degrees), facing (Facing of moving_spear) degrees

this leaks
 

sentrywiz

S

sentrywiz

leaks will not cause this that fast fyi, your problem lies in your coding.

e/

Unit - Move moving_spear instantly to (loc_move offset by 35.00 towards (Facing of moving_spear) degrees), facing (Facing of moving_spear) degrees

this leaks

Tested, its not that. Making the facing of unit twice in one trigger proves that I overdid things but that doesn't leak or doesn't cause the major leak.

Anyway thanks for pointing that out, but that's not the cause.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Tested, its not that. Making the facing of unit twice in one trigger proves that I overdid things but that doesn't leak or doesn't cause the major leak.

Anyway thanks for pointing that out, but that's not the cause.

well for one your trigger never turns off, you check if the number is 0 inside of the enum which will always return 1+
 
  • Unit - Move moving_spear instantly to (loc_move offset by 35.00 towards (Facing of moving_spear) degrees), facing (Facing of moving_spear) degrees
You need to store the offset in a variable too, this leaks a point:

  • set loc_move2 = (loc_move offset by 35.00 towards (Facing of moving_spear) degrees)
  • Unit - Move moving_spear instantly to loc_move2, facing (Facing of moving_spear) degrees
  • call RemoveLocation(loc_move)
  • call RemoveLocation(loc_move2)
Edit: Or you can move the dummy with this and you don't need anymore the locations:
  • Custom script: call SetUnitX( moving_spear, GetUnitX(moving_spear) + 35 * Cos(GetUnitFacing(moving_spear) * bj_DEGTORAD))
  • Custom script: call SetUnitY( moving_spear, GetUnitY(moving_spear) + 35 * Sin(GetUnitFacing(moving_spear) * bj_DEGTORAD))
 

sentrywiz

S

sentrywiz

well for one your trigger never turns off, you check if the number is 0 inside of the enum which will always return 1+

That makes no sense whatsoever.

If a spear is launched, global counter of spears_group will increase by +1 which will run the trigger.
When a spear's range becomes 600 or greater or when it hits a unit, its removed both from the game and the group.

I am checking if the units inside the spears group is greater than zero, in which case the spear either hits a unit or moves. If by any chance, to prevent infinite loop I turn off the trigger if the spear_group is zero in which case there are no spears flying and there is no need for the loop to use up RAM.

EDIT:

You are right, I just tested. The trigger never turns off, its constantly on. That proves for the lag.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
That makes no sense whatsoever.

If a spear is launched, global counter of spears_group will increase by +1 which will run the trigger.
When a spear's range becomes 600 or greater or when it hits a unit, its removed both from the game and the group.

I am checking if the units inside the spears group is greater than zero, in which case the spear either hits a unit or moves. If by any chance, to prevent infinite loop I turn off the trigger if the spear_group is zero in which case there are no spears flying and there is no need for the loop to use up RAM.

you check if the number of units is > 0 within the group enum

how is the group enum going to run if the number is 0?
 

sentrywiz

S

sentrywiz

I've edited the above post but I'll respond to all here:

-offset point proved by anvil, you are right that leaks there. and it leaks alot
-arhowk is right about the condition, the trigger never turns off
-maker knows lot, but i think those things are getting removed each time. its just that trigger runs even when there are no spears to move

+rep for all of ya
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I've edited the above post but I'll respond to all here:

-offset point proved by anvil, you are right that leaks there. and it leaks alot
-arhowk is right about the condition, the trigger never turns off
-maker knows lot, but i think those things are getting removed each time. its just that trigger runs even when there are no spears to move

+rep for all of ya

nope makers correct, you never null/DestroyGroup those
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
You need to destroy the groups.

You then need to null any variables that referenced that group if they will not be changed shortly. You need to null all locals defined with the "local" keyword that referenced that group due to a game bug causing a reference leak.

well meant RemoveLocation/DestroyGroup :\
 

sentrywiz

S

sentrywiz

Okay since I got more replies I'll respond by saying:

I've edited all the stuff that you guys told me. The spear still leaks and there is a massive lag after 5 or so casts on the spell. I've did everything, but none of that is the actual global leak.

I've rechecked the triggers a zillion times and there is nothing wrong with it.

I am removing location and destroying groups.
if anyone can remake the actual trigger so it doesn't leak I will be happy to try it out.
 

sentrywiz

S

sentrywiz

It still lags

Maker fixed the trigger being on all the time successfully.
But yeah, it still lags after the 5th or so cast.
 

sentrywiz

S

sentrywiz

Try removing the debug messages. They themselves are classable as a leak.

Also please update trigger so we are not looking at the old version (before some leak fixes were made).

Done. Check the main post
 

sentrywiz

S

sentrywiz

Try removing the debug messages. They are themselves a kind of leak as they persist in memory to some extent.

The lag and leak's slow down the game even before I added the messages. Having them or removing them solves practically nothing.

I'm unsure why the problem persists. Because I made the same original system for the other map I am working on and it doesn't lag there. I copied it from that map, changed a couple of vars but it doesn't lag there at all.

Can custom tilesets or too many doodads, like pathing blockers or doodads/destructibles in general cause this much lag?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
why i can't find my new comments on my map.
but in my CP, there's two another comment and +rep.. but dont recieve it, it remains like no comments and no + rep (2 votes are old).. HELP ! im new Here! ^_^

1) Never post in a thread that isn't yours unless you have something relevant to speak about. Create your own thread if you would like to receive help on a topic.
2) You're being incredibly vague. You're not going to make a great map being one week in the Hive but the Hive maintains very high standards for its resource section so I would suggest not posting a map for a while and instead going to Map Development
3) Never expect +rep, +rep is only a symbol of gratitude and it should not be used as a symbol of respect, politeness, and you should not expect to receive +rep for anything that you do.
 
Status
Not open for further replies.
Top