Endian

Project Links
Github: Endian Engine
Github: Endian Base Mod

Endian is my current project, and is larger than anything I've made before.

Endian is a socially- and economically-driven text based MMORPG. It is programmed in C and handles interactions via a Discord bot.

The gameplay and philosophy is very similar to that of Adriencoin, except that the economical restrictions try to be more emergent rather than stricly enforced. Also, it's space themed!

Mod-Based Engine

The reason that it's taking so long to make is that I am putting a lot of effort into making a mod-based engine. I have some PTSD from trying to add content to Adriencoin because the game was held together with duct tape.

To avoid that, I am implementing what I call the Hytale philosophy. This means that everything in the game is a mod and that nothing is hard coded. Not because I expect others to mod my game, but because I want to be able to add new content with ease. This could also be referred to as dogfooding.

Static Code Generation

One system which I am especially happy with is the static code generation (which I also call compile time reflection, even though it's not really reflection in a typical sense).

I got the inspiration for this from Concord, the library I use to run the Discord bot.

Lucas Muller, the maintainer of Concord, also made a library called Reflect-C, which he uses in Concord. This library takes "recipe" files, which are formatted for easy parsing, as input, and generates proper C code that can then be compiled.

The main takeaway here is that the library uses a seperate executable that must be ran before the compiler can work.

I believe that Muller did this mostly to keep the code DRY (don't repeat yourself). This was one of my motives, but I also did it to make the development process easier and to make the game run faster.

Previously, all mod files would be in JSON, and they would have to parsed at startup (using my Registry.c library). This worked great, but the problem was the game didn't know anything at compile time. This was even worse when loading shared objects (C code compiled into a file that can be loaded and ran at runtime), because everything had to be degraded into a function pointer.

This means that the compiler could make no optimizations. When I tested the difference between optimized function calls and function pointers, the pointers were about half as fast.

But with my static code generation, I can have the benefits of modular and independent systems with the benefits of compiler optimizations. Very fun stuff!