Skip to main content

Developer overview

This section is for developers extending TSMP.

Start with Getting Started if you only need to place the prefab, synchronize built-in components, or debug a scene. Use this section when you need to write code against TSMP.

What you can extend

ExtensionUse it whenStart here
Custom synchronized componentBuilt-in sync components do not cover your data.Custom network behaviour
Field synchronizationYou need TSMP to encode a public field.Scripting API: TransSync
TSMP RPC eventYou need delayed event delivery through the texture stream.Scripting API: TSMPNetworkBehaviour
Codec packageYou need a different byte-to-pixel representation.Custom codec
Codec shaderYou need dedicated encode/decode shader logic.Codec implementation guide
Protocol toolingYou need tests, validators, or debug tools.Frame algorithms

For member-level API details, see the separate Scripting API section.

Detailed paths

GoalRead
Add synchronized variablesCustom network variables
Add delayed texture-stream eventsCustom network RPC
Pack dense data into one fieldCustom packed data
Build a codec packageCodec package definition
Write codec shader passesCodec shaders
Validate byte recovery and runtime supportCodec validation

Compatibility goals

TSMP code is written to run in two environments:

  • Unity C# and editor runtime.
  • UdonSharp compiled runtime.

The same component should usually work in both environments. Avoid APIs that UdonSharp cannot compile, and prefer simple fields, arrays, and explicit methods over reflection-heavy runtime logic.

Design rules for extensions

  • Keep scene-facing components explicit and easy to inspect.
  • Use [TransSync] fields for data, not side effects.
  • Pack high-frequency values into byte[] to reduce Udon bridge cost.
  • Let TSMPSetup rebuild bindings after scene structure changes.
  • Do not hard-code optional codec packages in Core or encoder code.
  • Keep custom codecs behind the TSMPCodec API.
  • Treat the texture path as unreliable and validate with debug counters.

Namespace layout

NamespacePurpose
K13A.TSMPCore runtime, protocol, encoder, decoder, codec base types, setup, debug utilities.
K13A.TSMP.UdonNetwork behaviour base type and built-in TSMP network components.

Unity-facing component names keep the TSMP prefix. Internal helper types may not.

  1. Implement the smallest component or codec path.
  2. Run Apply Setup.
  3. Confirm payload bytes and message counts in TSMPDebugCanvas.
  4. Test Unity Play mode.
  5. Compile UdonSharp.
  6. Test in a real VRChat runtime path when the feature depends on Udon or capture behaviour.