Building Terafyn

Hi all!

We thought it’d be great to give everyone an overview of the engine, tools and development process we used to build Terafyn.

In the early stages of this project, we put a lot of thought into tools and processes to best enable us to fully realize the world of Terafyn. Like many other developers these days, we chose to build Terafyn inside Unity. The rapid iteration time and ease of cross-platform builds that Unity provides have been invaluable over the past few months. Many productivity boosts provided by Unity are almost universally applied to all projects, but today we'd like to take a broad look at three key tools that we've built or leveraged on top of the standard Unity editor to take it to the next level.

First and foremost is the actual content. We wanted Terafyn to feel like a living, breathing world, and that meant we couldn't rely on a limited set of hard-coded actions and events. Instead, we set out to develop truly-content driven gameplay systems. To achieve this, a couple key decisions were required. First, all game content would be defined in Unity's ScriptableObject containers. These allow for an easy method of exposing and tweaking content inside the Unity editor. Second, most of these ScriptableObject containers would be visual-script like node-graphs. In order to achieve this goal, we built a complex node system on top of the open source XNode library (https://github.com/Siccity/xNode), along with a library of nodes to enable the content itself to drive gameplay. Almost every piece of content in Terafyn, every card, item, conversation, effect, location, AI, NPC, etc., is defined by a node-graph. Instead of coding gameplay systems, we coded systems to evaluate these node-graphs, allowing every moment of gameplay to be driven by the current state of the world and the objects within it. It also allowed us to rapidly iterate on gameplay by simply rearranging the node graphs of base objects.

Secondly, we knew we wanted to deliver Terafyn as an episodic experience. This type of thing can actually be a headache in the vanilla Unity editor. We reached for Unity's new Addressable asset system (available via the Unity package manager) to enable a great episodic workflow. The Addressable system changes the way that Unity typically references assets to a more decoupled system. This decoupled nature of the asset references means that it no longer matters where an asset is serialized (ie, is it part of the main build or part of a separate episode bundle). In addition to Addressables, we built an editor tool called the Content Browser to easily parse through content and automatically bundle it by type and episode. And, of course, we built Addressable reference nodes so the content driven gameplay could take full advantage of these decoupled references. Events in these graphs would no longer be linked directly to content or actions, but instead to addresses that could lead to different end points depending on how the game has unfolded.

Finally, it was important to us that Terafyn was playable on as many devices as possible. This of course meant supporting both iOS and Android, but it also meant designing flexible UI systems that could work on devices of many different form factors. In the past, this required actually testing on tens or even hundreds of different physical devices. We again went to the Unity package manager to improve this workflow, this time by importing the Device Simulator package. The device simulator allows the Unity editor to emulate the screen size and shape (important now in the era of notches and camera punch-holes) of any device. With that, we could rapidly test dozens of devices in minutes rather than hours.

Tweet us @terafyncom if you’d like to hear more about how we’re building Terafyn. We're very excited with the progress that these tools have allowed us to make, and we can't wait to share it with you!

Example node-graph below:

NodeGraph.png