Wednesday, March 17, 2010

Mini-projects

So I've been working toward learning DirectX 10 for the past couple weeks and it's proved more difficult and time consuming than I anticipated.

While I'm learning the new API, I've decided to take a break from working on the Earth project and do a series of small projects instead. I realized that most of the programming projects I've built were complex games and simulations that never got done. I usually spend lots of time working on specific aspects of the game, and before I know it the project is a year or two old and there is very functionality to show for it. It is probably a better idea to come up with a relatively simple idea and get all of the key features up and running. Then the extra effort can go into refining the details/mechanics.

One such project I've been contemplating is a "business" simulator. It would be a game where you own a business and try to earn money. The graphics would be very minimal and the focus would be on programming a solid and realistic simulation. Once the game is functional, the graphical representation could be improved (make it 3D, show people doing stuff, etc). I think the basic program could be done in a weekend.

Sunday, February 21, 2010

New Map Generator


I've spent the past few days working on a procedural map generator. Previously, my Earth3 game had randomly generated terrains using some fluid dynamics formulae. The result was a wavy map that somewhat resembled rolling hills. As you can see in the screenshot, the terrain is random, but lacks variety.

The new terrain generator uses coherent noise, which generates much more interesting and realistic terrains. The program starts by generating a Perlin noise map to determine the shape and elevation of land masses. Regions of the map where the elevation is above a certain threshold are designated as mountain ranges. These regions of the height map are blended with a Voronoi noise map in order to gove them a "ridged" look. You can see where the terrain transitions from Perlin to Voronoi, because the mointain ranges are the only regions that have that ridged pattern.

One very useful aspect of coherent noise is that the input parameters allow the user to control the look and feel of the map. For example, increasing the frequency of the Perlin noise causes the map to have several small continents instead of a couple of big ones. Other aspects that can be controled are the smoothness/roughness of the shore lines, and quantity of mountains.

Here's a screenshot of the above map, rendered in Earth3. The map clearly has more personality than the old map. The terrain has distinct geological formations ocurring in different areas, as you would expect to see in nature. The next big feature that this map needs is multi-texturing based on elevation and slope.

Monday, February 15, 2010

First post

I've decided to start a programming blog. I'm always playing around with new ideas and could use a place to collect them and maybe get some feedback. I've been programming in C++ in Visual Studio 6.0 for the past nine years and now it's time for a new chapter of my programming career. I'm upgrading to a new laptop with Windows 7, and will be purchasing Visual Studio 2008 soon.

This programming renaissance came about a few weeks ago when I purchased a copy of "Introduction to 3D Game Programing with DirectX 10". I scanned through the book and quickly became a fan of both the power of DirectX 10 and the author's method of explaining it. To my dismay, I discovered that DirectX 10 does not work in Windows XP. I've become increasingly aware of how out-of-date my system and software have become, and I'm ready to get caught up.