Game Engine Design
Introduction
Introduction to the introduction
I often see request on message boards, from newer programmers, asking how to design a game engine. The usual response is that game engines are very complex systems and that people should be making games rather than engines. That response is correct. If your goal is to create a game, create a game, don’t create an engine. Let me make one thing clear, creating a game engine will not save you time creating a game. It will save you time only if you creating many games (and maybe a couple game tools to go with them). Also, it is unlikely that you will use your first (or second and sometimes even third) game engine ever again. This is why building a game engine is considered by many to be a waste of time. I, however, find that it is no more a waste of time than writing your first “Hello World” program. Your first game engine will probably not be useful to you, but it’s an important step towards building something that is useful, and I am yet to find a programmer who would recommend that skip “Hello World”.
Goals of this tutorial
The final goal of this tutorial is not just to have a working game engine. The goal is to have a working game engine and not only know how it works, but why did you choose to make it work that way. To do that, I will be taking you step by step through the creation of a game engine, and explaining the reasoning behind each step. The final product will be a working game engine and a simple game that uses it. While the whole game engine may not be reusable large portions of it should, allowing for future development to go faster.
A couple technical details
The language I will be using for this game engine will be Java. I chose Java for several reasons:
Familiarity
I am familiar with the language and am comfortable programming with it. That is always an important thing to consider when creating any program. Rarely will, if ever, will you be able of doing something in one language that you couldn’t do in another, so it is best to pick a language that you know how to work with. However, with that said, some things are easier to do in different languages which brings me to my second reason.
Garbage collection
I am trying to create a game engine that is as simple as possible. Garbage collection is one of the most difficult things to get right, especially for a new programmer. By taking that out of the picture, creating the engine will go much faster and smoother.
Object oriented design
One of the best things you can do for a game engine is making it object oriented. Objects are an excellent tool to create abstraction, which really is the goal of a game engine. They also help to make your code more expandable and maintainable, two very important aspects of a game engine.
There are other reasons that I chose Java but those are the most important. The IDE I will use is Eclipse. JCreator Lite is also a good free Java IDE which I often use to quickly try something out, but it doesn’t quite have the organizational abilities of Eclipse. There are many other Java IDEs out there and I highly recommend you try a couple before you choose just one.
While my code will be written in Java, most of it should be easily be adaptable to other object oriented languages. I will try to keep the Java dependant things to a minimum as to not restrict your choice in languages.
Conclusion to the introduction
That is it for my introduction. The next section of this tutorial will be about designing the engine. Until next time.