Monday, August 16, 2010

Week Six / Day One

Last night driving home I was mulling over the fact that my game appeared too static. When you start a level, it's just there. Nothing is happening, and the whole scene appears dead. Now how to go about changing this? Something I've been considering for a while is moving planets, but I didn't how a clever idea of how to go about it. Would they move back and forth in lines, or better yet what about an orbit? One of the keys to my game though was that the planets didn't need to be updated, as this was one less headache to consider during optimizations. Planet updates added another layer of complexity, requiring extra work per frame updates. However, if I wanted to move in an orbit, all I really needed was an angle, a radius, and a center point. From here I could just increase the angle as I updated the planets' position, and I would have my orbit. Also, since I was already calculating the force between each planet and the ship, I wasn't adding any complexity to the runtime for the n planets, just 3 more lines of code, two of them simple trig calculations.

With that I had dynamic planets, and they added exactly what I wanted to the game. It was only a few extra values to include with the level input file and I was able to create planets which used other planets as their center points, effectively creating moons. In the screenshot at the bottom of the page you can see such an example. The green planet has a large swooping orbit, while the tiny green planet (or moon) orbits around the former. An initial test of over 20 planets seems to make little difference to frame rate. Any frame rate issues I have right now I believe are due to the fact that I still don't have the physics updates and render updates properly decoupled.

The second project of the day was to get scoring working, along with properly handling level completion, which can also be seen in the screenshot at the bottom. On the game screen, the top two numbers are the timer and the total number of color changes made thus far. In the level completion section, you can see the calculation of the score, which is just the product of the timer and the color changes. The scoring system is similar to golf, such that lower is better. You are trying to get the quickest time as well as the least amount of color changes. The number at the bottom of the screen is the distance to the goal. That way when the goal is out of the player's view there is still a method of tracking it.

I also made a few small art changes, such as the new texture for planets. They also spin now, to add more 'life' to the scene. Again, none of the art is final, as it still hasn't 'clicked' with me. I must say though, each day I get more confidence in the completion of the game. I am getting closer to really having something that I would call a presentable game, and it's pretty exciting. There is still a lot of work to be done, but the motivation doesn't hurt.

No comments:

Post a Comment