Introduction

Cairn is a 3D game engine for Windows, macOS and Linux. It is written in C++20 and draws with Vulkan.

The editor playing Zombie Survival, one of the sample games

What you get

  • An editor with a viewport, a hierarchy, an inspector, an asset browser and a console.
  • A runtime that plays a project without the editor, and an export step that packs a project into a standalone game.
  • Lua 5.4 or TypeScript for game logic, with hot reload. TypeScript is compiled to Lua, so the game runs the same either way.
  • A command interface that lets a program, or an AI agent, do everything the editor does.

How a project is put together

A project is a folder. It holds a project file (.cairnproject), scenes (.cairnscene), and assets such as models, textures, materials, scripts and sounds.

A scene is a list of entities. An entity has a name, a transform and a parent, and gains behaviour from components: a MeshRenderer draws it, a Rigidbody makes it fall, a script makes it do whatever you write.

Every file the editor saves is plain text (YAML), so projects work well with version control.

Status

Everything is built and tested on macOS on Apple Silicon. The code is written for Windows and Linux as well, but it has not been built or run there yet.

Some features are not there yet: sorted transparency, frustum culling, instancing, level of detail, fog and asynchronous asset loading.

Where to go next