Skip to content
Luke edited this page Jul 27, 2021 · 1 revision

What is Open-Terraria-API?

Open-Terraria-API, known as OTAPI, is an API for modification development for Terraria. The API is injected into the Terraria binary through the OTAPI Patcher. The patched assembly will now expose the OTAPI. OTAPI is the combination of the OTAPI patcher as well as the defined OTAPI modifications for the patcher to perform.

Why is Open-Terraria-API?

The point of OTAPI is to provide a low level baseline consisting of hook points, vanilla class replacements, and optimizations to build on top of for the purpose of game modification.

How is Open-Terraria-API?

OTAPI uses IL patching in order to inject code into existing .NET assemblies. These assemblies are the Terraria game assemblies. The patcher is run and pointed at the Terraria assembly as well as pointed at the OTAPI modifications. The process functions something like this:

Run patcher: patch.exe --source TerrariaServer.exe --modify OTAPI.Modifications\**\OTAPI.Modification.*.dll --out OTAPI.dll

The patcher will now:

  • Load the source assembly.
  • Yield all the ModificationBase instances from the --modify glob.
  • Run the modifications which do the rewrites.
  • ILRepack all the types from the modification satellite assemblies into the output.
  • Write output.

Who is Open-Terraria-API?

OTAPI started with DeathCradle and has evolved to its current state with some collaboration from the Nyx Studios team.

Where is Open-Terraria-API?

OTAPI v2 is currently in early active development with help from Nyx. The project is available under the v2 branch of the OTAPI Repo on GitHub. It is licensed with the MIT License.

When is Open-Terraria-API?

Soon(TM)