SDL:Tutorials:Complete 2D Engine Overview

From GPWiki
Jump to: navigation, search

A brief look at a game engine

What is a game engine?

Simply put, a game engine is a set of systems that simplify commonly used functions in a game. An engine has subsystems which control defined parts of the common game functions. Most games have the following subsystems:

Some games have more subsystems depending on their needs. An example of another common subsystem is networking. Basically anything that can be grouped in a category can become a subsystem.

Why use a game engine?

  • A game engine can (and usually does) simplify game development. Instead of calling countless library API calls to do a simple task such as drawing an image you can use an engine that does everything for you with a single call.
  • A game engine can make your game more portable. If designed right a game engine can simplify porting a game to another library or even another platform. If you were to use just straight library calls then you would have to go back and change every part of your game and possibly have to rework the structure of the game. On the other hand if you had to port a game engine you could just port the subsystems and this makes your life simpler.
  • A game engine provides organization and manageable code. Far too many times have I worked on a project and I feel I have reached a point were adding a feature would make my game seem unmanageable. A game engine should help you manage your code and give you structure.
  • A game engine helps you work abstractly and not have to deal with the low down details of how things work. When writing a game you don't want to worry about remembering how to setup everything perfectly and make sure you don't have errors in your code. By using a game engine all you have to know is how to use the engine, which is usually simpler and a higher level of thinking.

What do I plan to cover?

With all that said you can see why a game engine can be useful. I plan to cover designing a game 2D engine from start to finish (the details of my work so far are in the links above). I will be using SDL for input, sound, and window initialization; OpenGL for graphics; and C++ as the language of choice. Granted that this does not suit everyone's taste for API and language, the things I talk about can be applied to any language and I will try to make it as language-agnostic as possible for the others that follow along.

Note

If at anytime you get lost in the tutorials due to lack of source code you can get the full source code here.



This tutorial was written by Seoushi. Do you like this tutorial? Have any questions or comments? Let me know or you can ask the forums.