游戏库

用 Universal Modder 改 Terraria(泰拉瑞亚)

Universal Modder 就是从 Terraria 起步的。它的第一个完整示例 Fal Arsenal 加入了追踪导弹发射器、能把世界炸出大坑的战术核弹、链式闪电步枪、黑洞枪、三种新敌人和一个两阶段的无人机母舰 Boss,所有精灵图都由 fal 生成。

更新于 2026-09-28

实战笔记2
可用 / 已发布2
引擎.NET / XNA / FNA
路线Mod 加载器 API

Universal Modder 如何处理 Terraria

Terraria 运行在 .NET(XNA/FNA)上,所以路线是 tModLoader:Terraria 拥有者可在 Steam 上免费获取。Agent 用 ILSpy 反编译,弄清原版物品、弹幕和 NPC 的工作方式,编写 C# Mod 类,并在一个可丢弃的世界里验证。精灵图来自 fal,再用 um sprite 抠图并缩放到 Terraria 的精确尺寸。

加载器 / 工具用途
tModLoader社区官方加载器,Terraria 拥有者可在 Steam 上免费获取。

Agent 用到的工具: ilspycmd · numpy · numba · PufferLib 3 · PyTorch · fal serverless (training) · tModLoader · fal (flux/dev) · um sprite · ffmpeg gfxcapture · ProcLoopback

可用的版本: Terraria 1.4.5.8 (decompiled), tModLoader 1.4.4.9 base for the in-game agent | Terraria 1.4.4.9 via tModLoader 2026.07 (GitHub build), Steam; vanilla 1.4.5.8 decompiled for reference

在 GitHub 阅读引擎手册 →

开始一次 Terraria 会话

终端
um kb search "Terraria"
um scan "Terraria"
提示词
给 Terraria 做个 Mod:加一个追踪导弹发射器和一颗能把世界炸出大坑的战术核弹。精灵图用 fal 生成。
提示词
给 Terraria 加一把回旋镖:在敌人之间弹跳四次后返回。

Terraria 实战笔记(2)

摘要和踩坑记录以英文原文引自 universal-modder 的 MIT 协议知识库,每条都链接到完整笔记。

可用Mod 加载器 API.NET / XNA / FNA

An RL agent that beats the Eye of Cthulhu: decompiled boss AI to a simulator, then back into the real game

The Eye of Cthulhu fight was ported from Terraria's decompiled source into a vectorized simulator: boss AI, servants, player physics, gun and damage rules. A PufferLib PPO agent trained in it (99.7% win rate in the sim), and the policy was exported to C# and runs inside the real game through a tModLoader mod. Real traces were replayed against the sim…

版本
Terraria 1.4.5.8 (decompiled), tModLoader 1.4.4.9 base for the in-game agent
反作弊
none (single player)
制作者
Claude Code (Opus 5.5)
日期
2026-09-28
记录了 6 个坑
  • Trace replay disagreed on every dash.
  • The numba sim slowly diverged from the numpy one.
  • The player moved faster in the real game than in the sim.
  • PufferLib 3.0.0's sdist wouldn't build.
  • Serverless training failed to start.
  • Recording from inside the mod leaked memory.
在 GitHub 阅读完整笔记 →
可用Mod 加载器 API.NET / XNA / FNA

Fal Arsenal: missiles, a tactical nuke, new enemies and a boss for Terraria

Five weapons (homing missile launcher, a tactical nuke that craters the world, a chain-lightning rifle, a black-hole gun, an orbital strike), three new enemies and a two-phase Drone Mothership boss. All sprites were generated with fal. It's built as a tModLoader mod, tested in game, and recorded for an X video that got ~400k views. Code:…

版本
Terraria 1.4.4.9 via tModLoader 2026.07 (GitHub build), Steam; vanilla 1.4.5.8 decompiled for reference
反作弊
none (single player)
制作者
Claude Code (Opus 5.5)
日期
2026-09-28
记录了 7 个坑
  • Recording from inside the game leaked 17 GB of memory in one take.
  • SDL_AUDIODRIVER=disk recorded nothing.
  • The recording's tail was lost.
  • Takes stopped matching.
  • tModLoader refuses to start.
  • The agent killed its own shell.
  • Sprites came out with grey fringes or a floor shadow.
在 GitHub 阅读完整笔记 →

常见问题

Terraria 适合作为 Universal Modder 的第一个游戏吗?

适合。tModLoader 很成熟,代码是易读的 .NET,仓库里还有一个完整示例可以学习。

Universal Modder 能改 Terraria 吗?

能。Universal Modder 知识库里有 2 篇 Terraria 的实战笔记,其中 2 篇(共 2 篇)标为可用或已发布。用过的路线:Mod 加载器 API。

哪些 AI Agent 改过 Terraria?

Claude Code。Universal Modder 在 Claude Code、Codex、Cursor、Gemini CLI、Copilot 和 OpenCode 中的用法都一样。

用 AI Agent 改 Terraria 安全吗?

只在单机、离线模式或你自己架设的服务器里玩,先备份存档(Agent 会运行 um backup),绝不发布游戏文件。这个游戏记录的反作弊情况:none (single player)。