MCPcopy Index your code
hub / github.com/MercuryWorkshop/terraria-wasm

github.com/MercuryWorkshop/terraria-wasm @1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0 ↗ · + Follow
90 symbols 142 edges 18 files 0 documented · 0% updated 12mo ago1.0 · 2025-05-17★ 17511 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Terrarium

A port of Terraria to the browser using WebAssembly and fna-wasm-threads

Read the writeup for more information on how this works. image

I want to host this on my website

Go to the releases page and download the latest release. Extract the contents of terraria-wasm-build.zip to your web server. Cross site isolation headers are required for this to work, so make sure your web server is configured to send the following headers:

Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin

I want to build this

Prerequisites

  • A x86_64 Linux system
  • dotnet 9.0.4
  • the mono-devel package on your distro
  • node and pnpm
  • Terraria (Linux or Windows build)
  • ilspycmd (SPECIFICALLY VERSION 9.0.0.7889) it's recommended to install ilspycmd using the .NET CLI
dotnet tool install --global ilspycmd --version 9.0.0.7889

Building

  1. Clone the repository (make sure you use --recursive!!)
  2. Decompile Terraria
bash tools/decompile.sh ~/.local/share/Steam/steamapps/common/Terraria/Terraria.exe
  1. Apply Patches
bash tools/applypatches.sh Vanilla
  1. Build the project
make serve

To build the frontend for production, run:

pnpm vite build

Extension points exported contracts — how you extend this code

ImportMetaEnv (Interface)
(no doc)
src/vite-env.d.ts
ImportMeta (Interface)
(no doc)
src/vite-env.d.ts

Core symbols most depended-on inside this repo

proxyConsole
called by 5
src/game.ts
extractTar
called by 3
src/fs.tsx
consume
called by 3
src/fs.tsx
next
called by 2
src/app.tsx
copyFile
called by 2
src/fs.tsx
copyFolder
called by 2
src/fs.tsx
createEntry
called by 2
src/fs.tsx
initSteam
called by 2
src/game.ts

Shape

Function 64
Method 21
Class 3
Interface 2

Languages

TypeScript70%
C#27%
C3%

Modules by API surface

src/fs.tsx22 symbols
terraria/Program.cs14 symbols
src/splash.tsx13 symbols
src/game.ts11 symbols
terraria/CloudSocialModule.cs10 symbols
src/main.tsx7 symbols
terraria/Emscripten.c3 symbols
src/ui/Button.tsx3 symbols
src/vite-env.d.ts2 symbols
src/app.tsx2 symbols
src/ui/TextField.tsx1 symbols
src/ui/Switch.tsx1 symbols

For agents

$ claude mcp add terraria-wasm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page