Skip to content

Adapting a plugin ​

Version 0.1.1 – 2026-11-24

All three official plugins are MIT licensed and are meant to be forked. This page is the practical companion to Writing your own integration: how the three implementations are laid out, which parts move to a new engine without much thought, and traps to avoid when building them.

You may fork, vendor, or copy individual files to your project, or read them and write your own. All of it is allowed, and you do not need to ask us for permission or notify us, although we appreciate it if you tell us about your projects.


When to adapt rather than use ​

When you are on an unsupported engine version. We support only the latest Godot 4.x, Unity 6 and newer, and Unreal Engine 5.8. The plugins are not doing anything exotic, so back-porting is usually a matter of the engine API surface rather than the dialogue logic.

When you are on an engine we do not cover. Start from the data contract and use the plugins as examples – the same logic in three languages makes it much easier to see which parts are essential and which ones are engine idiom.

When our shape is wrong for your project. You may already have a save system, an asset pipeline, a UI framework, and a scripting layer. Taking the traversal core and dropping everything else is a perfectly good outcome – the traversal core is the part that is hard to get right.

When you need behaviour we do not provide. Our plugins support a range of basic player experiences. If yours is different, go ahead and change it. There is no plugin API we are asking you to stay inside.


How the implementations are laid out ​

All three follow the same six layers, bottom to top. The names differ; the structure does not.

