bit_gossip
Pathfinding library for calculating all node pairs' shortest paths in an unweighted undirected graph.
An MMO game written in Erlang + PostgreSQL (+ Omnigres) + Zig (+ Raylib), powered by a Nix-based devenv
git clone https://github.com/Dr-Nekoma/lyceum.gitDr-Nekoma/lyceumThis is Lyceum — an MMO game with the server written in Erlang and the client written in Zig (supercharged with raylib and Zerl).
| Year | Language | Description | Link |
|---|---|---|---|
| 2024 | 🇺🇸 | A demo of version 0.1.0 was featured on Func Prog Sweden 2024, as part of a talk on Zerl | Zerl: Making Zig in the BEAM an ez time |
| 2025 | 🇧🇷 | Explains how our Erlang backend and Nix/NixOS environment works, from Gambiconf 2025 | Criando um MMO RPG com Erlang, PostgreSQL, Zig, Nix e gambiarra |
There are several ways to run this project, but they all leverage Nix. We have a single devenv configured, that has all the tooling required to run this project, it also includes postgres.
To enter a development shell we assume you have at least Nix installed:
# To enter the developmet shell nix develop --impure # To spawn postgres (for instance) devenv up -d
For more commands, make sure to check just.
# Will list all commands we have right now just
to migrate the local dababase, you can use just db-up or db-up.
You can also build the server and related OCI images with Nix.
nix build .#server
if you prefer running a container for the server:
nix build .#buildImage docker load < ./result docker container run --network=host lyceum:latest
or if you want to build the zig client, run nix build .#client.
To run our DEMO you need to follow the steps in this particular order:
nix develop --impure (to enter a development shell)devenv up to launch a local postgreserlang backend in a separate shell with either:
server
# or
just server
# or if you want a pure build
nix build .#server
./result/bin/lyceum foreground
zig client in a third shell with either:
client-release
# or
just client-release
# or if you prefer a pure build
nix build .#client
./result/bin/lyceum-client
Addendum: We got reports that (sometimes) non-NixOS users will have to rely on nixGL. Make sure you run nix build .#client beforehand.
nix run --impure github:nix-community/nixGL -- ./result/bin/lyceum-client
localhost and you can try
playing with any of the local credentials here.pgoPostgreSQL access goes through pgo connection pools owned by the
database OTP application. Three named pools cover the privilege boundary
between subsystems:
| Pool | Role env vars | Used by |
|---|---|---|
lyceum_pool | PGUSER / PGPASSWORD (application) | player, character, map |
auth_pool | PG_AUTH_USER / PG_AUTH_PASSWORD | simple_auth, registry |
mnesia_pool | PG_MNESIA_USER / PG_MNESIA_PASSWORD | reserved for cache |
Pool sizes are tunable from server/config/sys.config under the database
application’s pools env. The pools are started by database_sup at boot,
before auth, player, cache, or world start, so queries never race the
pool startup.
Every query goes through database:query/2,3 and database:transaction/2;
modules pass the pool atom rather than a connection. There are no per-session
PostgreSQL connections: the number of backends to Postgres is bounded by
pool_size regardless of player count.
migraterl is still hardcoded against epgsql, so world:init/1 opens a
single short-lived epgsql connection (PG_MIGRATERL_USER /
PG_MIGRATERL_PASSWORD), runs migrations through migraterl:migrate/3, and
closes it via database:close_migrator_connection/1. This is the only
epgsql call site that survives in our code; everything else runs through
pgo.
This game is deployed in our NixOS server.
At the dawn, a solitary tower rose at the very heart of creation. Its heights soared beyond measure, each stone wrought by the hand of Adraman. Within its lofty chambers, knights slumbered in homage to their lord, their dreams steeped in profound reverence, each to an ultimate idea.
With time, some knights, restless and wide awake amidst the collective slumber, were drawn by the haunting whispers of the wind. Captivated by the unseen melodies that danced upon the breeze, he cast himself from the tower’s precipice. As he plummeted, his trumpet echoed through the realms, a clarion call that shattered the tranquility of ages past.
The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening. With swords unsheathed and hearts ablaze, they clashed in a thunderous symphony of war, each seeking to claim dominance over the waking realm. Now at each strike, the meanings of such ideas changed; losing the ideas with time.
In the aftermath of countless battles, only one knight remained standing amidst the echoes of strife. His valor and defiance marked him as both hero and pariah, banished to the realm of the lowly ones where he ascended to rule over the twin cities of Tlova.
To reclaim the lost harmony and seek redemption in Adraman’s eyes, the Lyceum arose — a monumental testament to humanity’s quest to bridge the chasm between the heavenly mind and the mortal libraries.
Now far from the tower, a new era dawns as humanity’s torch flickers into darkness, its once radiant light dimming against the encroaching shadow of over their minds! With trepidation etched upon their faces, barbarian tribes lay claim to the northern realms, and their conquests marking a steady advance southward. Meanwhile, corruption festers within the cities’ beating heart, severing its ancient ties to the source of all truth.
In the fading twilight of their former glory, the heavens whisper of impending change, and the lands tremble beneath the weight of uncertainty. As the cities now struggle to stem the tide of internal decay and external aggression, the balance of power shifts perilously, casting doubt upon the fate of civilizations wrought by the hands of gods and men alike. It is your duty, oh great Philosopher, to mend the meanings and bring us all closer to truth once again.
References for assets used in this project:
Special thanks to Tholgrimar for allowing us to use ”Linear B” as our background music.
Everything else was made by developers from the project or generated using tools.
more like this
Pathfinding library for calculating all node pairs' shortest paths in an unweighted undirected graph.
search projects, people, and tags