What is SIEGE? The name stands for “Simple Interplatform Entity Game Engine”. It is a BSD-licensed game engine developed in C99 with simplicity, portability and modularity in mind; bindings exist or are in development for C++, D and Python (specifically, CPython).
The name “SIEGE” itself summarizes several aspects and features of the engine:
- Simplicity — The engine aims to be simple to use, and yet still tries to avoid the “one size fits all” approach. For example, image and audio loading is included in SIEGE, but there is nothing which would specifically aim SIEGE at, say, RTS games — one can create any type of a 2D game in SIEGE; a simplified interface for network communication is being designed.
- It is cross-platform — SIEGE has been confirmed to compile and run on Windows, Linux, FreeBSD and OS X. We are always looking to expand to other OSes, so if you want to see SIEGE on an OS of your choice, let us know! Note that we are limited in the number of OSes we can support without your help — for example, OS X cannot be supported if we don’t have anyone with a Mac (luckily, we do have someone, and we do support OS X).
- Entity-based — Entity (or SGEntity) is the core game object in SIEGE, and everything revolves around them — entities take place of some form of a “glue” — they bind together audio, physics, sprites, et cetera… Nevertheless, SIEGE remains flexible — for example, the main loop can be written with a simple “sgRun()” call to let SIEGE handle the details (such as framebuffer swapping), or a user-provided loop can be used via “while(sgLoop(&retval)) { … }”
- Game engine — SIEGE is primarily a game engine, though it should be noted that, despite it being aimed towards games, it is still (at least in our humble opinion) a good platform for non-game related work.
SIEGE’s design is modular — that means that much (if not most) of its functionality is found in modules, which can be selected at runtime as they are dynamically linked; for example, if one is not satisfied with the SDL module for window/input handling, the GLFW module can instead be selected at runtime.
Here are things that SIEGE is currently capable of (note: features which are not yet in, but are being worked on are marked with *****):
- Window and input handling
- Graphics + image loading
- Audio + audio loading
- Font handling/text printing with support for char, wchar_t, UTF-8, UTF-16 and UTF-32
- Pathfinding (a generic, node-based A* implementation, plus a wrapper for simplified grid-based pathfinding — some other schemes for pathfinding like navmeshes are planned)
- Physics engine
- Lighting with 2D dynamic shadows
- Ingame console (* work in progress, found in the “console” branch)
- Networking (* an API is being designed; there is not much code yet, except for a quick semi-working test in the “net” branch)
- Boids (* to be done)
- Fuzzy logic, genetic algorithms, artificial neural networks (* work in progress)
It should be noted that SIEGE is still in development and is not stable yet; nevertheless, we attempt to eliminate bugs or other problems as soon as they are found. Furthermore, documentation is currently lacking, but we are working hard to fix that problem.
So, where to find the code? Currently, the best place for that would be the Git repository at GitHub: http://github.com/SIEGE/siege. CMake and a decent compiler (see below) will be required to build it, plus dependencies. The core itself merely requires libc, libm and (in some OSes) libdl and librt. In order to build all the modules (and thus try all the examples), the following are required: SDL or GLFW, OpenGL, OpenAL, DevIL, libsndfile, FreeType, iconv (may be removed in the future) and Chipmunk — note, however, that not all modules are required — at minimum, only either SDL or GLFW is required, plus OpenGL.
SIEGE was tested to compile and run with the following combinations — please note that newer versions may be broken due to changes in code (if so, let us know so that we can fix it!):
- MinGW32 on Windows XP (32-bit) and Windows 7 (64-bit) — note that both builds were 32-bit themselves
- GCC on 32-bit and 64-bit Linux, OS X (x86, not PPC) and 64-bit FreeBSD
- Clang on 64-bit Linux and 64-bit FreeBSD
The following are yet to be tested, and we’re looking for volunteers:
- Clang on 32-bit Linux and OS X
- 64-bit version of MinGW on Windows
- MSVC compiler (both 32-bit and 64-bit versions have yet to be tested)
- … any other compiler you can think of (come help us test it!)
Finally, how does SIEGE’s API look like anyways? Here is a small example of a minimal SIEGE application in C:
#include <siege/siege.h>
int main(void)
{
sgLoadModules(2, "SDL", "OpenGL");
sgInit(0);
sgWindowOpen(640, 480, 32, 0);
SGint ret = sgRun();
sgDeinit();
return ret;
}
…and that’s about it. As previously stated, a custom main loop can be used by using while(sgLoop(&ret))
instead of sgRun()
, but the basic use is as above.