Game data is XML only: the JSON form of documents, the DataFormat option and Anm2Ed's JSON .anm2 loader are gone. DataNode wraps pugixml alone, resource_find takes one path, and the read padding simdjson needed is dropped. simdjson is replaced by rapidjson (external/rapidjson, upstream master: REPENTOGON's pinned 2016 commit does not build with clang) for REPENTOGON's own JSON save files, through json_save's document and member helpers. The decompilation workspace is removed (analysis/, db/, dump/, notes/, project/, scripts/): generated-src's classes.h and stubs.cpp move to src/generated/, the overlay moves to src/overlay/ (with its console commands in commands.cpp), and the build adds ccache, mold, precompiled headers, an optional unity build and a build/<platform>/ folder linking the resources, mods and assets. Also included: the save folder and options.ini flags (--saves, --options, --help), Steam Cloud left offline, and further REPENTOGON vanilla fixes and player and room behaviour.
107 lines
7.0 KiB
Markdown
107 lines
7.0 KiB
Markdown
# Repentance+ rebuilt
|
|
|
|
A native 64-bit Linux build of The Binding of Isaac: Repentance+ (v1.9.7.17), reconstructed as C++ from the
|
|
original executable, with REPENTOGON's modding API built in.
|
|
|
|
**Private.** This repo holds decompiled game code. It is a local git repo with no remote: never push it, publish
|
|
it, or paste large parts of it anywhere public. Nothing from the game ships here: the game reads the player's own
|
|
install, which it never modifies.
|
|
|
|
```
|
|
src/ the game (see Source layout)
|
|
assets/ files the repository ships itself: the overlay's fonts (git-lfs), with their licences, and REPENTOGON's Lua
|
|
scripts and the resources its menus load (assets/repentogon/, GPL-2, searched after every mount)
|
|
external/ static submodules: SDL3, Lua 5.3, pugixml, rapidjson, Ogg, Vorbis, Theora, stb, Dear ImGui (docking)
|
|
tools/ gitignored local tools: the resource importer and the test harness (tools/harness/)
|
|
```
|
|
|
|
## Building and running
|
|
|
|
```sh
|
|
git submodule update --init --recursive
|
|
cmake -B build -G Ninja -DISAAC_RESOURCES="<install>/resources" && cmake --build build
|
|
build/linux/isaac
|
|
```
|
|
|
|
The game builds into `build/<platform>/`, which holds only the executable and links to the folders it reads beside
|
|
it: `resources` (`ISAAC_RESOURCES`, the import tool's `resources/` by default), `mods` (the repository's gitignored
|
|
`mods/`) and `assets`. It runs from any folder. `--resources DIR` and `--mods DIR` replace either one for a run.
|
|
Saves (save files, their backups, mod save data and REPENTOGON's per-save files) go to options.ini's `SaveDirectory`,
|
|
or SDL's per-user folder when it is empty, and `--saves DIR` replaces it for a run. `--options FILE` reads and writes
|
|
another options.ini, with REPENTOGON's options beside it. Logs and configs stay in the per-user folder.
|
|
|
|
The build uses ccache and mold when they are installed and precompiles the standard headers and `classes.h`.
|
|
`-DISAAC_UNITY=ON` builds the game in unity batches, for faster clean builds and slower incremental ones.
|
|
|
|
SDL3 (window, OpenGL context, input, audio) and Lua 5.3 (mods) are built statically, with pugixml for data,
|
|
rapidjson for REPENTOGON's own save files and Xiph's Ogg, Vorbis and Theora (decoders only) for the cutscene
|
|
videos. Online features (Steam, EOS, curl) are offline stubs.
|
|
|
|
The game reads the player's own install as it is: its `resources/` folder mounts its packed archives
|
|
(`src/engine/filesys.cpp`, a port of KAGE's file system: each archive indexed once at start-up, its files unpacked on
|
|
demand) in the original's order (loose files, then animations, config, fonts, graphics, music, rooms, sfx, videos,
|
|
afterbirth, afterbirthp, the repentance_<language> archives and secret.a, a later archive overriding an earlier one),
|
|
with the language's mount (`resources.<code>`) searched first. Every resource
|
|
(documents, anm2, images, sounds, music, videos, shaders, fonts, rooms, string tables, the game's Lua scripts) is read
|
|
through that one file system, and nothing is ever written into the install. XML documents and `.anm2` files are read
|
|
as the original's XML, and mods' own XML loads as it ships. Loaders read it through one node API
|
|
(`src/engine/data.h`) over pugixml's tree. The import tool in `tools/` (gitignored) still unpacks an install into
|
|
`resources/` and its mods into `mods/`, every file as it is.
|
|
|
|
## Source layout
|
|
|
|
`src/` is sorted by subsystem. A file drops its folder's prefix and includes others by path from `src/`
|
|
(`#include "entity/boss/mom.h"`); CMake builds every `.cpp` under it.
|
|
|
|
```
|
|
engine/ platform (SDL3 window, frame pacing, clock), gl, kage_* (graphics, input, sound), anm2, textures,
|
|
fonts, video, renderers, the file system (packed archives) and data loading, log, seeds and RNG, the
|
|
test harness
|
|
game/ main, Manager, game_* (game/state, game/save, game/update ...), options, strings, save data, mods,
|
|
sound and music managers, dailies, local versus
|
|
level/ level_* (level/generator, level/stage ...), room*, backdrop, minimap, path finder, rails,
|
|
stage transition, Greed
|
|
grid/ grid entities (level/grid/rock, level/grid/door ...)
|
|
entity/ Entity and its list, factory, config, collision, combat
|
|
player/ Entity_Player split by concern (player/actives, player/cards, player/update ...), PlayerManager
|
|
npc/ Entity_NPC and every enemy AI (npc/gaper, npc/hopper ...)
|
|
boss/ every boss (boss/mom, boss/delirium ...)
|
|
familiar/ Entity_Familiar and familiar behaviour
|
|
effect/ Entity_Effect variants
|
|
pickup/ pickups, slots, item config, item pools, procedural items
|
|
weapon/ weapons, tears, lasers, knives, bombs, projectiles
|
|
ui/ HUDs, popups, pause screen, cutscenes, console
|
|
menu/ every menu screen (ui/menu/character, ui/menu/mods ...)
|
|
overlay/ the developer overlay (CMake option ISAAC_OVERLAY, on by default): ` shows it in place of the console,
|
|
with the Console, Game Options, Mods, Debug and Log windows on Dear ImGui
|
|
lua/ the Lua engine, API bindings and callbacks
|
|
online/ online-only code, kept as offline stubs
|
|
repentogon/ REPENTOGON's modding API built in (CMake option ISAAC_REPENTOGON, on by default, OFF builds the vanilla
|
|
game): its scripts' loading, its options store and the vanilla parity switch, inert without mods
|
|
generated/ frozen decompiler output: classes.h declares every original class, global and function, and
|
|
stubs.cpp stops the game at any original function src/ does not define
|
|
```
|
|
|
|
## Test harness
|
|
|
|
Flags on the game binary (`src/engine/harness.cpp`), deterministic: the same input file always gives the same run.
|
|
The first three leave the developer overlay out, so the console behaves as the original's.
|
|
|
|
```
|
|
--headless no window, GL context or audio, no frame pacing (about 7,900 frames per second)
|
|
--record F / --replay F per-frame input from boot, so menu navigation is included
|
|
--frames N quit after N frames
|
|
--trace F [--trace-every N] [--trace-detail] hashes (or the fields) of the RNGs, players and entities
|
|
--mods DIR a private mods folder
|
|
--screenshot-every N a windowed run saves every Nth frame (as Isaac.GetFrameCount() counts) to screenshots/
|
|
```
|
|
|
|
`tools/harness/run.sh SAVE WORK [flags]` runs on a fresh copy of a save folder with a private `XDG_DATA_HOME`;
|
|
`tools/harness/menu.py` writes the boot-to-run menu input; `tools/harness/compare.py A B` prints the first frame
|
|
and field where two traces differ; `tools/harness/bot/` is a Lua mod that plays through `MC_INPUT_ACTION`.
|
|
`tools/harness/goldens/check.sh` replays about 70 recorded runs (every character, the main and alternate floors,
|
|
every final boss, Greed and Greedier, challenges, typed seeds, saving and continuing) on three saves (nothing unlocked
|
|
in Hard, everything unlocked in Normal and in Hard) and names each trace that changed; `--record` re-records them.
|
|
`RESOURCES=<install>/resources` points them at an install (the Steam install by default).
|
|
Traces follow the compiler's float code, so check with a clang build, as the goldens were recorded.
|