Saturday, May 30, 2009

Make A New Game

I do a great deal of hobby coding. If I'm not doing that, I'm playing games, which doesn't leave much time for blogging. It doesn't help that I also program for a living, so by the time I get home, gaming is much more appealing than hobbying around with code. Lately I haven't been into a new game so I've been thinking more and more about making another game myself. To date, my games are very simple, use a handful of 2d sprites and were easy to make. Limiting my games to 2d has two distinct advantages.

1. I can load up gimp and paint sprites, or as was recently suggested, load up Inkscape to make prettier sprites.

2. 2d logic is generally easier. You can cull to boxes instead of frustums and hit detection is usually trivial.

I could argue that you can get more depth out of a real 3d environment, but there are still a lot of really well done 2d games that knock the socks off of many recent 3d titles, not because they have more stunning visuals, but because they're just more fun. Even then, there are some 2d games with very impressive visuals.

Even though 2d logic is generally easier, 3d logic really isn't that hard once you wrap your head around the basics. Things like octrees, AABB trees and ray-triangle collision detection are actually not that hard to implement. Furthermore, there exists a wealth of open source 3d engines that solve a lot of these problems for you. (Ogre3d, Crystal Space, Irrlicht)

When I ask myself what keeps me from taking on a 3d game in any serious context, it's content creation. If my game needs people walking around, I'm going to have to model, UV-map, texture, rig, and animate human models. That's a lot of work, especially for one person or even a small team. Next our people are going to need to walk around on something, maybe enter buildings, swim and so forth. At least here we only need geometry and textures, but we need a lot of it. As I build my design document and flesh out gameplay ideas or story, I'm considering what kind of engine technology it's going to require and what kind of content I'll need.
How many game ideas involve a character walking around and interacting with other characters and the environment? Hint: lots.

Your story stops mattering at that point because it's not the bottleneck, it's not the hard part. Take a look at Fallout 3. I love the Fallout games. I even got some brief enjoyment out of that flop of a tactics game Interplay made. (This game marks the point where they officially jumped the shark.) Fallout 3 is immersive and visually impressive, a successful, although non-traditional resurrection of the franchise. Maybe everything is roughly the same color, but it still looks pretty good. The world is enormous and took a lot of time and work to make, but even in this professionally built game, they're repeating scenery and geometry.

All of this prattling on has been to lead up to the focus of some of my recent hobby coding. I've been tinkering with procedural terrain and procedural texturing of that terrain.
Thus far I've made a script that processes an 8-bit height map image into terrain geometry of the specified scale. You can even assign an arbitrary number of height levels with unique textures that are procedurally blended and 'baked'. In another mode it can use vertex colors to produce something more cartoony. Next I might look into using some Perlin noise to speckle the terrain with trees and rocks or other detail meshes.
My next post will be a more in-depth look at procedural terrain and my hope is that over the next few months we can explore some gameplay ideas and their accompanying implementations and requirements.