Its been a lot of work getting things smoothed out and its tiring unforgiving work.
My C# skills are getting good enough to write code that just works and doesnt need to be debugged over and over. Its been a really useful code learning tool.
Tracking down this lag fix has been really hard. The thing is that even though the lag caused the game to get to an almost unplayable point the cpu usage information for the game did not clearly show it. This spot in the game is using 10% of the CPU time. doesnt seem like much but thats because its averaged...
in between the lag spikes it doesnt use any cpu time so that 10% doesnt show that it actually is more like 90% for a short time.
So i had to turn off chunks of code until i could find the issue. That took a long time. hours of turning something off looking for a change in the lag and repeating...
But i found it. Turns out the piece causing the lag... wasnt even really used in the game. When fleets were created automatically, not in the fleet design screen, it did this thing where it grouped up fleets into sub squads. clearly that was supposed to have some added ability later like having separate orders to different squads. This squad effect could be seen in the fleet screen where ships were grouped by a green dot with green lines going to each ship. you could select and move all the ships by clicking on the dot but when manually creating a fleet there was no way to make these squads. There was no point as the feature did not do anything.
To kill the lag i just turned that off. This gives a marked improvement in the performance of the game. The little pauses at each turn were reduced tremendously. Later i may turn that back on to run in its own thread. that should do the trick as the feature could be used in some interesting ways. it still can just not as easily.
the lag fix is in the current monthly blackbox 9xx build.
Also found some things that crashed the game when loading WIP designs and a tech file format issue that allowed the tech to be malformed for no reason. This was crashing techlevel mod in spots.
this fix will be in the next monthly build 902 or later.
There are some other issues i want to try and get fixed that causes the AI ships to be unresponsive when assembling fleets and to pause at each turn.
later i hope to kill some of these other turn lags i see. They should all be fixable to utilize the all cpu power available. As of now the game is playable at 3k ships but the memory usage gets to be a problem at that point which is a whole other ball of wax that im not sure is solvable.