Documentation

Titan Twin guide

Everything from installation to alarms. The same documentation ships inside the plugin under Docs/.

Installation

  1. Install Titan Twin from Fab into your engine, or copy the TitanTwin folder into your project’s Plugins folder.
  2. Open the project, go to Edit > Plugins, search for Titan Twin, enable it and restart the editor.
  3. All settings live under Edit > Project Settings > Game > Titan Twin …

Requirements: Windows 64-bit and an Unreal Engine version matching the package (5.5, 5.6 or 5.8). Pixel Streaming features additionally need Epic’s Pixel Streaming or Pixel Streaming 2 plugin.

All modules ship in one plugin. Modules you do not configure stay idle: no connection is opened until you enable it.

First-run checklist

Review these defaults once per project.

SettingDefaultRecommendation
Titan Twin Backend › Auto ConnectOnTurn off unless you run a Titan Twin compatible backend; otherwise the plugin retries ws://127.0.0.1:8080 and logs warnings.
Titan Twin History › Recording / PersistenceOn / OnTurn off if you do not need history. Files go to Saved/TitanTwin/History.
Titan Twin Alarm › Persistence EnabledOnTransitions are written to Saved/TitanTwin/Alarms.
Titan Twin Runtime › History / Alarm / Command OwnerUE Local ServicesKeep unless a backend owns them.
MQTT / OPC UA / HTTP / Pixel Streaming auto startOffEnable only the adapters you use.

Quick start: one MQTT value on one actor

Goal: the topic factory/Robot01/Temperature with payload 86.5 shows up in a Blueprint variable of the actor Robot01.

  1. Mark the entity. Add a Twin Entity Component to the robot actor. On the placed instance, set Entity Id to Robot01.
  2. Add a binding. Add a Twin Property Binding Component with Source Property Name Temperature, Target Scope Owner Actor and Target Variable Name DisplayTemperature (a float or text variable).
  3. Connect MQTT. In Titan Twin MQTT set Host and Port, add a subscription with Topic Filter factory/+/+, Payload Format Scalar, Value Type Auto, and enable Auto Connect.
  4. Map addresses. In Titan Twin Data Sources enable Enable Automatic Mapping and Enable Runtime Rule Mapping, then add the rule factory/{entity}/{property}.
  5. Play. Publish 86.5. DisplayTemperature updates. Add an alarm rule to turn the robot red above 80.

For production projects prefer explicit mapping assets: they are reviewable and versioned with your content.

Key concepts

  • Entity — an actor with a Twin Entity Component. EntityId is its stable external name.
  • Property sample — value + UTC timestamp + quality (Good, Uncertain, Bad, Unknown) + unit + source. Types: Boolean, Integer, Number, Text, Vector, Rotator.
  • Data point — what an adapter produces: source id, address (topic, NodeId, field path…) and value.
  • Mapping — decides which entity property a data point updates.
  • Game thread — network work runs on worker threads; all entity and Blueprint updates happen on the game thread through bounded queues.

Entities have three independent states: Connection (Online / Offline), Operational (Idle / Active) and Health (Normal / Warning / Fault). A sample older than the current one is ignored, so late or duplicated network data cannot roll a value back.

Mapping

A mapping says: data from SourceId at Address goes to EntityId.PropertyName. Resolution order: explicit mappings for the same source and address, then explicit mappings with source None, then automatic rules.

Explicit mapping assets

Create a Data Asset of type Twin Data Source Mapping Asset, add entries (Source Id, Address, Entity Id, Property Name, optional unit) and add it to Titan Twin Data Sources › Mapping Assets. Runtime: Register Mapping, Register Mapping Asset, Clear Mappings.

Automatic rules

Templates with exactly one {entity} and one {property}; other placeholders match one segment and are ignored.

factory/{entity}/{property}
site/{site}/line/{line}/{entity}/{property}
ns=2;s={entity}/{property}
  • Enable Automatic Mapping (editor): matches are saved to a mapping asset for review. Optional last-two-segments fallback.
  • Enable Runtime Rule Mapping: rules evaluated at runtime, including packaged builds.
  • Buffer Missing Entity Samples: values for entities that spawn later are kept and applied on registration.
Queue settingDefault
Max Pending Points / Bytes8192 / 32 MB
Max Points Per Pump512
Pump Time Budget2 ms
Clamp Future TimestampsOn (more than 5 s ahead → receive time)

Diagnostics: Get Metrics, Get All Source Statuses, Preview Data Point.

MQTT

Native MQTT 3.1.1 client on its own thread. Host, Port, optional TLS (engine trust store plus optional CA file, host names verified), Clean Session, Client Id, Keep Alive, auto reconnect with back-off. Credentials come from the environment variables TITAN_MQTT_USERNAME / TITAN_MQTT_PASSWORD.

Payload formatExample
Scalar86.5, true, RUN
Json{"value":86.5,"timestamp":1731400000,"quality":"good","unit":"C"}
JsonBatch{"line":"L1","devices":[{"id":"A","t":12}]} — one message, many entities, applied all-or-nothing

