A game engine dedicated to making generative content easier to make.
The database.
It has a simple, in memory ontology. There are three classes. Edges, Nodes, and "the ontology". Each node has a list of corosponding edges. Each edge names the nodes it conjoins, and the ontology stores both the nodes and edges. They can print themselves into a json file (not coincedtally of the exact same structure sigma.js requires.)
The TCP server. In the main function, we create an ontology and load in a few edges/nodes. We than spawn a new thread that listens for a TCP connection. Upon receiving ANY message over that connection, it dumps the while ontology in json format. The second thread is spawned, because when listening for a TCP connection, the program is rendered interminable. By putting it onto another thread, we can kill the main thread via ctrl+c, and it will bring the background thread down with it.
The Visualizer.
On startup, we connect to the database once and get the json dump. We store it in a global variable.
We start a web server and sever out of the static_files folder. If we are asked for data.json, we swoop in and send out the database json instead.
The Website.