Common tasks
Step by step, the changes that come up most. Each links to the chapter explaining the parts it touches.
Add a service to the API table
When Rust needs something from the engine that neither the bindings nor reflection give.
- Add the function pointer to its sub-table in
rusteal-ffi/src/api_table.rs, and at the same position inue_plugin/Rusteal/Source/Rusteal/Public/RustealApiTable.h. - Implement it in the matching
Private/Rusteal*ApiImpl.cppand add it at the same position of that file’s positionalG*Api = {...}initializer. Fail withRustealFail(code, "reason"). - Shared structs:
#[repr(C)], namedRusteal*, with size and offset asserts inrusteal-ffi/src/contract_tests.rsandPrivate/RustealContractTests.cpp. - Wrap it in
rusteal-corebehind a safe function (crate::ffi_dispatch::<table>_<field>), returningRustealResultthroughcheck_ffi,#[track_caller]. - Test:
cargo test --workspace, thensetupandbuild --allin the test project, and the editor.
Bind an engine module
- In every
rusteal-cli/templates/*/*/rusteal.toml.tera(and the plugin templates that need it), addPackage = { module = "...", feature = "...", plugin = "..." }to[codegen.modules], and the feature tofeatureswhere it should be on. - In the test project, the same lines in
rusteal.toml, thenrusteal build --all. - Link errors: blocklist the functions (next task).
- Helpers reflection cannot describe: a file in
rusteal-codegen/manual/, gated by#[cfg(feature = "...")], listed inmanual/mod.rs; prelude entries inrust_gen/prelude.rs. cargo test -p rusteal-codegen; a fixture update if the module should be tested without the engine (regenerate_fixture).
See Code generation.
Blocklist a function that does not link
- Note the wrapper’s symbol in the linker error:
Rusteal_<Class>_<Function>. - Add
"<Class>.<Function>"to[codegen.blocklist] functions, sorted, in every template’srusteal.toml.terathat carries the blocklist, and in the test project. rusteal build --from 2in the test project.
Add a macro attribute
- Parse it in
rusteal-macros(uclass.rs,uclass_impl.rs…), with a compile error for invalid input rather than silently ignoring it. - If it changes what the class is made of, include it in the shape (
shape.rs), or hot reload will keep a stale class. - Generate the registration calls; if the reify API lacks what it needs, add it first (first task).
- Test it in
rusteal-codegen/tests/manual_compiles.rs(uclass_types_compile) and in the editor. - Document it in the game developer’s handbook, Attributes.
Change the C++ plugin
- Edit
ue_plugin/. Format with.clang-format(includes keep their order). cargo run -p rusteal -- setup <project>andbuild --all, then restart the editor: plugin code is never hot reloaded.- After a new source file or a changed
UCLASS/USTRUCTheader, runcargo xtask dev-setupagain so clangd sees it. - The published CLI embeds a snapshot of the plugin, written by
rusteal sync-plugin; the release workflows run it, nothing to commit.
Add a CLI command or flag
- The clap definition in
rusteal-cli/src/main.rs, a module of its own for the work, the version check (check_version) if it acts on a project. - A test of the parsing in
main.rs’s tests. - The game developer’s handbook: CLI reference and the chapter about it.
Add a template or a variant
See Template directories and Porting an engine template. A variant starts as a copy of the closest existing one; a template’s page in the game developer’s handbook goes with it, and its screenshot in assets/templates/ and the handbook’s images/templates/.
Add a feature
See Features: a plugin template with a [feature] table, or a directory in rusteal-cli/project_features/ for files added to the project. Its page goes in the game developer’s handbook under Adding features.
Update to a new engine version
- Build a test project with the new engine; regenerate (
build --all). - Check the engine’s deprecation warnings against
docs/ue-deprecations.md; record new entries with their ids. - Blocklist what no longer links; fix what the exporter no longer reads.
- Run every template; update the prerequisites in the game developer’s handbook from the engine’s
Windows_SDK.jsonandLinux_SDK.json.
Release
Nothing to do by hand but the pull request: open develop → main; Prepare release computes the version, commits it to the pull request and checks everything; merge when its statuses pass. See Releases and versions.