Friday, August 13, 2010

Week Five / Day Four

If I keep having weeks like this one I'll be pro in no time.

So today I started off fixing the error I had with the level loading. It turns out that it wasn't necessarily my fault. For some reason if I create a file in vi and then import it into my project in XCode, I have no problems accessing it and using it. However, if I create a blank file within XCode, it doesn't work properly. It's as if there is garbage in the file. Perhaps XCode's blank files aren't actually blank. Annoying. Regardless, I figured out the bug and level loading works as expected now.

I also wanted to stress test a bit, so I created a file that had 16 planets. While 16 isn't that many, if it made noticeable differences in performance it would give me a benchmark as to how much I can push the engine. Luckily, it seemed to make practically no difference. Considering how lightweight my geometry is, and the fact the textures are more streamlined since I found out how to make color changes, I didn't expect it to make much of a difference. I'm hoping to support 100+ planets, but without a level builder it is extremely tedious to create a file with those sorts of parameters.

I cleaned up the menu system quite a bit, as you can see below the buttons are much slicker, and the interface has some cohesion to it. This is by no means final art, as the UI and game art really don't go together, but at least it looks more like a game.

What you see in the background is a starfield that scrolls behind the menus. The Intro, Main Menu, About, and Level Select screens all lay over top of it, so there is a smooth transition between each. You can see it in motion in the video at the bottom.

I've also got a pause menu implemented, which allows you to restart the current level or quit back to the main menu at anytime:

Simple stuff given the modularity of the engine, but a useful necessity none the less. As I said earlier I got color changing working with the lighting, so now everything has lighting effects as well as textures with adjustable colors. Now rather than a texture for each button, each planet, etc. I have a single greyscale one that gets adjusted based on what I need.

Before I finished today I added in the level end marks, which are currently marked by the purple planets seen in the pause menu screenshot. By having the end of the level be a planet (with a few extra parameters) it gets treated just like any other planet, and sucks you in once you are just close enough. While nothing happens yet, the next step is a menu for handling a level completion. I would also like to add a timer and the ability to keep track of color-changes for ranking the player at the end of each level, and thus being able to keep a high score list for each.

I believe that is all the changes for today. I did have a very peculiar error worth mentioning though. Usually when an iterator goes out of the bounds of its vector it results in a EXC_BAD_ACCESS error. However, I had a problem today where it seemed like an infinite loop just prior to the applications completion of launching. I had resized a vector one less than needed and therefore the iterator was out of bounds (as a result of sloppy access on my part). It wasn't too hard to pinpoint, but still interesting that there was no 'segfault'. I'm guessing this has something to do with the startup process of an app. Anyway, here is the first video demo of Project Chromo. I don't have any good capture software so I had to use some demo software, so excuse the watermark. In the meantime, happy coding.


No comments:

Post a Comment