🇷🇺 На русском: README_RU.md
Tools that came out of translating The Legend of Heroes: Trails from Zero (PC port) into Russian. Everything here is what you need to put your own alphabet into the game and ship a working build — the same toolchain the Russian translation uses end-to-end.
- Trails from Zero — Steam, build 1.4.13. Every tool here was developed and round-tripped against this build.
- Trails to Azure — same engine, same data formats. The
dt-tools/decompilers and thefont/builder apply directly. The five binary patches inbinpatch/targetzero.exespecifically and are not yet ported to Azure's executable.
On other PC revisions of Zero the patch byte offsets may differ. The
Ghidra scripts in binpatch/research/ reproduce
the analysis if you need to find the equivalents on a different
binary.
The PC port already supports Japanese, English and a baked-in Russian,
so the obvious starting point is to swap strings in the existing data
files. That works for English (proper font, 1-byte ASCII). It doesn't
work for Russian as shipped: the built-in glyphs render packed
together like kana, layouts overflow, and a handful of fields hit
hard length caps. Replacing the font with a real TTF fixes the look
but not the lengths. The fix for the lengths is to encode every
letter as 1 byte (in the SJIS halfwidth zone the engine already
understands as 1-byte slots) — and that works almost everywhere,
except in five text formatters that silently drop bytes above 0x7F.
We patched those five spots in zero.exe. That's the toolkit: the
font builder, the data-table re-encoder, and the five binary patches.
Pick one. The choice is determined by the language you're translating into, not by preference:
-
Path A —
passthrough. For languages the game already supports natively (Japanese, English) or for tweaking strings in the stock Russian build. Letters encode as standard 2-byte SJIS or 1-byte ASCII, exactly like the original files. You only needdt-tools/in--passthroughmode. This path will not work for any language without a proper font in the game, including Russian as shipped — you'll hit the layout / length / readability problems that path B was built to solve. -
Path B —
halfwidth. For any language with no proper font in the game (Russian, Ukrainian, Greek, Hebrew, …). The full pipeline is mandatory; nothing here is optional. You need all three components:font/— build a customfont.itffor your alphabet.dt-tools/in--halfwidthmode — re-encode every translated._dtto 1 byte per letter.binpatch/— apply the five surgical patches tozero.exeso the engine stops dropping halfwidth bytes.
Skip any one of the three and the build will look broken in non-obvious ways: missing letters, random truncation, infinite loops on item descriptions.
| Folder | Path A | Path B | What it does |
|---|---|---|---|
dt-tools/ |
yes | yes | Decompilers / compilers for the game's ._dt data tables. Step-by-step usage, the two encoding modes, drag-and-drop interactive flow, and the substitution-table reference are in its README. |
font/ |
optional | required | Builder for font.itf. How to build, how to retarget it for a different alphabet, and the required game-side input file are all in its README. |
binpatch/ |
no | required | Five tiny patches to zero.exe for halfwidth mode. Apply / revert flow and the patch table are in its README; ASM-level deep-dive in PATCHING_NOTES.md. |
Game paths to know:
._dtdata tables →<game>\data\text_us\- Font →
<game>\system_us\fontdat\font.itf - Scenarios (separate module, not in this repo yet) →
<game>\data\scena_us\
Common prereqs: Python 3.6+, pip install freetype-py (only for the
font builder), a copy of the game, and a TTF that contains your
alphabet's glyphs. Always make backups of zero.exe,
system_us\fontdat\font.itf and any ._dt you plan to edit before
you start.
- Edrahor — toolkit, packaging,
byte_codec,._dtcompilers (books, items, memo, shop, town), binary-patch reverse engineering, docs. - Ivdos — original
font.itfbuilder (font/glyph.py) and original quest decompiler (dt-tools/dt_quest.py). Both adapted for this toolkit.