Progress update

University has started again and I have decided to try to post more regularly on this blog. Hopefully my studies don't get too much in the way and I will still have time to work on the game. This post is going to be mostly an progress update, I don't feel like I've got enough new features in to release a new demo.

 I've been working on adding some stats to the planets. Their type and size are now displayed, but the more interesting thing is now they also have three types of production : Industry, Science and Flux.

Planet stats with decriptions on mouseover
- Industry is used for the production of ships and planet upgrades.
- Science output form all planets owned by the player contributes towards the technology he/she is currently researching.
Those two are pretty standart for this type of game but the third one is a bit more interesting. Flux acts as the game's currency but it also doubles as the fuel that the spaceships in the game use. This means that things (spaceships, upgrades, tributes, etc) are paid for in Flux and all ship movements use up some Flux. I think it is an interesting idea to explore and I haven't seen this done in any other game. It is also a different take on the traditional 'army upkeep' mechanic.
I was also considering Food and Population as planet stats but I decided to keep it simple for now. Planet anomalies inspired by Endless Space are also in the works. In fact I'm currently using a lot of text from that game since it is one of the primary sources of inspiration for 'We Are Not Alone'. Hopefully in the feature I will team up with a sci-fi oriented writer and all the text will be custom.

As I was working on adding those planetary stats I started using XML files for the first time and I must say it is a great way of saving data, I recommend that all starting out game programmers look into them.

I was also looking into reducing the planet generation time. I turned out that most of the time was spent on checking whether the newly generated star system would be too close to any of the others. As I was already doing the distance checks with the squared distances and couldn't come up with any optimizations I decided to try to make the code run in more than one thread. As I was reseaching how to do this I found out that the topic of  paralel computing is vast and it would take me a lot of time to get into it. Fortunately I came across Parallel.For, a for loop that runs on all available threads. It doesn't guarantee that the iterations will be executed in order but that was fine for my purposes. After using the parallel loop the galaxy generation time went down from 2.5s to 1.5s on my computer, I am happy with the performance increase.

Asteroid Belt, Arid and Tundra planets
Finally, I also added three new planet types: Arid, Tundra
and Asteroid Belt, again inspired by Endless Space. (An asteroid belt is not techically a planet, but ... :D )

That's it for now, looking forward to your comments!

Posted by FiLkAtA | at 5:48 PM

0 comments:

Post a Comment