Well almost a week has passed, but very little has happened on this over that time what with Christmas and all that. I've tinkered a bit with some of the sounds, fixed a little bug with the weapon segment, but nothing major. So rather than post nothing, I thought I'd give a little bit of history of what's happened from August until the end of this year.
I had the idea for a simple space trader early in the year and I started prototyping the basic mechanics with beads, dice and a paper hex-board. I always wanted to include realistic orbit mechanics so after the board prototype I expanded the idea with another prototype built in Excel - i do a lot of prototyping with Excel as I find it easy to set something up and then tinker with the formula before I start any proper coding. So after a few weeks of getting to grips with orbital mechanics I figured I had enough to start the game proper.
The first month went well, I implemented the ship designer and the basic trading features, but then the headaches appeared.
The first pain was to solar system builder. I had this idea of implementing an acrete model for building the solar systems. This is where you start with a big disc of gas and particles and you randomly add tiny planetesimals at random distances from the sun and with random eccentricities. These planetesimals collect all the dust in their path and, if they get big enough, collect some of the gas too. The system basically needed about 300-500 planetesimals added to create a system resulting in 4 or more major planets, plus their moons. Generally it was a poor design choice. The algorithm took ages, and given that the players will just want to jump into the game, waiting a few minutes just to create the map was never going to be good enough. So after about 6 weeks of coding and tinkering I decided to scrap the method completely and simplify the system builder completely. It's not as geeky, but the end result is much better for the game.
The next pain was the orbital mechanics. The engine I'm using has a limitation that the float variables are only maintained to 7 d.p. This basically means you cannot model something the size of the solar system and maintain sufficient accuracy for the various spacecraft I wanted to implement for this game. So I had to shrink the solar system to about a 200th of it real size. Then I had to play about with the gravitational constant so that the planets orbited the sun in a reasonable time. I say reasonable because I didn't want to make a space simulator. I love space sims don't get me wrong, but I wanted the player to be able to explore this system (relatively) quickly. So I adjusted the values so that travelling from Earth to Mars only took hours, rather than months. But these were only minor head-aches. The real problem was getting the two-body orbital mechanic formulae to work for multiple bodies. Basically I was trying to get the game to re-calculate the two-body orbital parameters every time the player used the thrusters. Then when the player reached the planet's sphere of influence distance recalculate the parameters again, but with the Sun, or the Moon as its new primary node. Anyway, basically it was all getting too complicated and the calculation was not particularly quick so in the end I ditched the two-body formula and opted for a permanent multi-body solution. The main difference was that, with the two-body formula I could perform time-acceleration really easily since the orbital positions with respect to time were all mapped out. With the multi-body solution, accelerating time meant the orbits were very unstable when close to a planet. So i soled this, by simply restricting the maximum time acceleration relative to the distance to the planet. It's not ideal, but I think it works ok.
Now since I've removed these problems, the game has moved forward nicely. I'm currently thinking of how to implement the mission system, but I'll let my brain cook that one up for a few days while I work on the A.I. and fix the segment upgrade feature.
Laters.