Skip to content

[upcoming] 1. About

Luke edited this page Jun 28, 2021 · 15 revisions

The Open Terraria API, known as OTAPI, is a low-level API for Terraria that rewrites and hooks into the official binaries for others to use.

It is primarily a server modification for the PC edition of Terraria, however v3 has seen additional support for the PC client assemblies, and the mobile windows server assembly too.

The upcoming branch is a ground up redesign and will take the place of the master branch when fully complete over in projects.

Significant changes this redesign brings are...

  • Modular script system, allowing single file patches using csharp(net5), javascript(clearscript) and lua(nlua)
  • A strong set of libraries with methods and extensions for use in extending or contributing back
  • .NET5 projects for all without Terraria's dependency to net4.

The stack consists upon:

  • OTAPI Scripts, a directory containing all the scripts used to patch the pc, mobile & client assemblies.
  • OTAPI Patcher, a program to process all OTAPI Scripts and produce the final OTAPI assemblies for all variants and also supports creating the NuGet packages.
  • ModFramework, a library that extends MonoMod and provides higher level patching methods and extensions, such as remapping fields to properties and arrays to collections
  • ModFramework Modules, additional plugins to add c#, javascript and lua scripts, for both patching and runtime.
  • FNA for use on the client variants, for a consistent codebase on all platforms. Servers use the Xna shims instead.
  • MonoMod for applying patches and generating runtime events/hooks.

Terraria support

Server assemblies used in the patching process are freely available at Terraria's website.
If you intend to patch a client version, you must own an existing copy of Terraria and have it installed in the default path of your machine. The OTAPI Project does not host or contain the original source file so it will side load itself into the existing installation.
On MacOS OTAPI will install itself to a new directory within the existing Terraria.app directory, and it will then backup and patch your existing launch scripts; giving us the future use to be able to switch between a vanilla environment or the default OTAPI modded environment.

All OTAPI builds support C#/lua/js scripts with reload-on-save features, however you may need to install the additional ModFramework module plugins if you use this in another project.

Variant Status Version
Windows Server for PC Cross platform NuGet package produced. OTAPI.Upcoming 1.4.2.3
Linux Server for PC not required or supported
MacOS Server for PC not required or supported
Windows Server for Mobile Cross platform NuGet package produced. OTAPI.Upcoming.Mobile 1.4.0.5
Linux Server for Mobile not required or supported
MacOS Server for Mobile not required or supported
Windows Client for PC Full support to install a patched OTAPI into an existing Windows install (steam confirmed), Xna is replaced with FNA and x64 enabled. 1.4.2.3
MacOS Client for PC Full support to install a patched OTAPI into an existing MacOS install (Steam/Gog confirmed) 1.4.2.3
Linux Client for PC not yet supported but planned. should be similar to MacOS
iOS Client not supported or planned
Android Client not supported or planned