LayerGodotUnityUnreal EnginePorts how?
Loggingcore/tarinoi_logger.gdRuntime/TarinoiLog.csthe LogTarinoi categoryTrivially. Level-gated, no dependencies.
Storecore/db.gd, core/data_access.gdRuntime/Data/*Tarinoi/Data/*Mostly. SQLite schema, the two-layer merge, and an overridable query seam. The merge logic is engine-agnostic; the SQLite binding is not.
Synccore/api_importer.gd, core/importer.gdRuntime/Sync/*Tarinoi/Sync/*Mostly. NDJSON paging, a resumable cursor, layer-aware upserts. The HTTP client is engine-specific; the protocol handling is not.
Expressionscore/expression_parser.gd, core/dispatcher.gdRuntime/Expressions/*, Runtime/Bindings/*Tarinoi/Expressions/*, Tarinoi/Bindings/*Directly. Lexer, recursive-descent parser, typed AST, short-circuit evaluation, a parse cache. This is pure logic – port it almost line for line.
Runtimeautoload/TarinoiRuntime.gdRuntime/TarinoiRuntime.csTarinoiRuntime.*, TarinoiSubsystem.*Directly, and carefully. The traversal state machine. Every rule in the contract lives here.
Editor tooling & UIplugin.gd, codegen/, scenes/, nodes/Editor/*, Runtime/Ui/*, Runtime/Components/*TarinoiEditor/*, Tarinoi/Ui/*, Tarinoi/Components/*Not at all. Entirely engine idiom – rewrite it.

Roughly the middle two-thirds are easily portable, whereas the top and bottom layers are not. The expression evaluator and the traversal state machine are the parts that a port needs to get right. The editor integration is engine-specific and should be built according to your engine's conventions rather than copying from the Godot, Unity, or Unreal plugin.


Port the tests before you trust the port ​

The Godot plugin's test/test_runtime.gd, the Unity package's runtime tests and the Unreal plugin's Tarinoi.Runtime automation specs cover the same state machine – transparent cards, geo.y ordering, deferred function evaluation, condition routing, pin selection, system lines, the loop guard, visited history, and the layer merge.

These tests are the most valuable ones to adopt. Traversal has many rules and most of them fail silently: a wrongly ordered choice list is technically correct but not what the author intended, a condition that is always true may silently make content inaccessible, or a revisitable shown_once card with an AddGold( 100 ) function invocation looks fine right up until a player finds the infinite gold exploit. If you port these tests over first, you will have all the rules covered and will avoid a lot of these subtle bugs.

Two practices worth adopting:

Build a fresh runtime per test. The runtime holds dialogue state, caches, and a database handle. Sharing one across tests makes failures order-dependent, which is fragile.

Verify a new test fails against the old code. When you fix a bug, stash the fix and confirm the test goes red.


Traps to avoid ​

These are subtle errors that follow from misunderstandings about data structures. Every one of them is a consequence of the contract being easy to implement almost correctly.

Choices sorted by connection order rather than geo.y. Writers place cards in the order in which they want choices to appear, from top to bottom. The raw connections array is not sorted, and you should not rely on it for order. It usually looks right, because authors often wire cards top to bottom anyway. You should also account for three special cases: cards without geometry sort last, not to zero – authored Y coordinates are routinely negative; ties must break by source order, since most sorts are not stable; and if your API indexes choices positionally, reassign the indices after sorting.

Null has no boolean coercion. An expression evaluating to null – an unbound collection, say – is raised as an exception rather than failing the condition. An unbound anything should degrade to false and log. Authoring mistakes should not crash a dialogue.

The two-layer merge implemented in the wrong place. Uncommitted cards live in the buffer layer, which needs to be merged into the main layer to reproduce the state authors see in Tarinoi. Implement the merge in exactly one place, and if you have both a SQL and an in-memory path, hold them to the same semantics by test.

List references resolved by row order instead of identifier. A dropped identifier column makes every Ls.* reference resolve to zero. If the list is numeric – say, difficulty thresholds – this produces plausible numbers rather than errors.

Generated variable accessors are not virtual, while functions / methods are. Games that want variables to come from a save system have to abandon the generated class entirely, losing the typed members and the authored defaults. If you generate code, make it overridable symmetrically.

Generated code lands in an assembly nothing can reference. The API bindings and reference implementations generated by the Tarinoi plugin is both per-project output and a compile-time dependency of hand-written code, and those two facts fight. Decide deliberately whether the generated folder is committed, and say which in your README – otherwise a fresh clone does not compile and the first thing a new team member sees is errors.


Engine-specific traps ​

Unity: ConfigureAwait(false) in library code, but not in the runtime. The sync layer uses it, but the runtime deliberately does not, because its events have to reach game code on the main thread. The consequence is that blocking on a runtime call – .GetAwaiter().GetResult() – deadlocks the editor against a real store. It does not deadlock against a fake store that completes synchronously. Await runtime calls.

Unity: reflection-based dispatch can be stripped by IL2CPP. A reflective binding that works in the editor can vanish in a player build. Generated bindings dispatch through an explicit switch for this reason.

Unity: a UI test that counts widgets cannot see an invisible UI. Assert rendered size, not just presence, and give any walk-the-flow test a positive assertion about what it passed through: "no panel is up and the state is Idle" is indistinguishable from a dialogue that stopped at the first choice.

Unreal: the engine's SQLite allows one connection per database file. Under the default build setting (bCompileCustomSQLitePlatform), SQLiteCore runs on Unreal's file layer with no shared memory and no locking: a second connection to an open file fails to open, and a connection is not thread-safe. The Unity design – a background writer connection beside the runtime's reader – does not carry over. Share one connection per file, use it from the game thread, and keep the network I/O asynchronous instead. Changing that build setting forces a unique build environment on the whole game, and a plugin shouldn't do that.

Unreal: FString maps and sets ignore case. TMap<FString, …> hashes and compares case-insensitively, so Global and global land in one slot. Authored identifiers, document ids (mixed-case) and expression source text are all case-sensitive; a case-insensitive parse cache would hand Fn.Global.X the parse of Fn.global.X. Use case-sensitive key functions for all of them. The automation framework's TestEqual for strings ignores case too.

Unreal: generated headers must have unique names across the whole build. UnrealHeaderTool rejects two headers with the same file name anywhere in a target, and UCLASS names are global (there are no namespaces). Anything compiled beside a game's own generated bindings – a test fixture, say – needs distinct file and class names.

Unreal: a widget's Slate side is rebuilt more often than it is created. The first TakeWidget() runs a widget's construct/destruct cycle; unbinding game events in NativeDestruct silently drops them. Tie event bindings to the widget object, not its Slate lifetime.

Godot: Dictionary.get() with a default does not apply when the key exists with a null value. A payload field present but null returns null, not your default, which then fails a typed cast at the call site. Check for null explicitly on anything coming out of a document payload.

Godot: var x := <expr> fails to parse when the type cannot be inferred. Concatenating an untyped loop variable is the common case. Worse, the GUT test runner silently skips a file that fails to parse – check the script count in the summary, not just the pass count.


Telling us about it ​

If you build an integration for another engine, we would like to link to it from Game Engine Plugins. We are not asking for contributions back, and there is no approval process – MIT means MIT. But a second implementation is the best test the data contract gets, and if you find a place where this documentation is wrong or incomplete, please let us know – it would be a great help to us.