# Xenosaga Episode II Python Extractor Open up **Xenosaga Episode II: Jenseits von Gut und Böse** (PS2) on your computer. Look at the characters in Blender, listen to the music, read every line of the script, repaint a texture, or translate the whole game into your own language, even one written in an alphabet the game never had.
KOS-MOS and Shion walking: the kit's .glb files, animated with clip 1 of each character's motion file, rendered in Blender An Arabic line in the field message box, drawn by the game from a font the kit rebuilt A Hindi subtitle over the opening movie, drawn by the game
KOS-MOS and Shion, taken out of the game
with their own animation, shown in Blender
The game speaking Arabic, right to left
(PS2 emulator, a disc the kit made)
Hindi subtitles on the opening movie
(the same disc)
## What is this? A free toolkit that reads your own copy of the game and turns what is inside into ordinary files: pictures you can open in any image viewer, 3D models for Blender, music and voices you can play, movies, and the game's text as plain text you can edit. When you change something, the kit writes a new copy of the disc with your change in it. It checks every byte it wrote, and it never touches your original. **Bring your own discs.** The kit contains no game data. You need the USA discs (SLUS-20892 and SLUS-21133); the Japanese discs and the *Xenosaga Freaks* demo can be read too. Every picture and sound on this page was made by the kit, or captured from the game running in PCSX2 (the PS2 emulator) from a disc the kit changed. Nothing is retouched. > **An AI project, made for people.** This kit was built with the help of > AI, and its whole purpose is to make human work possible: your own > translations, mods, art, videos and research. The goal is for more people to > do more things with Xenosaga, and to carry it to every corner of the world in > their own languages. It is not here to replace translators with machine > translation. AI projects don't have to be anti-human; this one is for the > people who love the game. This kit has two siblings, built the same way: [Episode I](https://github.com/LinuxJessi/Xenosaga1PythonExtractor) and [Episode III](https://github.com/LinuxJessi/Xenosaga3PythonExtractor). New here? **[The tour](docs/TOUR.md)** shows everything the kit does, with real examples. **Contents:** [Getting started](#getting-started) · [What you can do](#what-you-can-do) · [Models](#models) · [Animation](#animation) · [Changing textures](#changing-textures) · [Translating the game](#translating-the-game) · [Another alphabet](#translating-into-another-alphabet) · [Audio samples](#audio-samples) · [Movies, fonts and menus](#movies-fonts-and-menus) · [The window](#the-window) · [Other discs](#regions-and-the-demo-disc) · [Good to know](#good-to-know) · [All the guides](#docs) · **[Fun facts](docs/FUN-FACTS.md)** ## Getting started **The easy way: download the app.** On the Releases page, download `Xenosaga-II-Extractor-win64.zip` (Windows) or `Xenosaga-II-Extractor-macos.zip` (Mac). Everything it needs is inside; there is nothing else to install. * **Windows:** right-click the zip, choose *Extract All*, open the folder and double-click `Xenosaga-II-Extractor.exe`. The first time, Windows may say "Windows protected your PC", because the app is not signed by a paid certificate. Click *More info*, then *Run anyway*. * **Mac:** the first time, right-click the app and choose *Open*. The app opens as a page in your web browser. It finds your disc images by itself and shows one card for each job (more [below](#the-window)). A good first run is the three **Start here** cards, in order: *Unpack the discs*, *Check the unpacked files*, *Convert to files you can open*. Then open the `browse` folder it made. **Just want to translate?** Double-click `translate.command` (Mac), `translate.bat` (Windows) or `translate.sh` (Linux), and the translation editor opens on its own. More in [Translating the game](#translating-the-game).
Running from the source code, or from a terminal From a copy of this repository, double-click `launch.command` (Mac), `launch.bat` (Windows) or `launch.sh` (Linux), or run `python gui.py`. The first time, the launcher installs what it needs into a `.venv/` folder. `python build.py --editor` builds the translation editor as an app of its own, and `python build.py --all` builds both apps. From a terminal (Python 3.9 or newer): ```sh python -m pip install -r requirements.txt # once: numpy, fontTools, uharfbuzz python cli.py dump --iso "Disc 1.iso" --iso "Disc 2.iso" --out out/ --code python cli.py browse --out out/ ``` `dump` unpacks both discs into `out/dump/`, with a list of every file in `out/manifest.csv` (9,043 on the two USA discs). `browse` turns that into `out/browse/`, the folder you actually open; `--kinds` picks only some parts (`textures,models,xtx,fonts,text,scripts,audio,music,images,movies,small`). `python cli.py verify --out out/` re-checks a dump against its list. ffmpeg is used for movies and voices when it is found. `python cli.py self-test` runs every check the kit has. `python cli.py tx-selftest --iso "Disc 1.iso"` checks the translation editor against your disc (about five minutes), and `python cli.py tx-cache` shows or clears the editor's cache. What `browse` writes, folder by folder: [docs/BROWSING.md](docs/BROWSING.md).
## What you can do | | What you get | Read more | |---|---|---| | **Look at the textures** | every picture painted onto the game's models and maps, as PNG: 65,938 of them, named the way the artists named them (`shion00_hair`, `kosmos00_face`) | [BROWSING](docs/BROWSING.md) | | **Open the models in Blender** | all 944 models (characters, enemies, rooms) as 3D files, with their textures, and a posable skeleton for 562 of them | [BLENDER](docs/BLENDER.md), [MODELS](docs/MODELS.md) | | **Watch them move** | the game's own animations attached to the models: all 4,340 clips on the disc read | [MOTION](docs/MOTION.md) | | **Repaint a texture** | paint over any PNG, give it back, and get a disc copy with your picture in every place the game keeps it | [MODDING](docs/MODDING.md#editing-textures-texture-import) | | **Recolour a character** | a quick colour shift of named textures (KOS-MOS's hair, pink), with a before-and-after preview | [MODDING](docs/MODDING.md#recolouring-textures-recolor) | | **Translate the game** | every line in one page, checked as you type, built into a playable disc with one button; 382 languages to choose from | [TRANSLATING](docs/TRANSLATING.md) | | **Use a new alphabet** | Arabic, Hindi, Korean, Amharic… drawn into the game's own font; Arabic, Hindi and Amharic seen in the running game | [ALPHABETS](docs/ALPHABETS.md) | | **Edit the text by hand** | all the game's text as plain UTF-8 files and back: dialogue, menus, battle names, quests, subtitles, the save prompts | [MODDING](docs/MODDING.md#text-text-export--text-import) | | **Read the script in order** | 8,318 lines of dialogue in play order, with speakers and choices; subtitles as `.srt`; a sound file for each spoken line | [DIALOGUE](docs/DIALOGUE.md) | | **Read the scene scripts** | the 465 little programs that run each scene, turned into readable text | [SCRIPTS](docs/SCRIPTS.md) | | **Hear the music** | the 31 field and menu songs as MIDI, with the game's own instruments as a SoundFont, and as a WAV played the way the PS2 plays it | [MUSIC](docs/MUSIC.md) | | **Sound effects and movies** | 3,733 sound effects as WAV; the cutscenes as MP4 | [BROWSING](docs/BROWSING.md) | | **Fonts, menus and the battle screen** | the game's letters, menu pictures and battle-screen pieces as PNG, and back | [MODDING](docs/MODDING.md), [FORMATS](docs/FORMATS.md) | | **Replace any file** | swap any file on the disc for your own; a file that grows is moved to the end of the disc | [MODDING](docs/MODDING.md#any-file-patch) | ## Models Every picture below is a model the kit wrote, opened in Blender and rendered, with the textures exactly as the game stores them. The figures stand in their resting pose here; the [next section](#animation) shows them moving. ### Playable characters | KOS-MOS | Shion | Jr. | Jin | Chaos | MOMO | Ziggy | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | KOS-MOS
`kosmos00` | Shion
`shion00` | Jr.
`jr00` | Jin
`jin00` | Chaos
`chaos00` | MOMO
`momo00` | Ziggy
`ziggy00` | ### Notable NPCs These are captioned with their file names; the kit does not carry character names for them. | albelt00 | gaignun00 | yuri00 | febronia00 | kirsch00 | | :---: | :---: | :---: | :---: | :---: | | `albelt00` | `gaignun00` | `yuri00` | `febronia00` | `kirsch00` | | helmer00 | miyuki00 | virgil00 | pope00 | | :---: | :---: | :---: | :---: | | `helmer00` | `miyuki00` | `virgil00` | `pope00` | ### Environments | | | |---|---| | E2_MIL12
`E2_MIL12` | E2_MOM11
`E2_MOM11` | | E2_KUK06
`E2_KUK06` | E2_UZU01
`E2_UZU01` | | E2_SUI06
`E2_SUI06` | | The maps are seen from above at an angle, with the sky and the outside of the walls hidden so you can see into the rooms. **Try it:** in the app, the *Convert to files you can open* card writes every model; *Export one 3D model for Blender* writes just one. ```sh python cli.py browse --out out/ --kinds models # all of them, with their animation python cli.py model --iso "Disc 1.iso" --path 'model\char\pc\kosmos00.pxy' --out kosmos00.glb # just one ``` In Blender, choose *File ▸ Import ▸ glTF 2.0*, pick the `.glb` file, and switch the view to *Material Preview* to see the textures. [docs/BLENDER.md](docs/BLENDER.md) walks you through it and lists the three things that surprise people the first time. ## Animation KOS-MOS and Shion playing clip 1 of their field motion files, rendered in Blender from the kit's .glb files The game's animations come out too. Every body and face animation becomes an action in Blender, attached to the character's skeleton, so you can press play. All 4,340 animations on the disc can be read, and 142 models get theirs attached automatically. On the right, KOS-MOS and Shion play the first clip of their field animation files, straight from the kit's files. The game does not name its animations, so "walk" is just what this one looks like. Two things to know: hair, coats and skirts stay stiff, because the game moves them with a physics simulation the kit does not have yet; and nobody has compared the animations side by side with the running game yet. ```sh python cli.py model --iso "Disc 1.iso" --path 'model\char\pc\shion00.pxy' --out shion00.glb \ --motion 'motion\shion00.xap#0,1,2' --motion 'yamamoto\mot\shio00.xap#0,1' --face ``` How the animations were decoded and checked: [docs/MOTION.md](docs/MOTION.md).
## Changing textures Paint over any picture the kit gave you, in any paint program, or inside a model in Blender, and hand the folder back. The kit finds what you changed and writes it into a new copy of the disc. The game keeps the same picture in several places. KOS-MOS's hair, for example, is stored in four files, each with its colour list somewhere else. The kit changes every copy, and it keeps the colours other pictures share intact. Before the new disc gets its name, the kit reads back everything it wrote and checks that your pictures, and only your pictures, changed. ![KOS-MOS from the retail disc and from the modded copy, front and back, rendered in Blender after re-extracting the copy](docs/images/front/texture-kosmos-full.jpg) Close-up: the pink hair, the green arms and the yellow ring on her chest The title menu sheet, retail and with the words tinted gold *Both pictures were taken back out of the changed disc, not from the edited files: KOS-MOS's hair turned pink in all four of her texture files, green arms and a yellow ring painted on in Blender, and the title menu's words tinted gold. This disc copy has not been played in the emulator yet; the older `recolor` command's gold title menu has.* ```sh cp -R out/browse edited/ # paint in the copy python cli.py texture-import --iso "Disc 1.iso" --tree edited/ --dry-run python cli.py texture-import --iso "Disc 1.iso" --tree edited/ --out modded.iso --preview prev/ ``` The first command line only reports what would change; the second writes the new disc and a folder of previews. The rules (colour lists, see-through parts, models from Blender): [docs/MODDING.md](docs/MODDING.md#editing-textures-texture-import). ## Translating the game **The translation editor** is the easy way, for any language. It shows every line of the game in one page, sorted by where it appears and who says it. You type your translation next to the English; it checks each line as you type and shows how it will look in the game's own font. When you are done, press **Build** and you get a disc that plays in your language. No programming needed. * 382 languages to choose from, from French to Cherokee. * Letters the game's font lacks (French `œ`, Polish `ł`…) are added for you, at the size of the game's own letters. A whole new alphabet is drawn from a font on your computer. * Length guides, automatic backups, and a **Check project** button that looks over everything before you build. * Projects in Hindi, Chinese, Cherokee, Arabic and Korean were built with it and played in the emulator. Arabic and N'Ko are drawn with their letters joined, the way they are written. | | | |---|---| | ![Korean in the Episode I data prompt, with Yes and No](docs/images/ingame-xs2-korean-prompt.jpg) | ![Korean in the opening scene](docs/images/ingame-xs2-korean-cutscene.jpg) | | *Korean menus* | *Korean in the opening scene* | | ![Arabic and N'Ko lines in the game, the letters joined](docs/images/ingame-xs2-arabic-nko-joined.png) | ![Korean in the first field window](docs/images/ingame-xs2-korean-field.jpg) | | *Arabic and N'Ko, joined* | *Korean in a field window* | ![The translation editor: places in the game, the English field dialogue, and a French line with its warning and preview in the game's font](docs/images/editor-translating.png) *The editor: places in the game on the left, the English and your translation in the middle, a preview in the game's font underneath.* Language setup for Polish: 16 letters the game font lacks are added from DejaVu Sans, which comes with the kit, with a test sentence drawn in the game's font *Starting a project: pick your language, and the editor says which letters it will add and shows a test sentence in the game's font.* **Start here:** [docs/TRANSLATING.md](docs/TRANSLATING.md), a step-by-step guide for beginners. Every detail of the editor is in [docs/TRANSLATION-EDITOR.md](docs/TRANSLATION-EDITOR.md). To open it: the **Translation editor** button in the app, or `translate.command` / `.bat` / `.sh`. It will also be a download of its own (`Xenosaga-II-Translation-Editor`) from the next release on. **Two discs, one translation.** Disc 1 and Disc 2 share almost all their text; only the movie subtitles differ. Translate Disc 1, export your work, and import it into a Disc 2 project. **Prefer plain text files?** `text-export` writes every kind of text as UTF-8 files you can edit in anything, and `text-import` puts them back, refusing any line that would not fit or that the font cannot draw. `text-coverage` lists every place the game shows text and which tool writes each one ([MODDING](docs/MODDING.md#what-is-covered-text-coverage)). The editor uses the same code underneath. ## Translating into another alphabet The USA game only knows Latin letters. To show another script, the kit draws the letters your translation needs into empty slots of the game's own font, then writes your text using those slots. It handles the hard parts for you: letters that change shape when joined (Arabic), right-to-left lines, and line wrapping. When a language needs more letters than the font has room for (Korean, Chinese), the build opens up extra rows of the font, up to 3,255 letters. To prove it works, a test disc with Arabic, Hindi, Georgian and Amharic was built and played in the emulator. These are pictures of the game drawing them: | | | |---|---| | ![Arabic: a two-line message in the field box, right to left](docs/images/ingame-xs2-arabic-smsg.png) | ![Hindi: a line of a real-time cutscene, centred](docs/images/ingame-xs2-hindi-cfe.png) | | Arabic, two lines in the field message box | Hindi, a line in a cutscene | | ![Amharic: the save screen's title](docs/images/ingame-xs2-amharic-save.png) | ![Amharic: the Saving message from the executable](docs/images/ingame-xs2-amharic-saving.png) | | Amharic, the save screen's title | Amharic, the "Saving..." message | The 144 glyph cells lang-scan drew for the LANGTEST disc: Arabic, Devanagari, Georgian and Ethiopic On the right are the 144 letters the kit drew into the font for that test disc. You can also preview a line without starting the game: lang-preview output: an Arabic field line, a Hindi subtitle, the Amharic Saving message and a Georgian name
**What did not work yet:** the party names in the field menu stay blank in any new script, and the battle screen was not reached in the test. The whole story, step by step: [docs/ALPHABETS.md](docs/ALPHABETS.md). This works on the USA discs only. ## Audio samples Press play. These all came out of the kit, from Disc 1. The five songs are 25-second excerpts of the game's music played through its own instruments, the way the PS2's sound chip plays them (a recreation by the kit, not a recording of the console). The last clip has three spoken lines and two sound effects. The picture behind each song is a map from the game, not necessarily where the song plays. **001 Milchia** · `music/001_milchia` https://github.com/user-attachments/assets/ca3b6e3f-138f-421a-91ea-26ad1ca82257 **005 Morgenröte** · `music/005_morgenroete` https://github.com/user-attachments/assets/7f11c261-400f-4f18-b98a-4c304b2cb50a **009 Lost Jerusalem** · `music/009_lost_jerusalem` https://github.com/user-attachments/assets/8418837c-9230-4e25-8d79-70e695c1ff59 **103 Kukai** · `music/103_kukai` https://github.com/user-attachments/assets/0699e143-11b2-403c-bb2b-5ecea38d630c **111 Moby-Dick** · `music/111_moby-dick` https://github.com/user-attachments/assets/0cea13f0-e4ea-4aeb-96f4-bf66825a333b **Voices and effects**: "KOS-MOS…", "Thank you." (event `S05_06_05`), "Oh, be a man already!" (event `S05_02_00`), and sound effects CFS00004 and CFS00010 https://github.com/user-attachments/assets/ae93d8b2-e8d7-42c3-921b-201742139347 The same clips are in [docs/samples/](docs/samples/) as MP3 files. How close the music comes to the real console, and where it still differs: [docs/MUSIC.md](docs/MUSIC.md). The full sets (every song, every sound bank, every spoken cutscene line) come out of your own disc. ## Movies, fonts and menus | | | |---|---| | A frame from the opening movie | Two citizen portraits, a dialogue-box sheet and the title menu words | | A frame of the opening movie | Menu pictures: citizen portraits, window pieces, the title menu words | | font0 glyph sheet 0 | The Story So Far screen | | One page of the game's main font | "The Story So Far", one of the full-screen pictures | | KOS-MOS hair, body, face, eye, arm and leg textures | KOS-MOS hair and face textures, blue before and pink after | | KOS-MOS's textures, enlarged | A recolour preview: her hair, before and after | ## The window ![The kit's window: a card per command, the dump card open, the environment panel on the right](docs/images/front/gui-window.png) The app is a page in your browser that only your own computer can see. It has one card per job, grouped by goal: **Start here** (unpack the discs, check them, turn them into files), then looking at one thing, changing pictures, changing text and fonts, translating into a new alphabet, and tools for developers. Each card says in plain words what it needs and what it makes, and afterwards shows where the result went, with a button that opens the folder. Cards that change the game are marked "new disc copy". The panel on the right lists the discs it found. *Show command* prints the command line a card will run, for anyone who wants to learn the terminal way. (The discs in this picture are empty stand-ins.) ## Regions and the demo disc The kit tells by itself which version a disc is (`python cli.py region --iso DISC.iso` says so out loud). Give it Disc 1 and Disc 2 of the same version; mixing versions gets a warning. * **USA discs:** everything on this page. * **Japanese discs** (SLPS_253.68 / .69): read like the USA discs, and their text can be edited in place. New alphabets do not work there yet. * ***Xenosaga Freaks*** (SLPS_253.53) carries a 2004 demo of Episode II. The kit finds it, unpacks it and shows its scripts, which still hold their Japanese text ([docs/SCRIPTS.md](docs/SCRIPTS.md)). The differences file by file are in [docs/FORMATS.md](docs/FORMATS.md). ## Good to know **Safe by design.** Every change goes into a new copy of the disc, never the original. A copy is either complete and checked, or not written at all. **What has been played in the emulator:** subtitles and lines in new scripts, the translation editor's builds (Hindi, Chinese, Cherokee, Arabic, Korean), the gold title menu, and a file moved to the end of Disc 1. **Not yet played in the emulator:** the KOS-MOS texture demo, the animations, most text edits besides subtitles, a dialogue file that grows, and the large-alphabet mode beyond the first field window (no battles, shops or Disc 2 yet). **Known gaps:** * **Translation:** the name card on the main menu, the window titles and the NO DATA tile use a small second font with Latin letters only, so new scripts show blank there (the editor warns you). The battle screen is untested. Right-to-left menu lines stay on the left unless the game centres them. * **Animation:** hair and cloth stay stiff, and some animation files are not paired with a model automatically ([MOTION](docs/MOTION.md)). * **Models:** whether they come out mirrored, and the exact colours, have not been compared with the game ([BLENDER](docs/BLENDER.md)). * **Textures:** ten menu sheets that use several colour lists still come out grey or garbled ([FORMATS](docs/FORMATS.md)). * **Text:** movie subtitles can only grow by a few letters each. Words drawn into pictures and movies (like the staff roll) cannot be changed with text tools. * **Music:** a few effects of the sound driver (slides between notes, some volume sweeps, loop points) are not recreated yet ([MUSIC](docs/MUSIC.md)). The full list, with the details: [docs/UPDATES.md](docs/UPDATES.md) and each guide's own "limits" section. ## Docs | Read this | When you want to | |---|---| | [TOUR.md](docs/TOUR.md) | see everything the kit does, with real output | | [BROWSING.md](docs/BROWSING.md) | know what the kit writes and where to look first | | [BLENDER.md](docs/BLENDER.md) | bring the models into Blender | | [MODELS.md](docs/MODELS.md), [MOTION.md](docs/MOTION.md) | learn how the models, skeletons and animations work, and how each part was checked | | [MODDING.md](docs/MODDING.md) | change the game: textures, text, the game's own messages, any file | | [TRANSLATING.md](docs/TRANSLATING.md) | **translate the game into your language, step by step, no programming** | | [TRANSLATION-EDITOR.md](docs/TRANSLATION-EDITOR.md) | look up every detail of the translation editor | | [ALPHABETS.md](docs/ALPHABETS.md) | translate into a script the game never had | | [DIALOGUE.md](docs/DIALOGUE.md) | get every line in play order, with subtitles and voice clips | | [SCRIPTS.md](docs/SCRIPTS.md) | read the scene scripts | | [MUSIC.md](docs/MUSIC.md) | play the music and see how close it comes to the console | | [FUN-FACTS.md](docs/FUN-FACTS.md) | read sixty-odd things the disc gives away: staff folders, a quest you cannot fail, an unused hard-disk installer | | [FINDS.md](docs/FINDS.md), [HISTORY.md](docs/HISTORY.md) | read about curiosities left on the disc, and the background | | [FORMATS.md](docs/FORMATS.md) | see how every file is laid out, byte by byte (for tool writers) | | [CODEBASE.md](docs/CODEBASE.md) | find your way around the code (for programmers) | | [UPDATES.md](docs/UPDATES.md) | see what changed, release by release | ## Credits and licence MIT licence ([LICENSE](LICENSE)). This kit borrows from its two siblings, and each borrowed file names its source at the top. From the Episode I kit: the disc reader, the decompression (first learned from [Lakuwu's xenotool](https://github.com/Lakuwu/xenotool)), the letter-drawing and text-shaping code (`glyphs.py`, `langpack.py`) and the reader behind `exetext.py`. From the Episode III kit: the texture decoder `txy.py` (from its `chrtex.py`), the colour maths of `recolor`, and `udf.py`, which keeps a grown disc readable by every tool; its disc-descriptor handling is ported from **Anzinono**'s [xenosaga3-translation-kit](https://github.com/Anzinono/xenosaga3-translation-kit) (MIT). Text shaping uses HarfBuzz through uharfbuzz, fonts are read with fontTools, and the models were checked with the Khronos glTF validator and Blender. Xenosaga Episode II was made by Monolith Soft and published by Namco. This project is not affiliated with either and contains no game data. **Sibling kits:** [Episode I](https://github.com/LinuxJessi/Xenosaga1PythonExtractor) · [Episode III](https://github.com/LinuxJessi/Xenosaga3PythonExtractor)