Creating a game is like building a house –– the project requires a strong foundation to be successful. The house itself can have any appearance and be made for different purposes. But without a proper foundation, the house will not stand. Architects and contractors have the entire house planned out, but start out by setting the foundation. Games are frequently made in a similar style. Even though game designers have storyboards and goals planned out, the people actually coding the game start with the game engine, the game’s equivalent of a foundation.
The engine is always there, working behind the scenes throughout the entirety of the game. It performs the basic features, such as showing the game on the screen and making sure it closes properly. However, it also does most of the heavy lifting when it comes to the processing behind the game. It handles the speed by controlling how many frames of the game are updated every second. It keeps track of objects, colors, sounds, and input from the player. More complicated engines often have separate components to deal with in-game physics, such as simulating gravity, which affects players and projectiles.
Right now, I’m working on the game engine of my project. It currently handles the screen of the game itself, movement from keyboard input, and displaying images onto the screen. While working on the game engine took a lot of effort and code without too much instant gratification (no one is throwing around fireballs yet), it’s absolutely essential to the success of the game. While it can only receive WASD keys and translate it up-left-down-right respectively, input can later be expanded to include the entire keyboard and the mouse. Displaying images might seem like a rather primitive feature, but it will allow me to upload images of characters, backgrounds, effects, and objects in the future. The more basic features I add to the engine now, the more I can do with my game later. To refer back to the analogy I began with, the stronger I make the foundation of my house, the more spacious of a structure I can build.
Of course, there’s no point in clearing an entire forest in order to build a small hut. Coding a game engine eventually becomes incredibly tedious, as it’s purely language and any mistake in the language can cause the entire game to malfunction. This is why it’s important to have the game planned out, just like having the blueprint of the house completed. There’s no point in creating a complex physics engine if there’s no physics involved in the game. Keeping code clean and efficient is an entire skill of its own.
The game engine is something I can continuously build on, but balancing time between different stages of a project is important too. I’m ready to get started on the meat of my game with my skeleton almost completed.
Words by Kelvin Pan
Animations done in Adobe Flash