I am having lag issues with my map and I am trying to pin down where they are coming from. Its a defense map. Every 30 seconds I spawn enemy units and send them down the path. However, I also generate a random number to determine if a special event happens. The events range from nukes to spawning additional units to random parts of the map. Currently a random number between 0 and 10 is picked and I was wondering if this could be the source of my lag.
I have it set up using switch statements. Can switch statements be the cause or is it the random number I pick?
Rollback Post to RevisionRollBack
The Team - TnTProductions
TnTProductions latest Project - Docking Bay 13
TnTProductions Epic RPG in the making - Psionics: Chaos Rising
Check out our website on wixx! http://bulletbutter.wix.com/tntproductions
None of the things you mentioned would cause whole map lag. You either have some other triggers doing something wonky or have over doodaded the terrain. Posting your map might help us figure out what's going on.
Generating a lot of nukes, or anything that is graphically intensive will cause 'stuttering', which is often misinterpreted as lag. In laymens terms, the graphics card is given a straw to suck up ten litres of custard, and it chokes. As a general rule of thumb, avoid particles (smoke, fire, explosions, nukes), or mass creating (100+) units at once.
@Dustin374: Go
Well its not over doodaded. I've been able to pinpoint when the game lags and its every 30 seconds when a new wave spawns. Im really thinking its something in my timer or spawn trigger thats causing it.
@Nardival: Go
How many nukes is a lot? The amount of nukes created is based on how many players are in the game. Basically 1 nuke per player in game.
The way I have it set up is that every 30 seconds, pick a random number between 1 and 15, and one of 10 things can happen. Triggers are set up like this...
Pick random number between 0-14
- If 0 (run trigger 01)
- if 1 (run trigger 02)
- if 3 (run trigger 01 and run trigger 02)
etc....
The triggers that run are spawning nukes, marine drop pods, spawning additional units, etc.
Rollback Post to RevisionRollBack
The Team - TnTProductions
TnTProductions latest Project - Docking Bay 13
TnTProductions Epic RPG in the making - Psionics: Chaos Rising
Check out our website on wixx! http://bulletbutter.wix.com/tntproductions
Might be caused by creating a unit type that wasnt preloaded yet. When creating a unit for the first time its not yet within the ram and needs to be loaded from the hard drive. Try to create each unit type you spawn later at map init and immidiatly remove it from the game in order to get all the data into your ram, to see if this fixed the lag issue. I remember this worked pretty well back in wc3.
However, in general creating alot of units at once will cause a small lag spike since alot of data needs to be loaded.
I cant tell without knowing your script, but in general generating a random number wont be an issue at all.
I am having lag issues with my map and I am trying to pin down where they are coming from. Its a defense map. Every 30 seconds I spawn enemy units and send them down the path. However, I also generate a random number to determine if a special event happens. The events range from nukes to spawning additional units to random parts of the map. Currently a random number between 0 and 10 is picked and I was wondering if this could be the source of my lag.
I have it set up using switch statements. Can switch statements be the cause or is it the random number I pick?
@bulletbutter: Go
None of the things you mentioned would cause whole map lag. You either have some other triggers doing something wonky or have over doodaded the terrain. Posting your map might help us figure out what's going on.
@bulletbutter: Go
Generating a lot of nukes, or anything that is graphically intensive will cause 'stuttering', which is often misinterpreted as lag. In laymens terms, the graphics card is given a straw to suck up ten litres of custard, and it chokes. As a general rule of thumb, avoid particles (smoke, fire, explosions, nukes), or mass creating (100+) units at once.
@Dustin374: Go Well its not over doodaded. I've been able to pinpoint when the game lags and its every 30 seconds when a new wave spawns. Im really thinking its something in my timer or spawn trigger thats causing it.
@Nardival: Go How many nukes is a lot? The amount of nukes created is based on how many players are in the game. Basically 1 nuke per player in game.
The way I have it set up is that every 30 seconds, pick a random number between 1 and 15, and one of 10 things can happen. Triggers are set up like this...
Pick random number between 0-14
- If 0 (run trigger 01)
- if 1 (run trigger 02)
- if 3 (run trigger 01 and run trigger 02)
etc....
The triggers that run are spawning nukes, marine drop pods, spawning additional units, etc.
Might be caused by creating a unit type that wasnt preloaded yet. When creating a unit for the first time its not yet within the ram and needs to be loaded from the hard drive. Try to create each unit type you spawn later at map init and immidiatly remove it from the game in order to get all the data into your ram, to see if this fixed the lag issue. I remember this worked pretty well back in wc3.
However, in general creating alot of units at once will cause a small lag spike since alot of data needs to be loaded.
I cant tell without knowing your script, but in general generating a random number wont be an issue at all.