What the Game SDK gives you
Build and package the starter project
For headless simulation, use the separate Spatial SDK and quickstart. For gameplay, start with the Game SDK below.
- Engine. The native runtime for rendering, physics, scenes and resources.
- Editor. The visual application for authoring projects, scenes and assets.
- Game SDK. Public C++ headers, templates and CLI tools for creating a project, compiling its gameplay and packaging a game.
- Player. The macOS app that hosts the compiled engine and runs the project's scenes and gameplay modules.
A game module is a compiled library of project-owned behaviours. The Player loads it through a versioned C ABI and supplies engine services to its components.
Requirements and package contents
Download Game SDK + Player for macOS
The bundled Player runs on macOS 26.1 or later on Apple silicon. To create a project and compile its gameplay from the CLI, install these tools.
- Python 3.10 or later
- CMake 3.24 or later
- Xcode Command Line Tools, including a C++ compiler and
codesign
The ZIP includes Runtime/CrescentPlayer.app, public Crescent and Metal-cpp headers, CMake integration, templates and tools for asset cooking and packaging. Building a custom Metal extension also requires the Xcode Metal compiler.
After downloading, extract the archive. The examples below assume it is available at /path/to/CrescentSDK; replace that path with the directory on your machine.
Create a project
new-project creates an independent project folder. It writes a project file, a startup scene, settings and asset directories, and a registered C++ sample component.
python3 /path/to/CrescentSDK/tools/crescent.py \
new-project "$HOME/Projects/MyGame" \
--id MyGame --name "My Game"
--id is the stable C++ and CMake identifier used for the module. It must be a valid, non-reserved identifier. --name is the display name and may contain spaces. If omitted, the folder name is used. The CLI refuses to overwrite an existing destination.
The generated project is organized like this:
MyGame/
├── Project.cproj
├── Assets/
├── Scenes/
│ └── Main.cscene
├── Settings/
└── Source/GameLogic/
├── CMakeLists.txt
├── Module.cpp
└── Gameplay/
Project.cproj declares the project module and its output location. Module.cpp lists the project components that the runtime can create. The startup scene includes the sample component, a camera and a cube. Build the module and open the project with the bundled Player.
The generated CMake target links the SDK’s interface target and names each source file explicitly:
cmake_minimum_required(VERSION 3.24)
project(MyGame LANGUAGES CXX)
find_package(CrescentSDK CONFIG REQUIRED)
crescent_add_game_module(MyGame
Module.cpp
Gameplay/ShowcaseMotion.cpp
)
crescent_add_game_module sets up the module target, includes the public headers and selects the .dylib output format. Add every new implementation file to this target; CMake does not search the project for source files automatically.
Add a module to an existing project
Use init when a project already has a Project.cproj. It adds a module entry, creates the source template under Source/<module-id>/ and saves a copy of the previous project file under Library/ModuleMigration/.
python3 /path/to/CrescentSDK/tools/crescent.py \
init "$HOME/Projects/ExistingGame" --id GameLogic
The module ID must be unique in the project and a valid C++/CMake identifier. The command refuses to replace an existing module directory. Review the changed Project.cproj and generated Source/GameLogic/ files, then build the project module with the same build command shown below.
Write and register a component
A component derives from Crescent::SDK::Behaviour. The runtime calls its lifecycle callbacks; for example, onStart runs when the component starts and onUpdate receives the frame delta time. The following compact single-file example illustrates the API; the generated template separates its gameplay implementation and registration across files.
#include <Crescent/Game.hpp>
using namespace Crescent::SDK;
class Rotator final : public Behaviour {
public:
using Behaviour::Behaviour;
float speed = 45.0f;
void onUpdate(float dt) override {
auto transform = entity().localTransform();
transform.rotation_degrees.y += speed * dt;
entity().setLocalTransform(transform);
}
};
static const CEFieldDescriptor fields[] = {
field<&Rotator::speed>("speed", "Rotation speed")
};
static const CEComponentDescriptor components[] = {
component<Rotator>("MyGame.Rotator", "Rotator", 1, fields)
};
CRESCENT_GAME_MODULE("MyGame", components)
Behaviour gives the component an entity handle and access to the services supported by that entity. In this example, the component reads the entity’s local transform, adds speed × dt degrees around the Y axis, and writes the transform back. Multiplying by dt makes rotation speed independent of frame rate.
field declares a property and its persistent field ID; default fields are stored with authored scene data. component gives the type a stable ID, a display name and schema version 1. CRESCENT_GAME_MODULE exports the module entry point and registers the component list. Registration is explicit: the SDK does not scan headers or discover classes automatically.
For state that belongs in a runtime save, mark the field with CE_FIELD_RUNTIME_SAVE. When saved component data changes shape, increase the component schema version and implement migrate(previousVersion) to convert older data.
This compact example places the class, descriptor and module entry point in one file. The generated template separates gameplay implementation under Gameplay/ and keeps registration in Module.cpp; its CMake target lists both files. When adding a source file, add it to that target and include the component descriptor in the module’s registered component array.
Component data, lifecycle and identity
A registered component has three identities to manage: its C++ type in the module, a persistent component ID in the descriptor, and persistent field IDs in its serialized properties. Crescent does not discover classes by scanning headers. The module catalog is the explicit list of project types that a scene can instantiate.
Lifecycle callbacks run in the owning scene's execution context. Constructors allocate the module's C++ object before it is attached to the entity; use onCreate or onStart for work that needs the attached component graph. The behaviour interface includes enable/disable and destruction hooks, per-frame and fixed-frame updates, late and post-animation phases, end-frame work, and collision or trigger enter/stay/exit callbacks.
Properties that survive content changes
Descriptor fields support booleans, floating-point values, supported signed integers, strings, vectors, enums, entity references, reflected records and standard arrays or vectors. Editability and persistence are separate concerns: the edit flag controls authoring exposure, while runtime-save flags include selected fields in project checkpoints.
Keep IDs stable when renaming C++ members or reorganizing code. If the serialized shape changes, increment the component schema version and implement migrate(previousVersion). A missing type or an unsupported newer schema is preserved as a non-executing record when scene data is saved; it is not silently converted into a different component.
For references that outlive a callback, use a typed SDK reference such as EntityReference or ComponentLink<T> and resolve it when needed. Borrowed component pointers are valid only within their documented scene callback boundary. Project code must not retain native engine pointers.
Build the module
Run the SDK CLI against the project directory. The default configuration is Release; use --configuration Debug for a debug build.
python3 /path/to/CrescentSDK/tools/crescent.py \
build "$HOME/Projects/MyGame"
# Optional debug build
python3 /path/to/CrescentSDK/tools/crescent.py \
build "$HOME/Projects/MyGame" --configuration Debug
The builder configures the module with the SDK’s CMake package, compiles it as a macOS .dylib, signs the development library, and publishes the artifact. The generated manifest at Library/GameModules/<module-id>.json points to an immutable library under Binaries/macOS/Modules/<module-id>/. CMake’s intermediate files and compile database are kept under Library/GameModules/<configuration>/.
Unchanged builds reuse compiled objects. Each successful build publishes a new immutable module generation and updates the manifest; if compilation fails, the previously published artifact remains in place. This behavior applies to module builds, not complete game or asset cooking.
Run and package a game
Launch Runtime/CrescentPlayer.app, click Open Project, and choose Project.cproj. You can also point the SDK's run command at your project folder. A project that declares a C++ gameplay module needs a compatible compiled module.
python3 /path/to/CrescentSDK/tools/crescent.py run "$HOME/Projects/MyGame"
python3 /path/to/CrescentSDK/tools/crescent.py package "$HOME/Projects/MyGame" \
--output "$HOME/Builds"
package builds the project's gameplay, cooks its content and assembles an app with the prebuilt Player. Saved Cycles lightmaps and probe data are packaged with the scene. The finished game opens directly on a compatible Mac. You can complete this workflow with the SDK and your own project files.
What project code can access
The SDK exposes selected engine operations through versioned service tables. A component obtains services through its entity or host context; the engine keeps ownership of native resources.
Service tables are independently versioned, so the presence of one API does not imply that every other optional API is present in the Player. Use each header's available() or capability check where supplied, read status return values, and consult that interface's version and bounds before relying on it. The list below groups the public package by the work project code can request; it is not a list of every internal engine feature.
Components and scene
Game.hpp · Hierarchy.hpp · Scenes.hpp
Derive from Behaviour, receive lifecycle callbacks, access an entity handle, read or write transforms, inspect hierarchy, request supported scene changes and defer entity destruction. The handle is scoped to its live scene owner; it is not a native entity pointer.
Project component access
Components.hpp · ComponentLifetimes.hpp
Find or create registered project components by stable type ID, inspect copied type and state information, read or write supported reflected fields, enable a component and request removal. Component references carry an instance identity so a stale reference cannot control a replacement instance. Native built-in components use their dedicated services.
Hierarchy and transforms
Hierarchy.hpp · TransformPoses.hpp · TransformMatrices.hpp
List children, descendants, roots or scene entities; inspect names, UUIDs, tags and layers; and read or update supported local or world poses. Optional matrix reads preserve affine transforms such as hierarchy-induced shear that decomposed position/rotation/scale cannot represent exactly.
Physics
PhysicsQueries.hpp · PhysicsComponents.hpp
Cast rays and shapes, query overlaps, read supported body state, and apply motion or forces. The builder also exposes synchronous explicit triangle and convex cooking. These calls do not expose Jolt objects.
Vehicles and ragdolls
Vehicles.hpp · Ragdolls.hpp · MeshColliders.hpp
Configure supported wheeled or tracked rigs, read copied wheel/contact state, create bounded capsule-rig ragdolls and cook explicit triangle or convex mesh colliders. Native constraints and bodies remain host-owned; rig state is not automatically a project save record.
Input
Input.h
Read key, mouse and gamepad snapshots, or define owner-scoped digital actions from supported bindings. Action values combine their bindings; input remains tied to the host’s scene callback schedule.
Audio
AudioVoices.hpp · AudioOneShots.hpp · AudioParameters.hpp
Control supported audio voices through handles, including gain, spatial settings, pause and copied playback state. Optional services cover mixer-owned one-shots, selected local Studio event parameters and application bus levels; modules can declare bank sets. One-shots do not return a controllable voice handle. Bank ownership, global event controls and arbitrary DSP or snapshot graphs are outside this interface.
User interface
UIElements.hpp · UITree.hpp · UIInput.hpp · UILayers.hpp
Use document and action handles; optional APIs read or set form values, update element properties, replace generated UI trees, route selected pointer/key/text input and control gameplay-layer visibility. UI changes are transient; persist project state in your own model and rebuild the UI when needed.
Animation
Animation.hpp · Animator.hpp · AnimationIK.hpp
Inspect clips and bones, control playback and fades, sample local/global/skin poses, configure animation states and transitions, set inverse-kinematics targets and read supported animation events. Pose evaluation remains host work and its frame cost depends on the content and use.
Project assets
Assets.hpp · Prefabs.hpp · Models.hpp
Look up declared project assets, read contained asset bytes and instantiate supported prepared prefab or model resources. Files referenced only from code must be listed in the project or module resource declarations; the SDK does not discover them automatically.
Scenes and saves
Scenes.hpp · Saves.hpp
Request supported active-scene replacements and persist versioned project sections and opted-in component fields. Checkpoint restore loads a source or cooked scene and applies project state; it is not a full snapshot of every native runtime subsystem.
Render resources
RenderResources.hpp · Instances.hpp
Use supported mesh/material resource handles and project-owned instance groups. Handles retain host-managed resources within their documented world lifetime; they do not expose renderer internals or arbitrary GPU memory.
Material shaders
MaterialShaders.hpp · MaterialPipelines.hpp
Declare project color-surface shader programs, publish typed material parameters and images, and request supported pipeline variants. This adds project material programs to native draw paths; it is not a general render-graph or arbitrary native pass API.
Metal extensions
MetalExtension.h · RenderData.hpp
Add an optional renderer extension using the host frame context and project-owned render data. Render callbacks use snapshots; they are not a route to unrestricted live-scene access. This path requires the Metal-enabled SDK export and Xcode Metal compiler.
The list describes the implemented service surface; it does not mean every native engine operation is available to projects. Use the headers in the downloaded SDK for exact signatures, return codes, service versions and limits.
A physics query from a component
This example sends a ray from the component’s entity context and checks whether it hit something. A result of 1 means hit, 0 means no hit, and -1 means the query was unavailable or rejected.
#include <Crescent/PhysicsQueries.hpp>
PhysicsQueries physics(entity());
auto ray = PhysicsQueries::ray(
{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, 100.0f);
CERaycastHit hit{};
const int result = physics.cast(ray, hit);
if (result == 1) {
// Use the copied hit data here.
}
Physics, motion and animation
The SDK does not wrap Jolt objects in public headers. It offers typed descriptions, commands and copied state so gameplay code can ask the host to perform an operation without taking ownership of the physics world.
Rigid bodies and character motors
PhysicsComponents.hpp configures supported static, dynamic and kinematic primitive bodies, including shape dimensions, local offsets, mass, damping, gravity, continuous collision, collision layers, masks and trigger settings. Configuration is validated before it is applied. Native body creation or rebuild happens at a physics synchronization point; read CEBodyState::materialized before issuing operations that require a live backend body.
CharacterMotor uses Crescent's existing capsule movement, stepping, slope and grounding behaviour. Project code supplies movement and jump requests. The host advances the motor in its normal update schedule, so project code should not simulate it a second time. Changing a body description can rebuild it and reset solver motion; initialize velocity again after such a change.
Queries and contact callbacks
Ray, sphere, box and capsule casts return copied hit data. Multi-hit results are ordered by distance; overlap results are copied into caller-owned buffers. Queries validate dimensions, layer masks, trigger policy, entity ownership and the live scene context. A ray result distinguishes hit, miss and rejected or unavailable service. Shape casts translate a fixed orientation; they are not angular sweeps, and the current v1 does not expose rotated box queries or capsule overlaps.
Registered behaviours can receive collision and trigger enter, stay and exit callbacks after the physics step. The callback gets a borrowed contact value with the other entity handle, contact point, normal, penetration and closing speed. Copy values you need beyond the callback; neither the contact record nor the backend body is retained by your module.
Vehicle and ragdoll services
The optional vehicle service accepts an explicit wheel layout, drivetrain settings, suspension, tire curves and differential setup for wheeled vehicles; tracked setups use two wheel-index groups and project-controlled belt ratios. State reads can copy engine, wheel, contact and slip values into project-owned buffers. Chassis constraints are native runtime objects and must be recreated after load; they are not serialized automatically as project components.
Project-owned ragdolls use a bounded, topologically ordered capsule tree with swing/twist joints. The service returns an opaque handle and copied part states. It does not bind a skeleton, take over animation, or automatically resolve how gameplay should switch between a ragdoll and a character controller; that policy belongs to project code.
Animation access
Animation.hpp exposes clip and bone metadata, playback controls, timed fades, local/global/skin-pose sampling and rendered bone matrices. These reads sample the bound rig; sampling does not itself change live playback. Re-query bone and clip indices if a model or rig binding changes.
Animator.hpp configures supported clip states, primitive parameters, ordered one-dimensional blend trees and conditional or exit-time transitions. Cache parameter references after configuration; replacing the graph invalidates those references. AnimationIK.hpp configures indexed root/mid/end chains against an existing Animator rig. Animation event tracks can be replaced and read through a bounded journal; opening that journal takes ownership of marker delivery for the controller, so do not mix it with the legacy native event consumer.
These APIs expose selected operations on the engine's existing runtime systems. Synchronous body or mesh cooking, model and prefab creation, animation graph configuration and UI-tree replacement can be cold operations with allocation or parsing costs. The SDK does not promise a fixed frame budget or make every content operation asynchronous.
Assets, scenes and project persistence
Declare what code uses
Assets referenced only by a C++ string or runtime-generated UI property are not automatically discovered. Declare project resources in Project.cproj or the module manifest so the engine build can include them. This is especially important for audio files, shader banks, images and other paths that are not present as direct scene references.
Typed references such as ModelReference, PrefabReference and TextureReference keep resource intent in component data. Model declarations can point at project model files; the engine importer prepares their meshes, materials and supported skin/animation data. Prefabs use scene documents as reusable entity templates. Both can instantiate under a live project world using the SDK's typed handles.
Imports and instantiation that parse or construct native content are synchronous operations in the current interface. Build Game cooks declared models and scenes and packages their dependencies. The SDK project build compiles a C++ module only; it does not perform full project cooking or create the Player application.
Scene changes and checkpoints
The scene service can request supported active-scene replacement from project code. A successful handoff loads the candidate scene before the host activates it; a failed load leaves the current world active. Scene requests are admitted through the owning scene context and are not arbitrary worker-thread jobs.
The save service writes versioned project sections and selected runtime state. Registered fields marked for runtime saving can participate; a component can opt its transform into checkpoint restoration. Projects are responsible for encoding their opaque sections and migrating their own section versions.
A checkpoint is not a full copy of the engine world. It does not capture every runtime-spawned entity, native physics constraint, animation clock, renderer resource or audio voice. Store the gameplay state your project needs and recreate transient runtime objects through the SDK after loading.
Rendering and material extension points
Crescent provides two related extension paths. Project material shaders add declared color-surface programs to supported native static, skinned and instanced draw paths. A Metal extension supplies an explicit backend callback for custom rendering work. These paths have different responsibilities and requirements.
Project material shaders
A module can declare a namespaced shader catalog, a shader bank in its manifest, a fragment entry point, a surface ABI and typed parameter or image slots. Project code selects the shader on a supported material and updates its declared values. The engine compiles and caches compatible pipeline variants for the native draw path; the optional material-pipeline service can request variants and poll completion rather than synchronously compiling them from gameplay.
The material API is a defined color-surface contract. It does not replace native depth prepass, shadow, lighting, post-processing or the whole render graph. Parameter and image slots have explicit types and bounds; only declared programs and compatible target variants can be selected.
Metal extensions
A custom extension is compiled into the project module and receives a host frame context plus project-owned render data. It can create and use Metal resources under the documented lifetime rules. It must finish encoders it creates and must not commit or wait on the engine command buffer. Do not retain the frame-context pointer or completion callback for later frames.
Build this path with an SDK export that includes Metal-cpp and the Xcode Metal compiler. The CMake helper crescent_enable_metal(target) adds the Metal-cpp include path and Apple framework links for the extension target. This is an Apple Metal backend interface, not a cross-platform graphics abstraction.
Module and runtime boundary
The module and the Player are built separately. The module exports a versioned C entry point; the host checks the ABI version and reads fixed-layout descriptors. C++ objects, exceptions and STL containers do not cross the boundary. Each module constructs and destroys its own component instances.
Components run in the scene callback schedule. The SDK is not a general-purpose worker-thread API: entity and service calls must follow the owning scene’s thread and lifetime rules. Entity handles can become invalid after deletion, so check service results instead of retaining native engine pointers.
Component IDs and field IDs are saved identities. Keep them stable. If a saved component’s data layout changes, increment its schema version and implement migrate(previousVersion). The runtime preserves unavailable or unmigrated component data as a non-executing record instead of silently discarding it.
Services between project modules
Modules can publish their own independently versioned C contracts through the optional module-services entry point. Crescent discovers those contracts without adding a game-specific service name to engine code. A consuming module declares its provider dependency and looks up the contract by its stable namespaced ID from a behaviour callback.
A shared contract header should contain a table prefix and C-compatible function pointers. Keep the table in immutable provider-module storage, validate arguments at the provider, and catch exceptions before returning across the boundary.
struct HealthAPI {
uint32_t struct_size;
uint32_t version;
int (*damage)(const CEHostAPI*, CEEntity target, float amount);
};
// Client module, inside a Behaviour callback:
auto* api = entity().projectService<HealthAPI>("SharedGameplay.Health");
if (api) api->damage(host(), target.handle(), 25.0f);
The broker checks service IDs, versions, table sizes, duplicates and owner/thread context. The world pins provider modules for the lifetime of that world, so a project switch does not invalidate an already-running world's service tables. Borrowed service tables must not outlive their world.
This mechanism shares a project-defined C contract. It does not transfer C++ instances, STL ownership or exceptions between modules, and it does not make game-specific services built into the engine.
Common build and runtime issues
The generated project cannot find CrescentSDK
Check that the SDK was extracted as a directory and that the build is using its cmake/ package. The generated target uses find_package(CrescentSDK CONFIG REQUIRED); point the CLI at the intended export with its documented --sdk option when using more than one SDK copy.
A new component does not appear in the scene
Confirm that its implementation file is listed in the module's CMakeLists.txt, its descriptor is included in the registered component catalog, and the ID in the scene matches the descriptor ID. Crescent does not scan headers or auto-register classes.
The module builds but the Player does not load it
Run the module with a compatible Crescent Player. The host validates the module entry point, ABI and descriptor sizes before it creates project components. Use the SDK shipped with your Player, rebuild the project module, and check that the project's artifact manifest points to that build.
An asset works in source but is missing in a packaged game
Declare paths referenced only by code in the project or module resources. The build cannot infer a dependency from an arbitrary runtime string. Run the SDK's package command again to cook the updated content.
A physics operation is rejected or has no effect
Many body operations require a materialized backend body. Check the operation's return value, query CEBodyState, and ensure the call is made from the owning scene context with a live same-world handle. Reconfiguration may rebuild the body and reset its solver motion.
The Metal extension cannot compile
Use an SDK export that includes Metal-cpp, install Xcode Command Line Tools and the Xcode Metal compiler, and call crescent_enable_metal(target) in that module's CMake target. A gameplay-only module does not need the Metal frameworks.
Current scope
The Player preview and the apps created by the binary kit use ad-hoc signing. For public distribution, follow Apple's Developer ID signing and notarization workflow. The binary kit packages saved Cycles bakes. Scenes without a saved bake use realtime lighting. Audio playback is disabled in this preview.
The public API is a selected service surface over the native runtime, and coverage varies by subsystem. Existing built-in gameplay, legacy serialization and some game-specific renderer, UI and audio paths remain engine-owned. Asynchronous or additive asset streaming and offline collision asset caching are outside the current standalone module workflow. FMOD remains the engine's audio backend; the ordinary gameplay SDK headers do not expose FMOD types.
For the exact declarations, version checks, return codes and service limits, read the CrescentSDK/README.md inside the archive and the matching public header under CrescentSDK/include/Crescent/. For the native host, see the engine technical overview.