Skip to content

EngineSquared/EngineSquared

EngineSquared banner

Engine² (or Engine Squared)

CI License Release Issues Stars

Engine² is an engine focused on 3D game development. The engine is free and remains free in multiple significations of it:

Free as control

Engine² makes you able to understand it, use it, and contribute to it easily, for you, artists. Any kind of artist should be able to take the project in their hands and make stuff with it. If you are an engine programmer, game designer, sound designer, tool programmer, and so on, you will have the possibility to create and express yourself. And as I like to say: "For me, the quality of a game is reflected in the messages it conveys."

Free as freedom

Engine² is not made to make realistic games nor little arcade ones. This project is made to help you create any kind of project. If you want to make something, you will be able to do it. Anything is possible.

Free as a price

Engine² will not force you to spend any money to use any kind of services it proposes. It’s 101% free to use.

Free as liberty

Engine² lets every process, planification, and evolution be visible and understandable by the community. The point here is to know the priorities of the engine, its direction, and to let the community impact most of the engine.

Technical

Examples

ES-RS Menu ES-RS In-Game
Lights Material

Prerequisites

Make sure the following tools are installed before proceeding:

Tool Minimum version Install
xmake v3.0.x See xmake installation guide

Warning

No other tools should be needed. If you get stuck at some step, please report it by opening a bug issue 🙏 (before doing that, check the documentation about how to create an issue)


Clone the repository

git clone https://github.com/EngineSquared/EngineSquared.git
cd EngineSquared

Configure and build

# Configure (downloads dependencies automatically)
xmake f -y

# Build the engine
xmake build -y

Note

Windows only xmake will automatically pull the MSVC toolchain, so you don't need to have it already installed on your machine.


Run a minimal example

Build and run the basic_core_usage example to confirm everything works:

xmake f --basic_core_usage=y -y
xmake run BasicCoreUsage

If the basic core usage run without errors, you're all set. ✅


Project Overview

Here is a graphical overview of the project:

graph TD
  ROOT["EngineSquared"]

  ROOT --> SRC["src/"<br/>All source files of the project]
  ROOT --> EX["examples/<br/>Runnable demos"]
  ROOT --> TOOLS["tools/<br/>Some useful general tools"]
  ROOT --> DOCS["docs/<br/>Images, doxygen"]

  SRC --> ENGINE["engine/<br/>ECS Core of the engine"]
  SRC --> PLUGIN["plugin/<br/>Groups of context"]
  SRC --> UTILS["utils/<br/>Shared utility stuff"]

  PLUGIN --> PLUGIN_SRC["src/<br/>Source files"]
  PLUGIN --> PLUGIN_XMAKE["tests/<br/>Tests files"]
Loading

Engine² is STRONGLY built around an ECS architectural design pattern. The engine core (src/engine/) provides all necessary stuff to agglomerate logic and data to create any kind project. The Core class is the entry point of the framework, it allows to manipulate entities and systems through schedulers. All features (graphics, physics, sound, etc.) are implemented as plugins that you register into the engine core.

Available plugins

Here is a list of available plugins:

Plugin Description
graphic 3D rendering via WebGPU
physics Rigid body physics via JoltPhysics
input Keyboard/mouse input via GLFW
sound Audio playback via miniaudio
window Window management via GLFW
scene Scene graph management
event Publish/subscribe event system
relationship Parent/child entity relationships
native-scripting Attach C++ scripts to entities
rmlui UI rendering via RmlUi
camera-movement Built-in camera controller
rendering-pipeline Rendering pipeline abstraction
default-pipeline Pre-assembled default render pipeline

Warning

Those plugins may not be up to date as they are not updated automatically. To check current plugins, you can check plugins folder.


How a minimal program looks

Here is a very basic example that can be useful to understand the pattern before contributing:

#include "Engine.hpp"

// A Component should only holds data related to an entity
struct NameComponent { std::string value; };

// A System is a callable element (function, class or lambda) that only run logic
void HelloSystem(Engine::Core &core) {
    core.GetRegistry().view<NameComponent>().each(
        [](auto &name) { Log::Info(name.value + " arrived."); });
}

int main() {
    Engine::Core core;

    // Register systems on lifecycle schedulers: Startup, Update or Shutdown
    core.RegisterSystem<Engine::Scheduler::Startup>(HelloSystem);

    // Create entities and attach components
    auto entity = core.CreateEntity();
    entity.AddComponent<NameComponent>("Alice");

    core.RunSystems(); // starts the game loop, RunSystems() run them only one time and RunCore() run all scheduler indefinitely until Stop() is called
}

Warning

This example may not be up to date as it's not updated automatically. For concrete working examples, you can check examples folder.


Where to go next


Interested ?

You can start to discover the engine through contribute to it through looking at good first issues and checking how to contribute


Troubleshooting

For now there is no troubleshooting found. If you encounter a problem, please report it by opening a question issue 🙏 (before doing that, check the documentation about how to create an issue)