← All experiments
Notebook / game-engine · raylib · cpp · graphics · tooling · game-development · systems-programming

Skerry Engine / Building a 2D Game Engine

An experimental 2D game engine built with C++20 and raylib. Exploring scene management, entity-component architecture, pixel-art rendering, visual tooling, and multi-language gameplay scripting.

A lightweight 2D game engine experiment built on raylib and modern C++.

Skerry is an exploration into what it takes to build a game engine from the ground up—not by reinventing graphics APIs, but by building the architecture and tools that turn a rendering library into a productive game development environment.

The project began with a practical question: how much of a game engine can be built around raylib while preserving its simplicity, performance, and direct control?

The Idea

raylib provides the foundations for rendering, audio, input, and window management. Skerry aims to build the missing layers around those capabilities.

The intended result is a lightweight, editor-driven 2D engine suitable for pixel-art games, RPGs, simulations, and other sprite-based experiences.

The engine is designed as a standalone project, independent of any particular game.

Architecture

The proposed architecture separates the runtime, editor, scripting interfaces, and game projects.

  • Engine Runtime: Application lifecycle, rendering, resources, input, audio, and timing.
  • Scene System: Entities, components, transforms, serialization, and scene transitions.
  • 2D Renderer: Sprite rendering, cameras, tilemaps, animation, and layering.
  • Physics: Collision detection, triggers, and optional rigid-body simulation.
  • Visual Editor: Scene hierarchy, inspector, viewport, asset browser, and animation tools.
  • Scripting Layer: Gameplay behavior exposed through a consistent engine API.
  • Project System: Asset organization, configuration, building, and packaging.

A key architectural goal is keeping the editor separate from the runtime, so games do not depend on editor-specific code.

Multi-Language Scripting

One of the areas I want to investigate is supporting several gameplay languages without coupling engine internals to any particular runtime.

The proposed language support includes:

| Language | Integration strategy | |---|---| | C++ | Native gameplay modules | | C | Stable C ABI | | C# | Embedded .NET runtime | | Java | JVM integration through JNI |

The preferred design is one primary gameplay language per project, with optional language-specific plugins.

This avoids making every project responsible for multiple runtime environments while leaving room for extensibility.

A stable C-compatible boundary would provide the foundation for language bindings, entity handles, component access, and lifecycle callbacks.

Editor and Developer Experience

The long-term goal is an integrated visual editor where developers can assemble scenes without manually writing rendering and entity setup code.

The envisioned workflow includes importing sprite sheets, arranging entities, configuring animation states, defining collision regions, attaching gameplay scripts, and running the scene directly from the editor.

The editor is planned around Dear ImGui, with raylib handling the underlying rendering and application window.

Technical Direction

  • Language: C++20
  • Foundation: raylib
  • Build system: CMake
  • Editor UI: Dear ImGui / rlImGui
  • Entity architecture: EnTT or a custom component registry
  • Physics: Custom collision layer, with Box2D considered for advanced physics
  • Serialization: JSON
  • Scripting: Native C/C++ first, followed by managed language integration
  • Initial platform: Windows
  • Initial scope: 2D only

These are architectural choices under evaluation rather than a completed implementation.

Development Milestones

01 — Runtime Foundation

Establish the application loop, rendering context, input system, resource ownership, camera handling, and fixed-step simulation.

02 — Scenes and Entities

Introduce reusable entities, components, scene serialization, and a structured scene lifecycle.

03 — Visual Editor

Build an editor viewport, hierarchy panel, property inspector, and asset browser.

04 — Pixel-Art Workflow

Add sprite-sheet import, animation playback, tilemap integration, and animation state machines.

05 — Gameplay Scripting

Implement native gameplay modules and a stable engine API before experimenting with C# and Java integration.

06 — Game Export

Allow projects to be compiled and distributed independently of the editor.

What Makes This Interesting?

The objective isn't to compete with Godot or Unity.

It's to understand the engineering decisions behind game engines: how scenes own entities, how resources are loaded and released, how editors communicate with runtimes, and how multiple programming languages can safely interact with native systems.

Skerry is as much a systems-programming experiment as it is a game-development tool.

Current Status

Status: Concept and architecture exploration.

The immediate target is a small working prototype: create a scene, import a character sprite sheet, configure animations, and control the character in a playable 2D environment.

Future progress will be documented through implementation milestones, experiments, and technical findings.