Scripting API

Scripting API

NativeBody

Record struct in Abyss.Core, from Abyss.Core.

A body of engine work written in Rust, which a Schedule can run as a system alongside C# ones.

public readonly record struct NativeBody

Remarks

Not everything a frame does belongs in a script. Transform propagation, physics, culling — they run every frame for every game and are performance-critical, so they should be Rust. But they cannot be a separate schedule running before or after the C# one: a game's frame is one dependency graph, and two schedules would either serialize against each other wholesale or need a second rule for deciding what may overlap.

So a native system is an ordinary member of the same schedule. It declares the same terms, goes into the same registry, and is judged by the same conflict analysis. Nothing about ordering, parallelism, or failure reporting treats it specially — the scheduler only calls a different kind of body.

A body receives exactly what a C# system receives, the chunks its query resolved to and the frame's delta time, and no world handle. That restriction is what lets it run on a worker thread at full speed: it touches nothing shared, so it needs no lock.

Properties

Integrate

public static NativeBody Integrate { get; }

The engine's reference body: a += b * deltaTime over two three-float columns.

Kept deliberately rather than as a placeholder. It is the workload every benchmark in this repository uses, so it is the only way to compare the native and managed paths under conditions that are otherwise identical — same chunks, same schedule, same frame.

Methods

Lookup

public static NativeBody Lookup(string name)

Finds a registered native body by name.

Parameters

  • name

Exceptions

  • AbyssException: Nothing is registered under that name.