Skip to content

[Feature] Add efficient batched runtime block mutations for simulation-style mods #54

@yunnwi

Description

@yunnwi

Problem / Motivation

Simulation-style mods currently need to emit many individual SetBlock mutations from lifecycle callbacks.

This is awkward and fragile for mods such as:

  • cellular automata
  • spreading/infection blocks
  • machines
  • redstone-like systems
  • falling-sand style simulations

In testing a 64x64 Conway Life-style Wasm mod, large repeated SetBlock batches caused tick instability unless mutation output was heavily capped.

Proposed solution

Add an efficient batched runtime block mutation api.

Possible shapes:

  • SetBlocks(Vec<(pos, block_id)>)
  • runtime FillBox, not only worldgen FillBox
  • chunk-local mutation batches
  • explicit accepted/rejected mutation counts
  • clear diagnostics when callback result size or mutation budget is exceeded

Alternatives considered

Current workaround:

  • cap mutations per tick
  • run simulation less frequently
  • keep state inside the mod and only emit a small number of visual updates

This works, but makes simulation mods less responsive and harder to reason about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:guest-runtimeRuntime-loaded guest execution model, host/runtime behavior, guest session semantics.area:runtimeRuntime behavior, lifecycle, ticking, session behavior, execution flow.area:worldgenWorld generation providers, terrain generation, generation budgets, async worldgen execution.component:devkitDevkit-level / cross-repo work: manifests, integration glue, release shell, repo-wide coordination.component:enginefreven-engine: core engine/runtime/simulation/client-server internals.component:sdkPublic SDK / author-facing crates, examples, ergonomics, contracts exposed to modders.priority:p1High priority. Important and near-term.status:confirmedConfirmed bug/request. Reproduced, accepted, or clearly valid.transport:wasmSpecific to the WASM guest transport/backend.type:architectureLong-term structural / contract / system design work, not just isolated implementation.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions