Welcome Guest, Not a member yet?
Why not sign up today and start posting on our forums. |
Sector Siege needs improvement
|
Well, could always be something in the code. However, I have checked with a profiler tool and optimized the game a lot. I've used many tricks to do this, and all of it happens when the units are hidden from the player.
A single unit affects multiple things. Even a single fighter has to be taken into account regarding fog of war, updating it regularly. The unit has to scan for nearby units and mark them as visible or not compared to itself. The fighter also has to periodically scan for nearby units and find a target. A movement trajectory has to be calculated and the fighter has to follow this. A single turret needs to periodically scan for nearby units and find a target. If a big ship unit has 10 turrets it means merely this one unit already has 10 turrets looping through all enemy units, and doing calculations to find a target. Smooth rotation of turrets and fighters seem to take a bit too. And there are a lot of turrets and fighters. All of this means there is a lot of looping through objects and calculations going on. Adding more units immediately means the lists grow for units and turrets. I stay clear from doing scanning and calculations every frame of course, and from doing all calculations for all units on the same frame. I use a lot of other tricks to make the game perform a lot better. |
Users browsing this thread: |
1 Guest(s) |