HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Post Map Lag?

12-25-2003, 05:56 PM#1
th15
I'm about half done with my Tank Commanders map and ive noticed that after a full game, it takes FOREVER to return to the Bnet screen after the score screen.

After exiting the score screen you're stuck with a blank screen and it takes a long time before it returns to Bnet. I've had to force close WC3 the past few times.

The map is only 235kb, there isnt an excessive amount of doodads/units either.

The only reason i can think of is the number of floating text i have. I've got an array of 24 floating text that are constantly recreated every 30 sec to prevent them from disappearing.

Can anyone give any suggestions on how to reduce this lag? I can't use the "destroy trigger" method because I don't have the new UMSWE.

I've attached the map just in case anyone doesn't understand what i'm going on about.
12-25-2003, 06:08 PM#2
dataangel
Quote:
Originally posted by th15

The only reason i can think of is the number of floating text i have. I've got an array of 24 floating text that are constantly recreated every 30 sec to prevent them from disappearing.


That's probably it. Don't recreate them. Just continuously set their transparency to 100%. They don't actually go away -- they just fade once.
12-25-2003, 07:16 PM#3
Dead-Inside
Or remove them and then re-create them.
But yes, that must be your problem.

Regards
Dead-Inside
12-25-2003, 11:37 PM#4
FerretDruid
I'd appreciate some warning if I'm going to download a map to try to help and not be able to even open it. Some of us don't use 3rd party editors.
12-26-2003, 02:06 AM#5
th15
Quote:
Or remove them and then re-create them.


Thats what i do. Every 30 sec it destrys all 24 floating text and recreates them.

FerretDruid- Sorry ferretdruid, its protected. I figured most people wouldnt want to go through that many triggers anyways.
12-26-2003, 02:52 AM#6
FerretDruid
If it's protected, why bother attaching it then? You explained your problem well enough, what good is seeing it in action going to do? If you've tried what they suggested, which is really the only obvious answer given the information you've provided, you should probably post the triggers you are using to display the text (if you think that's what is causing the problem). Otherwise, I can't think of what else would cause it.

P.S. I don't blame you for protecting your map ;)
12-26-2003, 02:52 AM#7
dataangel
Quote:
Originally posted by th15
Thats what i do. Every 30 sec it destrys all 24 floating text and recreates them.


It could also be that you're creating special effects without deleting them, or locations. If you use Position of Unit (GetUnitLoc in JASS) in a periodic trigger, that's probably the problem. It creates a location that is then never deleted. To fix this either learn to use local variables and RemoveLocation, or go to the JASS Vault and pick up the function LocationMakeTemporary.
12-26-2003, 03:10 AM#8
Grater
It could also be triggers leaking memory, periodics which use uint groups "pick every unit" or "count number of units" etc etc leak a remarkable amount of memory if the unit group isn't tidied up manually.

It would be possible to be much more helpful with access to the triggers themselves (no real need for the map, you could just export the triggers)
12-26-2003, 03:24 AM#9
th15
Are you guys saying that the GUI is so inefficient that even using "position of unit" takes up memory? damn. I use that ALOT in this.

Sorry, w3c doesnt accept .wtg attachments so i cant attach that.

dataangel- what do you mean by local variables?
12-26-2003, 03:55 AM#10
Grater
Zib it, or import the triggers into a blank map and attach that :D

The GUI triggers can be inefficent in many unexpected ways, however 90% of the excess memory usage is probably in 10% of the triggers, so optimization shouldn't be very difficult.
12-26-2003, 03:13 PM#11
jmoritz
Destroying objects doesn't free all of the memory associated with it, just 90% or so. This is not a big problem usually, unless you create/destroy objects by tens of thousands.
12-26-2003, 11:03 PM#12
th15
Okay, my main turret trigger is like this, sorta.

Event
Every 0.5 seconds

Condition
GameEnd != true

Action
Pick every player in players matching is playing && is user
Do: For loop integer 1-9
loop: move player turret[player number of picked player + Integer Ax10] to position of PlayerHero[player number of picked player]

Thats the main bit. There is a little more to that trigger that allows the player to manually target a unit to attack.

Before i go on i wanna say thanks to everyone thats helped me so far, especially dataangel.

I looked up temploc in the JASS vault and i found a little to help me. I rewrote the turret movement trigger such that the actual movement code looks like this.

Code:
        set udg_temploc = GetUnitLoc(udg_PlayerHero[GetConvertedPlayerId(GetEnumPlayer())])
        call SetUnitPositionLoc( udg_PlayerTurrets[( GetConvertedPlayerId(GetEnumPlayer()) + ( GetForLoopIndexA() * 10 ) )], OffsetLocation(udg_temploc, GetRandomReal(-50.00, 50.00), GetRandomReal(-50.00, 50.00)) )
        call RemoveLocation(udg_temploc)        
        set udg_temploc = null  

Am i on the right track? Will that solve my problem by reducing the amount of memory wasted?
12-26-2003, 11:56 PM#13
Grater
Event
Every 0.5 seconds

Condition
GameEnd != true

Action
Quote:
Pick every player in players matching is playing && is user
A player group would be leaked here, a better way is using a player group variable and creating the player group at init, then updating it when a player leaves.
Quote:
Do: For loop integer 1-9
loop: move player turret[player number of picked player + Integer Ax10] to position of PlayerHero[player number of picked player]
Number_Of_Players * 9 locations would be leaked here, making the assuption that a location is 8 bytes, that would be near enough to 1K leaked per second... which is still only 60K per minute, or ~3MB per hour. Even taking worst-case assumptions I doubt it would leak more than 10MB an hour, not a huge problem except for very memory limited systems.

The fix to the location(point) leak is to put the location in a tempory variable (use a global, I usually make one called TempLoc).
The move line should be expaned to 3 lines as shown below:
Code:
...
set TempLoc = position of PlayerHero[player number of picked player]
move player turret[player number of picked player + Integer Ax10] to TempLoc
Custom Script: call RemoveLocation(udg_TempLoc)
...

It would be very interesting to see how you determine GameEnd, and also any trigger than runs often and uses unit groups, especially those like "Pick every unit..."

Other possibilities include Special FX that arent cleaned up, or the floating text.

If you trust me not to steal your map (and you can) you could send the unprotected map to [email protected] and I'll take a thorough look at the triggers.
12-27-2003, 12:49 AM#14
th15
%$&$*@ i thought i was SAVING memory by making the trigger only fire for existing players. Grumble grumble grumble... is there a list of functions that cause this kinda thing?

[quote]It would be very interesting to see how you determine GameEndQUOTE]

Errr not exactly rocket science there... when victory condition is acheived the trigger sets the variable.

I trust you grater, but i don't think i need to put you through the tedium of sorting through this crap; its my map, i should fix it :ggani:. I enjoy programming anyways, when it doesn't $%@#^ up on you for no reason anyways :ggani: