I am working on a Star Wars game that uses dummy units for lasers and missiles. I keep coming up with more and more interesting ideas for it, which is unlike my previous maps I must say, but I'm concerned that I'm going to try to put too much in and cause the game to "lag" when too many people are playing. Here's a breakdown of the rapidly firing triggers:
The whole movement engine is based on a "for each integer 1-100, loop" that fires every .02 seconds and picks every one of the possible 100 units and moves them in the unit's facing direction. It checks the terrain to see if it's possible. Then it checks a point array (1-100 again) that stores where the ship is going and checks for whether it needs to turn. If so, it adjusts the facing angle of the unit. If the unit is a laser it also adjusts altitude as necessary.
All that happens every .02 seconds.
Every .07 seconds a trigger picks every laser and missile and sets up unit groups around them to see if any enemies are there. If so, they explode doing damage.
There are other repeat triggers, but they are much slower so I doubt they contribute much to the lag.
It lagged horribly before I learned how to remove leaks. Since then it doesn't appear to leak at all (I ran it on autopilot and went shopping, came back an hour later and it was still running fine). But I'm worried about how much I can cram into those repeat triggers without busting something.
Is there any way to test that? It needs to be playable on Battlenet as well. Is Battlenet slower than when I just playtest it myself?
Thank you,
Darwin
The whole movement engine is based on a "for each integer 1-100, loop" that fires every .02 seconds and picks every one of the possible 100 units and moves them in the unit's facing direction. It checks the terrain to see if it's possible. Then it checks a point array (1-100 again) that stores where the ship is going and checks for whether it needs to turn. If so, it adjusts the facing angle of the unit. If the unit is a laser it also adjusts altitude as necessary.
All that happens every .02 seconds.
Every .07 seconds a trigger picks every laser and missile and sets up unit groups around them to see if any enemies are there. If so, they explode doing damage.
There are other repeat triggers, but they are much slower so I doubt they contribute much to the lag.
It lagged horribly before I learned how to remove leaks. Since then it doesn't appear to leak at all (I ran it on autopilot and went shopping, came back an hour later and it was still running fine). But I'm worried about how much I can cram into those repeat triggers without busting something.
Is there any way to test that? It needs to be playable on Battlenet as well. Is Battlenet slower than when I just playtest it myself?
Thank you,
Darwin