Skip to content
aviorstudioPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Emden

Emden is an entity component system written entirely in Goose. The caller owns each world and decides when to run its systems. The package uses the Goose standard library and runs in a terminal, a server, or a game host. Documentation

Use Emden

Install Goose v2026.4. Import Emden v0.0.1 in the entry file of your application.

import emden from "aviorstudio/emden@v0.0.1";

Define a schema with one typed store per component. Construct the world with a nonzero owner ID and an entity capacity. See the movement example for spawning a bundle, joining two stores, and updating a component.

API Use
store<T>, world<S>, reset Create bounded caller-owned storage and reuse it under a fresh world ID.
spawn, despawn, is_alive, entity_status Create, free, and validate world-local entity handles.
insert, read, replace, remove, has Work with fixed-size component values. Reads copy into a caller-owned variable.
query, join, next Walk one store or their intersection. Structural changes invalidate cursors.
select<Projection>, next Copy typed values from any set of stores into a projection. Match stores by field name and apply Presence.With and Presence.Without filters.
changes, next_change Read added, updated, and removed records from an optional bounded per-store history.
queue<T>, enqueue, dequeue, flush Buffer typed commands and collect FIFO outcomes at a phase boundary.

Integer owner IDs come from the caller. Pick a fresh ID for every world that could see handles from a previous world. Keep persistent or network identities in game data. Randomly indexed pools of variable-capacity worlds require a different layout from the caller-owned worlds in this package.

A spawn bundle checks entity and component capacities before writing. A command flush returns the result of each command and continues after an individual failure. If a whole game action needs atomic rejection, validate or stage it in game code. Keep component data in plain fixed-size Goose values and cross-component links in entity handles.

Enable change tracking with the third argument to store<T>. Take a snapshot, then create one change cursor per observed store. Read through Done on each sync. If a cursor reports ChangesLost or the world resets, rebuild the snapshot and subscribe again. Records identify entity generations and carry the kind of change. Read the current component value from its store.

Run the examples

mise trust
mise run setup
mise run example:movement
mise run example:grid
mise run example:replay
  • Movement steps a position and velocity join twice.
  • Grid skirmish is a playable turn-based terminal example. Enter l, r, u, d, strike, wait, or q.
  • The scripted replay runs seven turns and prints the outcome and a canonical view after each turn. The Godot adapter runs the same replay as a smoke test.

You can also use goose run examples/movement.goose or goose run examples/grid/cli.goose -- r strike.

Godot example

The optional adapter imports Emden and the same grid module used by the terminal. It reads engine input and draws the game view. Install CMake 3.22 or later, a C toolchain for GDExtension builds, Goose v2026.4, and Godot 4.7.2. Put goose and godot on PATH or pass their paths as GOOSE_EXECUTABLE and GODOT_EXECUTABLE.

From the Emden checkout, clone Godot Goose beside it and build the demo. On Windows, use an x64 Visual Studio generator, for example -G "Visual Studio 17 2022" -A x64.

git clone --branch v0.0.2 https://github.com/aviorstudio/godot-goose.git ../godot-goose
cmake -S examples/godot -B .build/godot -DGODOT_GOOSE_DIR="$(cd ../godot-goose && pwd)" -DCMAKE_BUILD_TYPE=Release
cmake --build .build/godot --config Release --parallel
godot --path .build/godot/emden_grid

Use the arrows to move the scout, Enter or Space to strike, and Escape to restart. The C compiler builds the existing Godot Goose adapter and the output of the Goose compiler for the optional GDExtension host. The Emden package and simulation source are Goose.

Develop Emden

mise trust
mise run setup
mise run check

mise run build type-checks the package and examples. mise run test exercises storage, queries, FIFO commands, a randomized reference model, the replay fixture, and a separate offline consumer. Run mise run bench for the direct-loop, checked-join, and churn baseline. For the optional host, use GODOT_GOOSE_DIR and GODOT_EXECUTABLE with mise run build:godot, then mise run test:godot to compare the native and headless replays.

The project is available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors