🏖️ Small C99 2D game engine with a focus on prototyping.
Go to file
Dominik Madarász 2d593809d7 move queries 2024-05-29 17:50:42 +02:00
.github/workflows Create web-build.yml 2022-10-17 20:23:56 +02:00
art move queries 2024-05-29 17:50:42 +02:00
cmake ecs: rework crafting to tick-based process 2023-01-14 10:24:57 +01:00
code move queries 2024-05-29 17:50:42 +02:00
docs small remark on ent streaming 2021-05-08 15:08:05 +02:00
tools adapt 2D view on window resolution changes 2021-11-29 09:23:08 +01:00
web fix long-standing web build time related bug 2023-07-25 21:23:41 +02:00
win rename prj 2023-07-26 19:08:34 +02:00
.editorconfig code: added base 2021-01-10 18:42:01 +02:00
.gitignore sqlite db 2024-05-29 10:11:37 +02:00
CMakeLists.txt first steps towards reusable engine codebase 2022-09-27 12:56:12 +00:00
CMakePresets.json ecs: rework crafting to tick-based process 2023-01-14 10:24:57 +01:00
LICENSE meta: license 2021-01-18 15:51:17 +01:00
README.md Update README.md 2023-09-16 06:57:33 +00:00
build_dbg.bat tooltip feature 2023-01-16 09:51:57 +01:00
dos2unix_conv.sh CRLF to LF 2021-11-01 19:55:13 +01:00
eco2d.10x dropped component caching 2023-02-13 10:31:08 +01:00
eco2d.sublime-project optimize IntegratePositions system to avoid comp fetch + update flecs v3.2.3 2023-06-07 09:52:08 +02:00
project.4coder small asset ids changes 2022-10-18 09:22:11 +02:00



discord play

Small C99 2D game engine with a focus on prototyping.
Brought to you by @zpl-zak, @inlife and contributors


eco2d is a experimental set of games made out of curiosity. It attempts to bridge several libraries to create a playable sandbox with ease of extensibility and with performance in mind. The goal is not to make a generic 2D game engine but to build a game prototype that anyone can use to build various experiments.

The game runs on top of raylib technologies and makes use of the zpl ecosystem alongside the cwpack library for data serialization. The game logic and lifecycle are maintained using flecs library and its suite of tools that help us improve the development efficiency.

It was built with networked game sessions in mind from the ground up and therefore provided two significant ways to play the game:

  • Networked game (UDP) - networked sessions benefit from the use of enet library.
  • Local Only sessions - Data is streamed via local buffers.

In both cases, the game engine does not differentiate between these two options and makes the concept of Server<>client infrastructure entirely abstract. As a result, gameplay logic is only tied to living entities, where the entity might represent a networked client / local controller.

All data is transferred via packets fully automated by our serialization rule system, which uses the cwpack library in the background.

Data is streamed in or out using the librg library, thanks to which all clients only receive data relevant to their location.

On top of that, the game client can also spin up multiple client heads and cycle between them, which allows us to easily debug new features locally without having to start the Server physically.

In the abstract sense, we call the Server the game master hosting all gameplay rules and features, while the Client represents a terminal sending key inputs and receiving data to render.

Major things to do

  • More believable world generation.
  • Improved rendering - the current world structure does not allow for layered blocks, but it's something worth looking into.
  • UI and visual effects


image image

Build the project

We use CMake to generate project files and manage builds.


We have a set of scripts ready for web development, these steps will get you up and running with a web build:

# Setup emsdk locally and configure a web project

# Build the web project

# Host the files on a web server (Python3)




Follow raylib-linux guide to install dependencies on your system.


Follow raylib-macos guide to install dependencies on your system.


You need to have Visual Studio 2019+ installed on your system. Make sure to run the commands below in a VS Developer Command Prompt.


You can do the following on the command line to create and build this project:

git clone https://github.com/zpl-c/eco2d.git
cd eco2d
cmake -S . -B build
cmake --build build

Run the following command to see all the options:

build\eco2d.exe -?


eco2d code is licensed under the BSD 3-Clause license, as seen here.

Assets under the art folder are released into Public Domain unless otherwise stated.

Third-party vendors are licensed according to their respective authors.