spasm-myelixlabs

spasm-myelixlabs

Hey everyone,

I’ve been working on AEON RIFT, a tick-based multiplayer space strategy game built as an Elixir/Phoenix umbrella application.

A bit of context on the origin: my background is in risk, trading and finance, specifically building recurrent models that track behavioural shifts over time rather than relying on legacy static scorecards. When building AEON RIFT, I wanted to test whether that same decision-making architecture could run autonomous game commanders and show investors something they can relate to. Crucially, I wanted to build, run, and train the entire AI stack natively on BEAM without calling out to Python or external C bindings.

Here is a breakdown of how the engine works under the hood.

The Architecture: Macro Referee + Micro Specialists

Instead of a giant decision tree or hardcoded heuristic rules, each AI commander operates via two cooperating networks running in tension:

The Macro Layer Referee
A recurrent neural network (LSTM) that tracks roughly 60 macro features describing the long-term game state (galactic threat, combat heat across borders, resource velocity, overall fleet readiness).

It does not issue ship commands. Instead, every tick it outputs a softmax distribution over seven distinct behavioural models, deciding which mindset should carry the most weight based on the situation.

The Micro Layer Specialists
Feed-forward networks that receive a `StateEncoder` vector—a normalised snapshot of the commander’s current assets (resources, ship tiers, building levels, active covert operations, action points).

The specialist translates that snapshot into the discrete tick orders: queueing builds, adjusting research priorities, launching probes, or routing fleets.

The seven specialist archetypes range from heavy resource accumulation (Midas) and tech rushing (Athena) to aggressive raiding (Ares) and counter-striking (Nemesis). If an aggressive commander loses its strike fleet, the macro LSTM picks up the sudden dip in readiness and spike in border heat, gradually shifting tick weight over to economic and defensive specialists so the bot stabilises and rebuilds.

Training via Genetic Algorithms on the BEAM

One of the main experiments here was keeping the entire training pipeline in pure Elixir:

  • I tried Python, and honestly, I knew Elixir could do it better. I skipped external ML frameworks and GPUs. Training runs via a genetic algorithm that executes thousands of accelerated, headless game simulations in-process.

  • The simulations run across concurrent BEAM processes that read and write game states in ETS tables.

  • Fitness isn’t just net score; it’s a composite function tracking research velocity, plunder value, idle tick minimisation, and archetype-specific objectives (e.g., an aggressive archetype gets higher fitness weight for combat efficacy than infrastructure).

Because the inference and training logic are native Elixir, the bot networks run directly inside the game node with zero serialisation overhead or foreign function interface (FFI) latency.

Emergent Behaviors & Observations

Training via competitive simulation on the BEAM produced a few neat patterns we didn’t explicitly code:

  • AIs with overlapping target priorities learned to align their strike windows. One bot probes to drop a target’s shields, and another arrives on the subsequent tick while defensive grids are still cycling.

  • The referee has memory, bots don’t immediately suicide follow-up fleets into a meat grinder. When the LSTM’s hidden state registers sustained losses, the bot enters an economic holding pattern until local conditions improve and, in some cases, will pounce when you least expect it.

  • Specialists consistently identify and hit targets with depleted energy reserves or active fleet transits, optimising for engagement profitability rather than raw fleet size.

The Stack

  • Architecture: Phoenix Umbrella app (Elixir core game engine, AI training/inference, and the web/channel frontend).

  • Game mechanics: Tick-based, deterministic battle replays, team/galaxy play.

We are currently testing. I’m looking for fellow Elixir devs to join us and beta/stress-test the game and see how the AI holds up against human players, I can tell with just a few of us they are hard to beat.

The beta is free to play (solo or galaxy mode). If you’d like to help test or talk shop on the architecture, drop a reply here or shoot an email to hello at myelixlabs.com and I will send you a code and, for your efforts, honour you with a special EPOCH0 badge which tells players you helped form the game.

I’d love to get feedback on the engine and discuss how others are approaching native ML/genetic workflows in Elixir.

Full disclosure, we are not game developers; be gentle it’s an experiment that turned into an addictive hobby.

Check AEON RIFT out here: https://aeon-rift.com/

Where Next? Top

Trending in Announcing Top

achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
gtcode
Aloha gang, There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here: ...
New
danschultzer
I’ve moved the strategies out of PowAssent and created a multi-provider framework for Elixir. This way the strategies can be used in any ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
AstonJ
With advancements in AI gathering pace and set to increasingly accelerate, perhaps it’s worth having an annual thread on the topic - feel...
New
bartblast
If you haven’t tried Hologram yet, what’s stopped you? Here’s why I’m asking. Building a framework turns out to be two jobs, the framewo...
New
mat-hek
Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn: This is possible because it now builds on a very stab...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews