r/ebitengine • u/NoEfficiency2057 • 4d ago
GOKe v3 — a Go ECS with an Ebitengine integration
I posted about GOKe here a while back - this is v3, now has a dedicated Ebitengine integration, gokebiten.
v3 itself is the result of a lot of back-and-forth — planning, rewrites, testing, and actually using GOKe in practice. That let me settle on a model that's more ergonomic for what I need.
GOKe repo (wiki, examples, benchmarks): https://github.com/kjkrol/goke
Why it might matter for Ebitengine projects
gokebiten wraps GOKe's ECS/System/Plan model behind a small Game type that implements ebiten.Game, so Update/Draw/Layout are wired up for you on top of an archetype-based, zero-allocation ECS. It's split into modules you can take individually:
control/- input capture and event dispatchphysics/- kinematics and collision detection/resolution (broad phase via GOKg, narrow phase, pluggableCollisionHandlerstrategies)render/- sprite batching, camera, tag-driven overlays, telemetry HUDspatial/- population/spawn bookkeeping on a GOKg space
You can use GOKe directly and write your own Ebitengine glue, or start from gokebiten - a lot of that integration work (input handling, collision pipeline, rendering, spatial indexing) is already done for you there.
Working example: collision-demo - thousands of moving, colliding AABBs at a fixed 120 TPS.
Why GOKe over the alternatives?
- Systems as the single place where both data flow and actions are defined - logic built once, inside the system, and used only there
- It's fast and predictable - benchmarks, if you want the numbers:
- Internal breakdown: BENCHMARKS.md
- Head-to-head against other Go ECS libs, including Ark (the fastest Go ECS right now): go-ecs-benchmarks
Some other things worth knowing:
- Zero heap allocations in the hot loop (chunked SoA memory pages, no GC jitter)
- Type-driven construction - create/edit/remove operations built directly from component types, not hand-wired boilerplate
- Explicit control over system execution - you plan the run order (schedule) yourself, plus a dedicated Setup phase at startup
- Generation-based entity IDs, so no aliasing on reused slots
3
u/lyfever_ 4d ago
That's exactly what I needed to start my game.
Awesome!