Thursday, April 2, 2009

Mazes Plus (the plus is for buttons)


I'm planning on making a program roughly based on Logic Quest 3d. In the game, you travel around mazes in first person. There also buttons that you can push to open and close doors. For example, you may need to open a door to be able to pass through the area, so you go to find its switch, but when you hit it, the place you are in is closed, so you have to go find a second switch to open up that door.

I made a simple drawing in The GIMP to show what the first level might look like. I'm not sure what kind of HUD I'm going to use in it, if any.

I'm considering using procedural generation to make the graphics. Procedural generation where the computer generates the graphics (in this, the images put on top of the geometry, called texture maps). For example, to generate the brick walls, first the computer would start with a blank red image. Then it will draw white horizontal lines across the entire image. The it will add shorter vertical lines between each of them. Finally it will randomly generate some noise to add realism. I followed the same algorithm to make the brick images used in the example shown above.

Procedural generation has several advantages over traditional art. The biggest one is that an image may take several megabites of size if it is big, where as a procedurally generated image only takes a few lines of code. Another advantage of procedurally generated imagry is that by adding some random variables, each image can be slightly different. This is useful if I would want to make an entire forest of procedurally generated trees. Normally, I would have to make many different models of trees, so they do not all look the same. However with procedural generation, all I would have to do is write code for a tree once, then I could let the computer make every tree in the forest unique!

Procedural generation does have some downsides. Mainly it takes alot more computing power to redraw these images every time the program loades instead of just loading it from a file. Also, one has to be careful to make it look realilistic. For the example image above, I decided to quickly come up with an algorithm for drawing the ground, and it doesn't look too good. For the actual game, I will have to come up with a new algorithm that looks better.

I can't say exactly when this project's going to come to fruition, I have a couple other projects I'm also working on, and theres only so much time once can program each day!

No comments: