You'll remember from last week's blog that I was working on a new algorthim to pick the starting planets for the major civilization to improve the loading time. I believe that I have found a good solution. I started a game with a gigantic galaxy using the old code and it took 2.68s to pick planets for 10 major races, which was surprisingly fast as the shortest time from my tests last week was at least 4 seconds for a gigantic galaxy, so it must have made a lot of good random rolls. Then I started a gigantic galaxy with my new code. It took 1.51 milliseconds to do the pre-pick planet code, and then it only took 47.92 nanoseconds when the civs were actually picking their planets. Then, when I got into the game, I saw that it had done a fairly good job of giving the major civs some room when picking their planets. I may tweak the code more when I get a chance.
I also worked on trade routes this week. I had a lot of the code done from GC1, and I had worked on them a bit when we were working on getting all the engine code in as we had wanted to see what effect drawing a line representing the route between the planets had on performance. So I had them running fairly quickly, and the AI was even making routes. I pretty much just had to get it working with the new ship movment code, and make the freighter models shrink when they start their trade route. We will probably have to make some additional changes to the trade route code since now you will be able to design freighters with higher defenses, etc. If you really want to, you will be able to make an Avatar with a couple of trade modules slapped on it.
Then I made a command line parameter that will just pull the settings for a new game from the prefs.ini and immediately start setting it up, without having to go through the first screens. Brad had asked for this to save time while working on his AI, and I think that it's a good idea to include even for release. I think that I can make it faster if I work a bit on it; right now it's using code that makes assumptions that you'll be going through screens and maybe changing stuff.
Other than that, I was mostly doing tweak level stuff. I fixed the ratio sliders on the domestic economy screen so that they work the way they did in GC1. Some of the labels in the context area for the selected improvement were wong, so I fixed those and also fixed a bug where it was only showing the industry bonus for all of the improvements. So now, the research lab shows how many research production points it produces instead of Indudstry 0. The stats in that area all have units in their values now. (ie food = mt/week, which is short for metric ton per week.) You will have noticed that some of the ship components have a size = 5 + 10%; well, not all of them were displaying the modifier, and some that had no modifier were showing 0%. So I fixed that, too.
Originally, we were going to have it so that you could build any level of an improvement. So if you had basic farming, intensive farming, and advanced farming, you could choose to build any of the 3 on a new tile, or upgrade a basic farm directly to advanced farming (skipping intensive farming). Brad, however, has been busy adding in new techs and new improvements, and he discovered that the list of available improvements was getting unwieldy very quickly. So now I've made it so that upgrades automatically obsolete the previous level of improvement in that track. At some point, we'll have a screen to manage obsoleted ship types, etc, so we can always add a section for obsoleted improvements as well.