Old Engines and Lessons Learned
The year was 2005, and having just finished high school and started my computer engineering degree I decided I was ready to start writing my own engine. I wont say it was a big mistake or a waste of time, as attempting to write your own game engine is almost a right of passage for aspiring indie developers, but I will say when I started that I had very lofty expectations and vastly underestimated the total amount of work involved. All things considered I am still proud of what I accomplished on the project and so I thought I’d share the fruits of my labors here. May I present my engine, appropriately named “Alpha”.
The engine uses an OpenGL fixed function pipeline and generates a heightmap and texture map from two .bmp files. Most of the information I needed to build this engine came from the wonderful NeHe tutorials, which are now fairly outdated since the adoption of shader languages. One of the more involved features was the introduction of texture blending when transitioning between two different heightmap textures, pictured below.
In order for texture blending to work properly, the triangles for the heightmap had to be drawn in a logical and predictable order to allow the alpha weights to be set properly. This resulted in long tedious hours in front of a whiteboard planning out how each triangle in a square will map its texture and while the end result was very satisfying and rewarding, the small graphical improvement vs effort required to attain it sapped my motivation. I slowly came to the realization of how incomplete this engine really is. It still needs collision detection, a simulation system (update/ticks), a way to load in models and animate them, and networking just for starters. It was at this point I began looking at other engines.
What went right. While being a far cry from a complete engine this project helped me appreciate the vast amount of effort involved in writing an engine and help alleviate my fears about using engines written by others. I like a lot of indie developers start with a naive sense pride that needs to be smashed down at some point before the real work can begin.
It also didn’t hurt to learn about the OpenGL pipeline, gain some experience with heightmaps and graphics programming, as well as much needed C/C++ experience. Over all I believe this project was a success despite its unrealized and unrealistic goals.
Here is the source code and executable for Alpha if you’re curious and wish to play around with it. I provide it here no strings attached for education purposes. Feel free to extend it or even use it if you’re so bold.
Happy Coding 🙂
Leave a Reply
You must be logged in to post a comment.