Kaos Engine

Development

I implemented this engine during my free time since I started programming. My friend Basil Fierz helped me with some subsystems like the user interface. Andreas Kägi, another friend, helped me with the implementation of support for the gcc compiler and the Direct Input subsystem.

Detailed Description

The kaos Engine is kind of a ‘Game Engine’. As most ‘Game Engines’ it is like a large collection of different libraries that are useful to create solutions for a lot of different problems. The kaos Engine consists of several parts. This section is meant to give a rough overview of all the components that make up the engine:

Technical Details

Feature List

Challenges

There are several problems I faced while writing the kaos Engine. First of all the term "Game Engine" is not clearly defined. It is more like a large collection of different classes for different problems. Therefore it looks much more like e.g. the Java API although it is of course significantly smaller. On the other hand it is a significant collection of source code and quite large. Therefore it needed careful design in order to prevent messing up the code and making it impossible to maintain. In fact this is the reason I named it kaos since one of the early approaches ended in a huge mess. In the end I think it is quite nice to have an engine with now nearly 300'000 lines of code while still keeping it modular and expandable.

Screenshots

A very old screenshot. I used to program using Visual C++ 6 these times...

Loading a .x model in 2004.

Loading a .x model in 2004.

Experiments with the SOAR algorithm in 2004.

Experiments with lighting algorithms using the Direct3D fixed function pipeline in 2005.

Loading an md3 model in 2005.

Loading an md5 model in 2005.

The RTS game in 2007.

Experiments with Nebula2 models in 2008.

Code Sample

The code sample is taken from the start application. The snippet I present instantiates a class and calls one of its methods. Both are determined using a configuration file.

//----------------------------------------------------------------------------- void run_application() { try { #if defined(START_FROM_ARGUMENTS) string_t starter_class = "/ktest/TestFramework"; string_t starter_methode = "Run"; get_argumentserver()->GetArgument("kaos_starter_class", starter_class); get_argumentserver()->GetArgument("kaos_starter_methode", starter_methode); LOG_WRITE_L1_4(LOGSEVERITY_INFO, "main", "main", "Calling ", starter_class, "::", starter_methode); ObjectPtr instance = get_metaserver()->New(starter_class); instance->MakeManaged(); if (instance.IsValid()) { SharedPtr instance_class = instance->GetClass(); SharedPtr methode_to_call = instance_class->GetMethod(starter_methode); if (methode_to_call.IsValid()) { CommandPtr command = methode_to_call->CreateCommand(); command->Reset(); methode_to_call->Call(instance, command); } else { LOG_WRITE_L1_3(LOGSEVERITY_ERROR, "kstart", "main", "methode '", starter_methode, "' not found!\n"); } } else { LOG_WRITE_L1_3(LOGSEVERITY_ERROR, "kstart", "main", "instanciating an object of type '", starter_class, "' failed!\n"); } #elif defined(START_SCRIPT) SharedPtr startfunction = get_metaserver()->GetFunction( KAOS_CSTRING("/scripts/kaos/startscript")); startfunction->Call(); #endif } catch (Exception& e) { LOG_WRITE_EXCEPTION_L1(LOGSEVERITY_ERROR, "main", "main", e); e.Handled(); } }