by Ed Deighton (c) 2024.
Megastructure is a domain specific language for game development that deeply integrates with C++ but enables many powerful features including:
-
A new way of meta programming using a compile time multi stage database to capture and analyse program semantics.
-
The ability to host the simulation in a "creative" mode that enables "live" programming and changing the program as it executes with very fast compilation.
-
A novel "Hypergraph" high level concept of bi-directional links between objects specified at compile time and integrated into Megastructure function calls.
-
The ability to easily bind the program to game engines i.e. Unity such that Megastructure can control the Unity scene graph.
-
A novel approach to developer workflow support based on change detector testing and providing HTML live reports about the program.
The Megastructure retail compiler generates vanilla C++ code that works anywhere C++ works and largely optimises away ALL overheads of the creative system to produce highly efficient production code.
The Megastructure creative system only works on linux and is implemented as a set of independent executables including:
- The root. Provides the persistent symbol table that ALL programs use.
- The Daemon. A per machine process that enables connecting up any number of machines into a Megastructure cluster.
- Build server. A simple job server that enables distributed compilation.
- Executor. A process that can actually execute Megastructure programs and be reprogrammed as it executes.
- Terminal. A utility command line tool that has many commands to control the entire Megastructure network.
- Plugin. A dll / shared object that enables game engine integration into the network.
- Tool. A simple node that enables easy integration of tests or other endpoints into the system.
Megastructure can be used to run a simulation on mass using unlimited compute power and replications of a simulation in order to train AI on a large scale.
The domain specific language of Megastructure provides many novel features for creative programming and game development including:
- Advanced state chart syntax.
- A compile time checked and extremely powerful event system.
- Compile time structural inheritance type system that completely integrates with C++ yet completely avoid compilation time overhead.
- Deep integration into C++ via a customisation of the Clang compiler that enables C++ member function calls on Megastructure objects to be translated into Megastructure invocations - a super powerful compile time form of polymorphic function call.
The language seemelessly integrates with C++ where C++ can be used to define Megastructure member functions and C++ type aliases and data types can be used within Megastructure objects.
Python is automatically supported and the entire system can be easily interactively controlled from python. Megastructure objects can be automatically used directly from python using the same Megastructure invocation system.
User defined types can be easily integrated with default and customisation point based C++ traits. Types can then be used as data members, function parameters and return types.
The underlying database technology for the compiler is complete and working and one can see from the HTML reports in the tests that advanced features of the language work.
The project is currently on hold. Example programs can be found in the "basic" repo.
If you are interested in Megastructure then please contact me at [email protected].
Info available on request.