KlaxEngine was the result of my bachelor thesis. The goal was to create a game engine including an editor application with which the user would be able to quickly script the logic for small game prototypes.
The engine is written in C# and features a DirectX-based 3D renderer which supports shadows, a third party physics system, an asset manager, levels, a visual scripting language and an editor to access it all. The editor application is written using the WPF framework.
Development time: 4 months (October 2018-January 2019)
Roles: Programming, Editor Visual Design
The engine was written in close collaboration with Henning Ax
You can download the project here: Github Repository
Motivation & Editor
Since this project was part of a bachelor thesis, we had to pick our battles when it came to scope.
We definitely wanted to implement a scripting language of some sorts and initially we still planned this language to be an implementation of LUA. During development it became apparent though that a visual scripting language in the style of Unreal Engine's Blueprints or CryEngine's Schematyc would be a more appropriate (and admittedly more exciting) solution.
During our internship at Envision Entertainment where we were both working as tools programmer, we learned how to utilize the WPF framework for applications. While the decision to use this framework for the engine editor limited us to the Windows operating system, we still had to pick our battles and came to the conclusion that Windows is the primary game development platform anyway. That way we did not have to invest time into learning another cross-platform framework like Qt and could focus more on the actual content of the engine and editor.
Visual Scripting - KlaxScript
The most polished part of the engine was our own visual scripting system called KlaxScript. It was heavily inspired by Unreal Engine's Blueprints and Crytek's counterpart Schematyc. It allows the creation of game logic without recompilation and is entirely data-driven. The included features are:
There are two modes in which KlaxScript can execute node graphs.
The first one is used while working and playing in the editor and makes use of reflection to invoke the native C# functions behind nodes.
The second mode parses the exposed functions and variables once in the beginning of the game's lifetime and generates a new .NET IL assembly. When invoking a node, that node in turn invokes a delegate pointing to a wrapper function in that newly generated assembly and avoids the performance overhead of the reflection system. Generating the assembly takes only a few milliseconds and results in a 4 times higher execution speed.
In addition to that KlaxScript acts as the engines' prefab system. KlaxScript entities can be instantiated within a level by simply dragging them from the asset browser into the viewport.