Skip to content

ludus::runtime::game_api::GameApiTable

Ludus Wiki · API overview · Browse API

Struct

The gameplay function table.
Every pointer is noexcept. Optional-capability entries are null when the module does not advertise the matching capability; the host checks capabilities (never a null pointer) before calling.

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

#include <ludus/runtime/game_api/api.h>
struct ludus::runtime::game_api::GameApiTable final

Fields

StructSize

uint32 ludus::runtime::game_api::GameApiTable::StructSize = 0
sizeof(GameApiTable); host negotiates the common size.

Related types: uint32

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

AbiMajor

uint32 ludus::runtime::game_api::GameApiTable::AbiMajor = 0

Related types: uint32

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

AbiMinor

uint32 ludus::runtime::game_api::GameApiTable::AbiMinor = 0

Related types: uint32

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Reserved

uint32 ludus::runtime::game_api::GameApiTable::Reserved = 0

Related types: uint32

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Query

Status(*) ludus::runtime::game_api::GameApiTable::Query(GameMetadata *outMetadata) noexcept(GameMetadata *outMetadata) noexcept = nullptr
Fill metadata. May run before Create; validation is not sandboxing.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Create

Status(*) ludus::runtime::game_api::GameApiTable::Create(const CreateInfo *info, GameInstance **outInstance) noexcept(const CreateInfo *info, GameInstance **outInstance) noexcept = nullptr
Construct the instance. Returns Ok and sets *outInstance, or a status.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Destroy

void(*) ludus::runtime::game_api::GameApiTable::Destroy(GameInstance *instance) noexcept(GameInstance *instance) noexcept = nullptr
Destroy the instance and release all module-owned resources for it.

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Update

Status(*) ludus::runtime::game_api::GameApiTable::Update(GameInstance *instance, const FrameInput *input, RenderParams *outRender) noexcept(GameInstance *instance, const FrameInput *input, RenderParams *outRender) noexcept = nullptr
Advance one host frame. Reads input, writes render params. No exceptions.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Quiesce

Status(*) ludus::runtime::game_api::GameApiTable::Quiesce(GameInstance *instance) noexcept(GameInstance *instance) noexcept = nullptr
Pause/resume simulation at a frame boundary.
Quiesce must leave the instance resumable; it may not irreversibly mutate state (design 7).

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

Resume

Status(*) ludus::runtime::game_api::GameApiTable::Resume(GameInstance *instance) noexcept(GameInstance *instance) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

CheckpointSize

Status(*) ludus::runtime::game_api::GameApiTable::CheckpointSize(GameInstance *instance, usize *outBodySize) noexcept(GameInstance *instance, usize *outBodySize) noexcept = nullptr
Size negotiation then bounded write of a read-only checkpoint.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

WriteCheckpoint

Status(*) ludus::runtime::game_api::GameApiTable::WriteCheckpoint(GameInstance *instance, CheckpointHeader *outHeader, ByteSpan body, usize *outBytesWritten) noexcept(GameInstance *instance, CheckpointHeader *outHeader, ByteSpan body, usize *outBytesWritten) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

CreateCandidate

Status(*) ludus::runtime::game_api::GameApiTable::CreateCandidate(const CreateInfo *info, const CheckpointHeader *header, ByteView body, GameCandidate **outCandidate) noexcept(const CreateInfo *info, const CheckpointHeader *header, ByteView body, GameCandidate **outCandidate) noexcept = nullptr
Create and validate a candidate from a checkpoint during staging.
Staging must not mutate active resources or perform side effects (design 7).

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

ValidateCandidate

Status(*) ludus::runtime::game_api::GameApiTable::ValidateCandidate(GameCandidate *candidate) noexcept(GameCandidate *candidate) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

CommitCandidate

Status(*) ludus::runtime::game_api::GameApiTable::CommitCandidate(GameCandidate *candidate, GameInstance **outInstance) noexcept(GameCandidate *candidate, GameInstance **outInstance) noexcept = nullptr
Promote a validated candidate to the live instance (non-failing swap in the module's own storage; the host commit is allocation-free).
Returns the new instance pointer; the old instance is destroyed separately by Destroy.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

DiscardCandidate

void(*) ludus::runtime::game_api::GameApiTable::DiscardCandidate(GameCandidate *candidate) noexcept(GameCandidate *candidate) noexcept = nullptr
Discard a candidate during recoverable rejection. Resume A unchanged.

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

DescribePropertiesSize

Status(*) ludus::runtime::game_api::GameApiTable::DescribePropertiesSize(GameInstance *instance, usize *outByteSize) noexcept(GameInstance *instance, usize *outByteSize) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

DescribeProperties

Status(*) ludus::runtime::game_api::GameApiTable::DescribeProperties(GameInstance *instance, ByteSpan out, usize *outBytesWritten) noexcept(GameInstance *instance, ByteSpan out, usize *outBytesWritten) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

ReadProperties

Status(*) ludus::runtime::game_api::GameApiTable::ReadProperties(GameInstance *instance, ByteSpan out, usize *outBytesWritten) noexcept(GameInstance *instance, ByteSpan out, usize *outBytesWritten) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

PrepareEdits

Status(*) ludus::runtime::game_api::GameApiTable::PrepareEdits(GameInstance *instance, ByteView edits, GameEditPlan **outPlan) noexcept(GameInstance *instance, ByteView edits, GameEditPlan **outPlan) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

CommitEdits

Status(*) ludus::runtime::game_api::GameApiTable::CommitEdits(GameInstance *instance, GameEditPlan *plan) noexcept(GameInstance *instance, GameEditPlan *plan) noexcept = nullptr

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

DiscardEdits

void(*) ludus::runtime::game_api::GameApiTable::DiscardEdits(GameInstance *instance, GameEditPlan *plan) noexcept(GameInstance *instance, GameEditPlan *plan) noexcept = nullptr

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

ReloadAsset

Status(*) ludus::runtime::game_api::GameApiTable::ReloadAsset(GameInstance *instance, uint64 logicalAssetId, ByteView cookedArtifact, uint64 artifactDigest) noexcept(GameInstance *instance, uint64 logicalAssetId, ByteView cookedArtifact, uint64 artifactDigest) noexcept = nullptr
Swap one supported logical asset to a validated immutable artifact at the owning subsystem's safe point; old resource disposal is deferred (design 12).

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h

ProcessScriptDebug

Status(*) ludus::runtime::game_api::GameApiTable::ProcessScriptDebug(GameInstance *instance, ByteView request, ByteSpan response, usize *outBytesWritten, uint32 *outPaused) noexcept(GameInstance *instance, ByteView request, ByteSpan response, usize *outBytesWritten, uint32 *outPaused) noexcept = nullptr
Process a versioned script-debug request on the instance's owner thread.
ParameterDescription
request
Borrowed UTF-8 extension JSON, at most 4096 bytes.
response
Caller-owned response storage, at most 4096 bytes.
outBytesWritten
Exact response length on Ok; zero on rejection.
outPaused
One when the authoritative tick remains partial/stopped, zero when normal Update may resume. The next Update must account for the completed pending tick before starting another. Never save a partial tick.

Returns

Explicit status; the module must validate revision/execution/stop tokens before mutation, bound inspection, and perform no watch evaluation.

Note

Optional ABI 1.1 tail, gated by Capability::ScriptDebug. Unsupported requests preserve simulation. Destroy cancels partial effects and retires every VM/native closure before the host releases the module image.

Related types: Status

Declared in modules/runtime/game_api/include/ludus/runtime/game_api/api.h