HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Map Slowdown/Freeze ???

01-22-2003, 11:23 PM#1
Guest
Hey I've been making a TD map, with 50 lvls, and for some reason, after a while it starts becoming a real drain on memory (much more than most maps?). Also when I try to save or quit after playing for ages, it tends to freeze the computer (my computer ain't crap either). So I was wondering if it was trigger related, somehow using more memory than it should?

Email me at [email protected]

PGConqueror,
www.Mapcraft.rr.nu
01-22-2003, 11:57 PM#2
Trav
Usually slowdown results from either:
a) Periodic triggers that are too frequent
b) Triggers that fire too often
c) Tons of SFX/Units/Doodads/etc

Quite a few other things too, but those are ones I notice the most often. So if your level check is some periodic event that checks every millisecond, you might want to decrease frequency.
01-23-2003, 12:19 AM#3
Guest
Well I only have like 2 periodic events, which are both every 1 second. There aren't many triggers firing, just mainly the one that creates the next level. As for doodads, well its not very much at all. I've had maps with tons and much less lag.

PGConqueror,
www.Mapcraft.rr.nu
01-24-2003, 01:35 AM#4
Guest
I can reach lvl 20-25 with no lag at all. From then on there is a jolt whenever the monsters are spawned, and it increases each level. I can't even do anything in the last 5 levels because it lags so much. The final 2 levels often crash my computer. I get all those wonderful running out of memory warnings. I got 256 ram.

PGConqueror,
www.Mapcraft.rr.nu
01-24-2003, 01:49 AM#5
Trav
When an enemy dies, do you remove the dying body from the game or let it naturally decompose? I recently heard that using Unit - Remove will not free up memory the way natural death will. Seems to be true too, helped clear up a couple spots on my map.
01-24-2003, 09:46 PM#6
Guest
Uh huh. I tried that too already. Before I had that remove unit trigger on, tested it without, and it *seemed* to go faster by a bit. So I've left it as a natural death. But it *still* lags a very very great deal near the last few levels...

PGConqueror,
www.Mapcraft.rr.nu
01-25-2003, 10:28 AM#7
Krakou
Try to explode the dying units and then remove it from the game.
01-25-2003, 12:34 PM#8
kharma
It may depend on how your TD plays out. If it requires mass tower building with complex effects, then that may be a trouble spot as it nears the end. It may also be creep creation..is the map permanently slow? Or does it fluctuate when there are no/very few creeps as opposed to when the creeps are being spawned and there's lots. Have you tested it with other people, and does it generate the same effects on their computers?

Seems like there's some sort of memory bottleneck or as yet unknown error that every now and again plagues seemingly random maps with incredible slowdown for which no-one understands.
01-25-2003, 02:12 PM#9
Guest
I've had the same thing happen on my map.

I've isolated it to being an effect of replay from WC3 and it's inherent problems when a game has a lot of units or special effects. Even if you don't save a replay, WC3 doesn't know you won't be saving it until the end of the game, a huge mistake in my opinion. There should be an option to deactivate replays either in the editor, or an option prior to starting the game.

Look at it this way: even if you remove the dying unit, or destroy the sfx, the game must remember that unit, and it's position, because it was there at one time, or that special effect was there at one time. So for replay's sake, it dutifully remembers the sfx or the unit, and it's position, and a lot of other things. This causes a lot of memory issues.

A good way for checking for this problem is save the game periodically. If the game save size starts exceeding around 17 Megabytes, then your culprit is this issue. This is when I start having lock ups and massive slowdowns with save game files.

My cpu is pretty quick, so I don't notice quite as much lag during gameplay.

My only advice is to not to make units move too often, eliminate any unnecessary special effects (don't create them in the first place), spawn units only within a certain range of Heroes, so there won't be a huge amount of units on the screen, and only activate triggers that are necessary.

As far as trigger periodicity issues, this doesn't seem to be a problem with me. And unless you have a recursive which is going out of control (not likely), then you should be able to have quite a few periodics.

I've been able to make my game playable for many hours now, after following these rules, and I have quite a few periodics under a second. I also have 394 triggers and 306 variables!

Good luck!
01-26-2003, 02:04 AM#10
Guest
Oh and all the generated "monsters" are creep.

PGConqueror,
www.Mapcraft.rr.nu
01-26-2003, 03:43 AM#11
Guest
Sorry, couldn't look at it today. I'll take a look tomorrow.

Lvl 35+? How long about is that for gametime?
01-26-2003, 02:26 PM#12
Guest
Ya, it's the same thing as what I'm having. You don't have a lot of special Fx, but a lot of unit generation.

I only got to level 8 before the save gaem got over 10Megs, (about 30 minutes of play). It's linear filesize vs time, so it's prolly your spawn generation. Will look into it.

Dang that replay feature!
01-26-2003, 02:29 PM#13
Guest
Sorry, on second thought, it's not your spawn generation. The problem is that the spawned units are constantly ordered to different positions on the map per spawn level. THis is the killer.

Just gotta figure out how to not order the units as often.
01-26-2003, 02:32 PM#14
Guest
Instead of every second issuing a repetitive command, gonna try unit enters region, and set up a bunch of triggers for all the regions.

This should drastically reduce the orders given to units, and thus, the memory issues.
01-26-2003, 04:41 PM#15
Guest
OK, much better. It's about 5 times more efficient, memory wise. This means you potentially should be able to play close to 5 times longer than you did without having the issues.

If you've only tested this for single player, and got to lvl 35, then you still could have a problem with 4 players. This means around lvl 9 would cause problems with a full player game, or about lvl 40 with the new trigger codes.

There are 2 options now. There's a 2 second wait (for optimization purposes). We could increase it to 3 seconds, which should reduce memory overhead by approx 1/3.

Or, reduce the number of regions from 20 to 15, and make them longer. This will reduce the number of orders the units receive, and WC3 saves for replay's sake.

Or a partial combination of both (say 2.5 sec delay, and 18 regions).

Do you have your Email? I only did the change to player 1, but you just need to copy the code, and make the 63 extra trigger functions. Should be pretty quick to do. Very simple region triggers.

My email is [email protected] if you don't want to post your addy here.