A custom game engine editor
Disclaimer: This project is not active anymore. The systems are currently being reworked and put into the new Borealis Engine project. Until everything is finally moved to the new project, the CreativeChaosEngine project will stay available here. Note that this code might not be representative of my latest work!
The editor currently acts as a client that uses the engine and its subsystems by calling the DLL. The CCEditor provides a way of initializing the engines RuntimeManager and updating the GUI.
EditorWindows are windows created by ImGui inside the ClientWindow. They can be created by initializing a new EditorWindow before the editor loop starts. This will register the window and will call it's OnGui() method.
Some custom game engine subsystems
A common class to derive every manager class from. Holds pure virtual functions for StartUp() and ShutDown().
The InputManager manages all engine inputs. Currently detected inputs are:
- Mouse and Keyboard
- Up to 4 XInput Devices
- Up to 4 DualSense Devices (WIP)
- Up to 4 DirectInput Devices
The JobManager handles the creation, maintenance and destruction of the internal job system.
Jobs can be created by using JobManager::Declarations. They get a bound JobManager::EntryPoint, a Priority and the Arguments for the call.
The declarations are then queried by calling JobManager::KickJob which will automatically queue the job for execution and run it whenever the resources are available. To manage race conditions and concurrent resource management use JobManager::WaitForCounter. This will busy wait for end of execution.
Currently only void return types are supported. Values can be handed over as pointers to manipulate local objects.
The MemoryManager holds different custom memory allocators which can be used to allocate memory for subsytem resources. The memory allocators support non-aligned and aligned memory allocation calls. Use the respective AllocAligned() functions for that.
The pool allocator creates a pool of equally sized memory chunks.
The stack allocator creates a stack of specified size and can push memory chunks onto it.
To be created.
The ProfilingManager is a debug facility that allows to inspect detailed information about the engine. Currently the engine can be opened up and run for a while. When it is closed there is an automatic leak detection. It shows which classes are created more often than they are destroyed. Use the REGISTER_LEAK_DETECT and UNREGISTER_LEAK_DETECT in the constructor and destructor to include them in the leak detection.
The RuntimeManager is the bootstrapping unit on the engine side. It initializes all subsystems in the correct order and provides an interface to the engine's update loop.
In CCE, strings are implemented via a String-Handle. This is a CRC hashed value of the string value which is then saved into a global handle table. When calling a CCE::Strings myString.Value() function, the actual char* is returned. Adding a new string is therefore not that much more efficent while comparing, reusing or transfering Strings is significantly improved in terms of performance.
Since the String object containes the hanlde to the char pointer, the underlying StringMemory system can relocate and therefore defragmentize the maintained memory. This is currently done whenever a string object is destroyed. In order to do this relaibly and not to soon, a reference count is saved with the handle and the char pointer.
The goal is to create a string system that uses IDs everywhere. In the best case, all strings can be loaded or written during compiletime and don't need to be created at all after release.
Performant:
- Creating new string objects of strings that already exist
- Copying / Moving / Assigning / Comparing Strings
Inperformant:
- Destroying the last reference of a string (defragmentizing the whole memory)
Fortunaltely, because temporary strings are destroyed quickly and the memory is defragmentized immediately this system doesn't seem to consume too much memory.
Create a window by calling the ClientWindow::OpenWindow(hInstance, "MyWindowName") function. After that make sure to call ClientWindow::UpdateWindow() to initialize the message handling. When closing a window use ClientWindow:CloseEditorWindow().
Multiple windows are currently not supported.
Utilities currently include:
- Custom color description and parser
- Spin locks for use by the job system
- Custom math functions (e.g. 64 bit CRC-Hash)
- Custom event wrapper
- Basic I/O
- Basic JSON serialization interface (binary WIP)
- ImGui
- DS5W SDK
- JSON Parser | Part of JSON Parser is Google Abseil
- Fork Awesome
- FreeImage