Making Surface worlds is complicated...
Talking with some of the guys on the design team we had a wish list item that we really felt needed working out to make the game better. Originally the episode generator when it came to surface missions were only one offs. That is you could only visit one surface spot once, This was due to how I initially wrote the randomly generated level creation, But after several long discussions we decided that I could do a whole lot more if we could load and save multiple spots on planet and return to them later in the game, either in generation of the episode or just cause you wanted to go back to where Red shirt #68 had died previously in your game. So I was finally at a point at the beginning of this month to work on that. So I started by writing a save state string that would be generated during a the creation of a new surface scene, And that is where our first headache occurred.
So here you have a single typical generated level's output string that I crafted...
If you chose to check it out you will see its quite a few characters long but it contains everything I need to place set pieces on the screen in the correct sizes. The problem is that the string is quite large, especially if I wanted to provide multiple spots on a planet, After running some numbers a typical estimation is I would have 1mb of text for every 8 worlds I generated. That means in a endless universe your surface missions data would grow to rapidly and take up precious storage space, especially if it was a mobile device. So I scratched my head, and the scratched the heads around me to see if any Ideas would fall out. Damon suggested Random Pools or a Pseudo-random number generator. What this meant is that if successful I could generate using my algorithm the same type worlds but each time a seed value was entered I would get the same sequence of random numbers. The result is below. Needless to say I am quite excited by the results, the same 1 mb that I could fit in 8 worlds or so I can now fit over 8,000.
Here is the seed that generated the following world scene in different colors: 999987
I also started working out how battles may be conducted on the surface. The current front runner is when you enter a battle situation your guys line up and the enemy line up for a turn based affair. You can select any one of your guys to move to the front of the line and execute one command. Each officer regardless of job can fire their side arm, at the first guy in the line of sight, Or use their special ability, For instance A security officer can throw grenades, and damage several people or a engineer can erect a shield barrier. Then the enemy takes one turn doing the same. Still ironing it out but as I said this seems to be the front runner and works well in game so far.
Look forward to any comments!