LYNX ENGINE

ARCHITECTURE

How Lynx is organized

This page describes the major building blocks visible in the source: Engine, Level, Actor, Components, ECS, Factory, animation, audio, voxels, and scripting.

No C++ required. You can build a whole game with JavaScript and the editor. C++ is only needed if you choose to extend the engine.

Engine

lynx::Engine coordinates execution. It owns the current level, the object factory, and the game state. The host application provides the delta through ProgressOneFrame(float dt).

Engine* engine = lynx::GetEngine();
engine->StartGame();
engine->ProgressOneFrame(dt);
engine->EndGame();
The window and GLFW belong to the host application; the engine only keeps an opaque handle.

Level

A Level owns the active Actors. SpawnActor() creates an Actor from its class name; DestroyActor() removes it. When an operation happens during an iteration, it can be queued and applied safely afterward.

  • GetActorFromID(): find an actor by identifier.
  • GetActors(): iterate over actors in the level.
  • CountActorsOfClass(): count a class.
  • SaveToFile(): save the level.

Actor

An Actor is an Object associated with a Lynx ECS entity. It exposes a transform and scripts and can receive components through AddComponent<T>().

struct Health : lynx::Component {
  float hp = 100.f;
  void Tick(float dt) override {
    if (hp <= 0)
      lynx::GetEngine()->GetCurrentLevel()
        ->DestroyActor(GetOwner());
  }
};

actor->AddComponent<Health>();

Components and ECS

Each component type is identified automatically by a stable hash of its type name. The internal registry is based on EnTT. An Actor can have at most one component of a given type.

StageWhen?
OnAttach()Immediately after the component is added.
BeginPlay()When the game starts, or on the next tick if added during gameplay.
Update(dt)Every frame, even outside gameplay.
Tick(dt)Every game tick when tick_enabled is active.
EndPlay()Game stop, removal, or destruction.
~Component()Final destruction.

Factory and game modules

The engine maintains a global factory of Object constructors. A game module can register its classes with LYNX_MODULE_REGISTER and synchronize the factory while a DLL is loaded or unloaded.

LYNX_LINK_MODULE(
  LYNX_MODULE_REGISTER(MyPlayer);
  LYNX_MODULE_REGISTER(MyEnemy);
);

Integrated systems

Animation

animation, blend_space, and anim_manager handle playback, frame events, parameters, triggers, and transitions.

Audio

AudioSource can play sounds, attach to Actors, and use volume, pitch, looping, and spatialization.

Voxel

Voxel types come from voxels.json. Flags are used for collision and gameplay rules.

A game frame

HOSTprovides dt
ENGINEadvances one frame
LEVELupdates Actors
ECSupdates component systems
SCRIPTSBeginPlay then Update(dt)
DEFERREDspawns and destruction are finalized

AI IN THE ENGINE

Lynxie is an engine operator, not just a chatbot

Lynxie is integrated with the editor and can act on the project instead of only answering questions. It can inspect and manage files, generate JavaScript, query and modify the current scene, work with terrain and voxels, and compile the game.

The underlying model can be selected, while a dedicated Lynx-specialized model is currently in development. The goal is an assistant that understands Lynx projects natively and can turn high-level requests into real editor operations.

PROJECT FILESJS SCRIPTSACTORSTERRAINVOXELSBUILD