GameCode++

Home


Introduction

This is the design document for the GameCode++ game library. This purpose of this document is to lay out the goals for the GameCode++ project as well as describe the design structure of the library.

GameCode++ is an open source C++ library designed to help programmers more easily and quickly develop 2D games. The library is to be made as general as possible, such that any genre of game can be easily and efficiently programmed using the library. The GameCode++ library will be written to be compiled with the GCC C++ compiler, however given the appropriate libraries it should be possible to compile GameCode++ games using any ANSII compliant C++ compiler. To start with, GameCode++ will run on Windows only. A long term goal will be to be able to port GameCode++ to Linux and OSX, and from the start portability will be a design requirement.

The main target audience of GameCode++ will be programmers with limited to moderate C++ programming experience. The library should be make it simple for this group to develop games of simple to moderate complexity. Essentially it would be library that is one step up from the GameMaker Game Engine in terms of ability and complexity. GameMaker is a great starting point for programmers because it allows them to get an idea of how a computer thinks without having to learn a complex language. This engine would be designed for the GameMaker programmer that wants to expand their programming abilities to a more general purpose language, while remaining in a similar genre of program. Another related audience that GameCode++ will target is programming teachers that want to teach C++ through game programming. GameCode++ will in some ways be an educational game library in that it will help inexperienced programmers expand their knowledge and abilities.

The first goal of GameCode++ will be to develop a working game library. This library will be able to be compiled with GCC using any editor or IDE (Integrated Development Environment). However, GameCode++ will not have its own IDE. Eventually, it would be desirable to have an IDE specifically designed for GameCode++ that would incorporate features that make GameCode++ easier to use, However, this is not the main focus of the GameCode++ project.

System Overview

GameCode++ is an open source C++ game library. It will provide all the necessary classes to easily program any 2D computer game. The design of GameCode++ is based partially on how the Gamemaker game engine, with Rooms and Sprites. In GameCode++, there are three main classes, the Game Application class, the Game Scene class, and the Game Object class. Game Scenes are kind of like rooms in Gamemaker, they are a way of completely breaking up separate parts of the game. The Game Scene class is not designed to be used it's self, but instead inherited by a custom class that describes what the scene. Game Objects are similar to Sprites in Gamemaker, except that a Game Object is a base class for other classes such as Sprites, Backgrounds, and Components. A Game Application is the class that manages the game program's interactions with the operating system, as well as managing the scenes and switching between scenes.

A typical game would be organized something like this: in the main.cpp file, a new Game Application object will be created. Then, a number of classes that inherit from Game Scene will be added to this Application, and the start function will be called on the Application. Within each of the scene classes numerous classes that inherit from Game Object, including backgrounds, sprites and controls. All of these classes can either be used as is, by instantiating instances of the class, or extended by inheriting the class into new classes. Extra canned functionality (such as path following) will be able to be added to a Game Sprite through Plugins that can be plugged in through a standard interface class.

Design Considerations

Assumptions and Dependencies

GameCode++ will only have a few dependencies. One of these is a library called [http://sigslot.sourceforge.net SigSlot], that will give GameCode++ a signal/slot functionality similar to QT. The signal/slot design is very useful in graphical programming to ensure a modular object oriented approach.

Another possible dependency that GameCode++ may have is the [http://www.opengl.org OpenGL] accelerated graphics library. GameCode++ will be designed to be able to support different rendering engines. By default GameCode++ will use the operating system default, however, it would be desirable to have OpenGL as a rendering option.

Finally, GameCode++ is going to need a sound library. Research still needs to be done on available sound libraries, and a decision needs to be made on the final library to be used.

To start with GameCode++ will be compatible only with Windows. Eventually, however, it is a long term goal to be able to compile GameCode++ for Linux and OSX as well. From the start, GameCode++ will be designed with portability in mind, by abstracting out the operating system specific parts of the library, such that from the users perspective the operating system does not matter.

General Constraints

Goals and Guidelines

Development Methods

Architectural Strategies

System Architecture

Policies and Tactics

Detailed System Design