Egress - Godot host
===================

This is the Godot host of a reimplementation of Shining Force II (Mega Drive,
USA): the game's battle rules in an engine-free library, the graphics and tables
decoded from the ROM, presented by Godot.

It contains no game data. Everything the host shows it reads from your own copy
of the ROM at startup and keeps in memory. The only ROM it accepts is
Shining Force II (USA), sha256
9adf662d09881f58ec37d174ab01e87a7fcfb24700b5f84b26c0cd4f351509e9.

First run
---------
Put your ROM next to the program, or start the program and pick it when it asks.
It accepts .gen, .md and .bin files. The host remembers the path you pick, so
later starts need nothing; a file that is not Shining Force II (USA) is refused
and the picker opens again.

If you own the game on Steam (SEGA Mega Drive & Genesis Classics), its
uncompressed ROM is in that collection's "uncompressed ROMs" folder.

Command line
------------
Pass the arguments after a separate "--" (Godot treats everything after it as
the program's own), and give absolute paths:

  Linux:    ./EgressHost.x86_64 -- --rom "/path/to/Shining Force II (USA).gen"
  Windows:  EgressHost.exe      -- --rom "C:\roms\Shining Force II (USA).gen"

--rom PATH       the ROM; instead of it you can set the SF2_ROM environment variable, or let the host find it
                 (next to the program, remembered from an earlier run, or picked when it asks).
--marathon       the game above the battles: a new game, a camp between battles, the party carried over. The camp
                 offers the original's caravan, church and shops. --continue PATH resumes a camp save or a
                 battle suspended with Quit in battle; --save PATH says where the host writes them (by default
                 marathon-save.json in the app's user data folder, beside Godot's settings). --auto puts every
                 ally under the AI.
--battle N       one battle on its own, 0 to 44 (default 1), with a party preset for it.
--start PATH     a start state JSON to play instead of the ROM's own (debugging; see below).
--frames N       run N frames headless-ish and quit with code 0 (the smoke runs use it).
--mute           no sound (the host does not open the audio device).
--overview, --readonly, --battle-test, --debug-loadout, --debug-skirmish, --script TOKENS, --shots DIR,
--debug-region N, --cutscene-shots N: see "Run" in godot/README.md in the repository.

Sound
-----
The battles' music and sound effects are the original's: the host runs the game's
own Z80 sound driver, read from your ROM, on an emulated Z80 with the YM2612 (the
ymfm library, BSD-3-Clause, YMFM-LICENSE in this folder) and the Mega Drive's PSG.
The library file next to the program (libsf2ymfm.so or sf2ymfm.dll) is what plays
it; without it, or without an audio device, the host says so once and plays
silently. --mute asks for that on purpose.

Keys: arrows steer the active unit, arrows move the battlefield cursor, C / Space
confirm, X / Esc cancel, Z opens the member screen under the cursor, Enter is Start
(held, it hides the windows; the Mega Drive pad's A, B and C are Z, X and C). A gamepad works too: its D-pad or left stick
steers, its A (the left face button) opens the member screen under the cursor, its B
(right face button) cancels and its C (bottom face button) confirms.

The start state
---------------
The host builds the start of a battle from your ROM alone: the combatants (side,
class, stats, HP/MP, spells, items, positions), the map and battle area, the
random number seeds, the flags, gold, deals stock, caravan items and the AI
memory - the state the game's own setup reaches before the first turn, from the
game's tables and rules (NewGame, the battle test's party, the battle loop's
setup). Nothing else is needed: no start state file is shipped or read.

--start PATH plays a start state JSON exported from an emulator recording
instead, which is for debugging and is not part of this release.

License
-------
GPL-3.0-or-later; see LICENSE and NOTICE. This release contains no game data: it
reads everything from your own ROM. Shining Force II is a trademark of SEGA. This
project is not affiliated with or endorsed by SEGA.
