Code tools¶
Native code: ahead-of-time compiled behaviors and C++ modules (trusted local code; clients ask first).
4 tools in the code category. Badges: read-only tools never change the project; mutating tools are undoable and attributed; open-world tools reach outside the engine and MCP clients ask before running them.
| Tool | Summary |
|---|---|
wander_compile_native |
AOT-compile Wander behaviors to C++ and load them as native code (system clang++, cached by program hash, so unchanged behaviors load instantly). |
native_build |
Compile the project's native C++ module (native/*.cpp against skywalker/native/sdk.h, plus flags, include dirs, libraries, frameworks and pkg-config packages from native/module.json) into a library with the system clang++, then load it: its builtins become callable from every behavior (they appear in wander_reference) and its systems run every tick while playing. |
native_list |
Status of the project's native code: whether native sources exist, the C++ compiler, the last build and its diagnostics, the loaded module with its builtins (signatures) and systems, and behaviors running as AOT-compiled native code. |
native_template |
Write a starter native module: native/<name>.cpp (a builtin wave(t, freq) and a per-tick system that spins entities tagged "spinner") and native/module.json (flags, include_dirs, lib_dirs, libs, frameworks, pkg_config). |
wander_compile_native¶
Compile behaviors to native code mutating
AOT-compile Wander behaviors to C++ and load them as native code (system clang++, cached by program hash, so unchanged behaviors load instantly). Native code has identical semantics (same results, errors and step budget) and runs hot loops several times faster; anything that fails to build keeps running in the VM. Pass entity to compile its behaviors, or nothing for every behavior in the scene. auto=true compiles every behavior automatically whenever play starts. Edited behaviors fall back to the VM until compiled again.
| Argument | Type | Required | Description | Values |
|---|---|---|---|---|
entity |
integer | string | Only this entity's behaviors | ||
force |
boolean | Rebuild even if a cached library exists | ||
auto |
boolean | Compile all behaviors natively at every play start |
native_build¶
Build native module mutating
Compile the project's native C++ module (native/*.cpp against skywalker/native/sdk.h, plus flags, include dirs, libraries, frameworks and pkg-config packages from native/module.json) into a library with the system clang++, then load it: its builtins become callable from every behavior (they appear in wander_reference) and its systems run every tick while playing. Compiler errors come back as structured diagnostics {file, line, column, message} relative to the project. Unchanged sources load the cached build instantly. Security: this runs native code you or an agent wrote inside the engine; review it first.
| Argument | Type | Required | Description | Values |
|---|---|---|---|---|
force |
boolean | Rebuild even if nothing changed | ||
load |
boolean | Load the module after a successful build (default true) |
native_list¶
Native module status read-only
Status of the project's native code: whether native sources exist, the C++ compiler, the last build and its diagnostics, the loaded module with its builtins (signatures) and systems, and behaviors running as AOT-compiled native code.
Takes no arguments.
native_template¶
Create native module mutating
Write a starter native module: native/wave(t, freq) and a per-tick system that spins entities tagged "spinner") and native/module.json (flags, include_dirs, lib_dirs, libs, frameworks, pkg_config). Edit it, then native_build. Use it for hot inner loops (flocking, procedural generation, custom physics) or to bring in any C++ library (e.g. Homebrew packages via pkg_config).
| Argument | Type | Required | Description | Values |
|---|---|---|---|---|
name |
string | File name without extension (default "gameplay") | ||
overwrite |
boolean | Replace an existing file |