Skip to content

Multiplayer Sync.en

Claude Code edited this page Nov 20, 2026 · 2 revisions

Multiplayer Sync

中文 · English

RigWorks distributes character configuration and dedicated action packages through the optional rigworks:appearance v2 channel. The protocol transfers configuration only — no FBX or textures.

In-game flow

  1. Import a character through RigWorks > Characters > Import avatar.
  2. Edit humanoid mapping, calibration and actions in the shared Edit [RigWorks] panel.
  3. Apply enables the character, Save persists the project and full character configuration then applies, and Export produces a ZIP with assets and dedicated sources.
  4. Upload is on by default. Apply, save, character reload and dedicated package changes trigger a content check; unchanged hashes are not uploaded. After an edit there is a short merge wait, and a retry state is visible while the network is busy.
  5. Once the server accepts, it returns the authoritative configuration revision and package hash. Other clients download missing versions and, after validation, rebuild only that character's animation instance.

The two switches

  • Upload configurations off keeps the local character and author configuration, stops publishing the private selection and withdraws the custom appearance from the server; it does not delete caches other players already obtained. An upload that started but has not been confirmed cannot re-enable display either.
  • Display other characters controls both downloading and applying other characters; with it off, the vanilla player is shown while your own character stays editable and previewable locally.

Without the RigWorks channel on the server, editing stays available and reports a local-only state.

Configuration snapshot

CharacterVisualConfig is an immutable schema-v1 snapshot containing:

  • the full CharacterProfile: model resource ID, scale, forward angle, humanoid bone mapping, reference rotations, native pose calibration rotations, action mapping, head and action timing settings
  • the full equipment definition: left/right mounts, named sockets, rules matched by item/tag/state/use-animation/view, and two-handed contact grips
  • XYZ root offset, XYZ rotation and per-axis scale
  • inline solver rig, bone deformation, action and physics sidecar definitions
  • contact IK, visual physics, grounding and character effect options
  • the model source file SHA-256
  • the current character instance's generic node, visibility, material and socket overrides (assetEdits)

It does not send the edit camera, editor layout, per-frame bone matrices, FBX, textures, sounds or native libraries. Visual transforms for equipment or the character do not change server collision boxes, reach or movement rules.

The model hash identifies only the model source file and does not prove external texture parity. Recipients must already have matching assets; missing assets, mismatched bones or a hash mismatch keep the vanilla player and record a diagnostic.

Dedicated JSON and action packages

Author files live in kubejs/rigworks/<avatar>/, formatted as described in Scripting. They are independent of KubeJS global client_scripts:

manifest.json
mappings.json
controller.js

CharacterAvatarBehavior discovers local packages, supplies author sources to the sharing layer, and receives validated packages through the validated installer. Received sources enter only the dedicated restricted interpreter; they are never written into the author folder or injected into the KubeJS global environment.

Local and remote players each hold an independent OwnerAvatarSession: its own interpreter, JSON state, input history and action layers. Scripts run once per client tick, and render and shadow paths only consume the finished pose. Switching a package replaces only that character, and script exceptions restore the built-in actions.

Network protocol

The server determines the owner UUID from the actual connection; a client cannot submit on behalf of someone else or choose an accepted revision.

Server directory notifications carry character metadata, the overall revision, a separate configRevision, a display configuration digest, a configuration package digest and the world identity UUID. Configuration packages are sent only after a download request. Ordinary flight metadata changes do not invalidate an equipment edit's configuration revision; a configuration submission must match the current configRevision. On conflict the current directory is returned first and the rejection reported second — a local draft never overwrites the accepted state.

Login, reconnect, respawn, dimension change and starting to track a player all fetch the directory. Accepted configurations are stored in the world's data/rigworks_visuals.dat; larger configurations use UTF-8 byte arrays to avoid the 65535-byte NBT single-string limit.

A directory send failure after a successful submission neither revokes the server record nor reports the submission as rejected. Each recipient is sent independently; failed directories enter a bounded backoff queue merged per recipient and character. Retries re-read the current revision and check the original connection and current dimension, and only failed entries are processed.

Item Current limit or location
display configuration 128 KiB; depth, member, duplicate-field, finite-value and solver-work limits
full configuration package 512 KiB, at most 32 JSON/JS files, 64 KiB each
transfer chunks ordered 16 KiB; length, order, compressed byte hash and decoded canonical package hash checked
upload throttle at least 4 ticks between submissions per connection
server cache data/rigworks/packages/<hash>.bin, 128 MiB budget
recipient cache kubejs/rigworks/cache/<world-identity>/<hash>.bin, 64 MiB budget
concurrent client downloads at most two; cache reads, decompression and hashing run in bounded background tasks

Caches are version-headed gzip binary containers. Recipients never write plaintext JSON/JS to disk, and a valid old cache is kept until the new package validates. Compression is not encryption and provides no extraction protection.

Application boundary

Root transforms and equipment transforms on the same socket only update matrices; structural rig, action-mapping, physics or package changes rebuild only that owner's animation instance and reuse the imported model. Model file hashes are computed on the loading worker thread and cached per resource generation, so the render loop never reads files per frame.

The UI distinguishes "package validated, applying model" from "character configuration applied". Download or script initialisation failures explicitly report that the previous valid character is kept, or the vanilla player when no prior instance exists. Within the same world and valid resource generation, configuration reload and profile switching keep the old live binding, and the new model hash, equipment nodes, rig and physics are swapped in only after successful initialisation.

The RigWorks workbench extension declares that it owns character application, so the generic workbench cannot apply a global transform to the shared AssimpScene and then stack the owner's private transform on top. Projects marked as RigWorks store generic overrides in the full character snapshot and read them through an owner scope during drawing; they cannot modify another player using the same FBX.

The generic Slots' head, back and spyglass are consumed by the matching equipment layers; other named slots require an extension to query them through AssimpLoader's WorkbenchRuntime.socket(...).

Verification boundary

Unit tests cover full configuration round trips, strict JSON, separation of configuration and flight revisions, old-version rejection, display withdrawal, persistence, configurations above 64 KiB in NBT, package path/size limits, out-of-order or corrupt chunks and binary containers; failed-directory re-sending has separate queue tests.

A standalone dedicated server, authenticated login, reconnect, dimension change, many players and unstable networks still need separate acceptance. Static screenshots do not prove motion rendering under every shader and are not a performance baseline.

Clone this wiki locally