This automation eliminated the large amount of time spent copy/pasting content from Twine, as well as the connecting of each node by hand
Brought on to help improve the narrative pipeline for an unreleased project, I eliminated the timely process of a designer manually having to transfer over each node from the Twine project used for prototyping and the Adventure Creator plugin used for narrative implementation.
My conversion tool works in a few steps:
- It reads through the entire .twee file, identifying where decision trees need to split or variables are modified and checked.
- It then assembles the data parsed from twine to C# and builds a directed graph of nodes, either hubs (where a decision takes place), chains (multiple lines of dialogue in a sequence) or branches (where variables are checked).
- Finally, by reverse engineering Adventure Creator I was able to automate the Node graph building process by calling its internal create node functions via C# reflection. The tool walks the directed graph of data nodes and builds each node to work in the AC Action system. It also creates Conversation MonoBehaviors in the scene as required by AC and saves all variables into AC's varaible manager.
- The graph is then saved as an ActionListAsset and ready for use in the scene!