Timestamps: ISO-8601 or Unix seconds / milliseconds. Binary payloads are ignored without dropping the connection. Optional command transport over JSON envelopes.

OPC UA

Client based on open62541. Endpoint opc.tcp://host:4840, security mode None, Sign or Sign And Encrypt. None is refused unless you explicitly allow it; secure modes need a client certificate, private key and trusted server certificates.

  • Monitored nodes: ns=2;i=1001 or ns=2;s=Machine/Temperature, with sampling interval and queue size.
  • Automatic discovery subscribes variables whose string NodeId contains / or ., ready for templates like ns=2;s={entity}/{property}.
  • Writes convert to the node’s real data type without loss, or fail with a type mismatch. Command routes map Entity + Command to a NodeId.

HTTP

Polls any number of HTTP(S) endpoints with timeouts, retries and size limits. Bearer token from TITAN_HTTP_TOKEN, only sent to configured origins.

Payload modeResult
ScalarWhole body is one value
JsonValueValue at a dot path such as sensor.temperature
JsonObjectFieldsEvery top-level field becomes <prefix>/<field>
AutoJSON if it parses, otherwise scalar

Pixel Streaming

A web page sends data into the twin and receives property updates through Epic’s Pixel Streaming input.

{"type":"twin.data","address":"factory/scene/inside","value":1}
{"type":"twin.data.batch","points":[{"address":"a/b","value":2.5}]}
{"type":"twin.message","messageType":"ui.click","payload":{"id":"pump1"}}

Browser data uses the fixed source WebUI, only accepts mapped addresses by default and is rate limited. Outbound: Send Message, Send Data Point, Publish Snapshot and automatic property exports. A JavaScript client is included.

Backend (optional)

The Backend Connector talks to a Titan Twin compatible server over WebSocket (data, alarm snapshots, command updates) and HTTP (queries, alarm actions, commands). Without a server, keep UE Local Services and turn off Auto Connect.

Property bindings

The Twin Property Binding Component writes entity properties into variables without Blueprint wiring.

  • Targets: owner actor, a component, a widget from a Widget Component, or an Anim Instance.
  • Types: bool, integers, enums, float, double, String, Name, Text, Vector, Rotator, and UMG TextBlocks.
  • Formatting: fractional digits, grouping, prefix and suffix.
  • Bad or uncertain samples keep the last good value unless you accept them. Maximum Sample Age reports stale data.

Each binding reports Sample Status and Last Error; Validate Bindings checks targets without writing.

Alarms

Create a Twin Alarm Rule Set Data Asset and add it to Titan Twin Alarm › Rule Sets.

  • Targets by Entity Id, type or Gameplay Tag query; signals from a property or entity state.
  • Operators from Greater to Contains, recovery threshold (hysteresis), debounce, delays and cooldown.
  • Severity Information → Emergency, message placeholders {EntityId} {Value}, latching and auto close.
  • Lifecycle Active → Acknowledged → Resolved → Closed, with flood protection.

Every entity also gets summary properties such as Alarm.ActiveCount and Alarm.HighestSeverity. The Twin Alarm Response Component sets variables, recolors widgets or calls a Blueprint interface when alarms change.

Commands

Send commands to remote devices and follow them through Pending, Accepted, Running, Succeeded, Failed, Canceled, TimedOut or Rejected.

  • OPC UA: a command route becomes a node write.
  • MQTT: JSON envelopes; the device answers with acknowledgement, progress and result.
  • Backend: HTTP request to your server.

To receive commands in Unreal, add a Twin Command Endpoint Component, list the allowed commands (none by default) and implement Twin Command Handler. Repeated command ids are not executed twice.

Commands can reach physical equipment. Keep device-side interlocks and permissions in place; the plugin does not replace them.

History (optional)

Records property samples and state changes in memory and, if persistence is on, as JSON Lines. Query with Query Memory or Query History Async; replay with Start Replay, Pause, Seek, Stop. Turn Recording Enabled off if you do not need it.

Known limits

  • Win64 only.
  • One MQTT broker and one OPC UA endpoint per project; HTTP supports many endpoints.
  • No arrays, structures or OPC UA types such as LocalizedText and DateTime.
  • Values are copied as-is: scaling or bit extraction happens upstream or in Blueprint.
  • Default throughput limit is 512 points per pump (about 30,000 per second at 60 FPS); raise it at the cost of game-thread time.

Troubleshooting

  1. Nothing arrives. Check the adapter’s Get Metrics and the log categories LogTitanTwinMqtt, LogTitanTwinOpcUa, LogTitanTwinDataSource.
  2. Data arrives, property unchanged. Run Preview Data Point with the source and address; check UnmappedPoints and MissingEntityTargets.
  3. Property changes, variable unchanged. Run Validate Bindings and read each binding’s Last Error.
  4. Timestamps jump. Device clocks more than 5 s ahead of the PC are replaced by the receive time and logged.

When reporting a problem include the engine and plugin version, steps to reproduce and the first error in the log. Remove passwords and keys first.

Support

Email qiansongfu@gmail.com. Answers come from the developer.