GitExl/CTViewer

A Chrono Trigger SNES/PC map viewer.

★ 2Forks 0RustGitHub ↗Compare

README

CT Viewer

A utility to display Chrono Trigger scene and world maps complete with debug information. It supports the North American SNES version and the Steam version. It can display relevant tile and palette animations for the maps, as well as display actor sprites and animation from script data.

Usage

ctviewer [OPTIONS] <PATH>

Arguments:

  • <PATH> The source data path.

The source data path can be a headered or unheadered North American SNES ROM file, the path to the resources.bin file from the Steam version, or a directory with the extracted contents of that resources.bin file. You can use the "CT Explore" utility by River Nixx (download from https://rivernyxx.com/downloads.html) to extract the data from the Steam version into a directory.

Options:

  • -w, --world <WORLD> Index of the world to load [default: -1 / none]
  • -s, --scene <SCENE> Index of the scene to load [default: -1 / none]
  • --scale <SCALE> Display scale factor, integer [default: -1 / auto]
  • --scale-linear Scale output using linear scaling instead of nearest
  • -d, --display-aspect-ratio Set the display aspect ratio [default: 1.333 for a 4/3 ratio]
  • -p, --pixel-aspect-ratio Set the pixel aspect ratio [default: 1.143]
  • --no-vsync Disable vertical sync
  • -u, --ui-theme The user interface theme index, from 0 to 7 [default: 0]
  • -h, --help Print help

Examples:

  • ctviewer chrono-trigger.smc -s 144: view Denadaro North Face from the SNES version.
  • ctviewer chrono-trigger.smc -w 2: view 2100 A.D. from the SNES version.
  • ctviewer "C:\Steam\steamapps\common\Chrono Trigger\resources.bin" -s 5 -d: view Leene Square and output debug info and bitmaps from the PC version.

Keys

When viewing scenes or worlds, the following keys are available:

  • wasd to move around
  • esc to exit
  • f to advance dialog text
  • backspace to toggle debug mopde
  • \ to dump information and debug data to stdout and /debug_output, and write a screenshot of the internal render buffer to debug_output/screenshot.bmp

When in debug mode, the following keys are available everywhere:

  • 1 toggle rendering of layer 1
  • 2 toggle rendering of layer 2
  • 3 toggle rendering of layer 3
  • 4 toggle rendering of sprites
  • 5 toggle rendering of the map palette

When viewing worlds, the following keys are available in debug mode:

  • z disable debug overlay
  • x render collision overlay
  • c render exit overlay
  • v render music overlay

When viewing scenes, the following keys are available in debug mode:

  • z disable debug overlay
  • x render player collision overlay
  • c render NPC and battle collision overlay
  • v render Z plane overlay
  • b render tile movement overlay
  • n render door overlay
  • m render sprite priority overlay
  • , render exit overlay
  • . render treasure overlay
  • / render actor overlay

Information about exits, treasure and actors is displayed when the mouse is over them. You can move to another scene or world by clicking on exits.

Left-clicking on an actor will activate it. Right-clicking will "touch" it. Clicking with the middle button will display debug information about them until somewhere else is middle-clicked. In that mode use the spacebar to advance the actor script execution one step.

Examples

These are some screenshots from various scenes. They have been scaled to a 4/3 aspect ratio.

Denadoro South Face Schala's Room Crono's Kitchen Castle Magus Throne of Strength Zeal Kingdom Frog's Burrow Mountain of Woe Z Debug data 1000 A.D. Frog's Burrow Entrance

Known issues

General

  • Scanline animation effects (usually on layer 3) are not present. This requires a different tilemap rendering approach.
  • World camera wrapping works, but not smoothly.
  • There are many scripting features not implemented, and plenty of bugs or incompatibilities left to resolve in the ones that are.

PC version

  • The map extensions are not supported, as a result widescreen display isn't either.
  • The priority map data is not used to rearrange layer priorities, so some scene maps like 97 (Black Omen upper level 4) look wrong.

Compiling

  1. Install Rust from https://www.rust-lang.org/tools/install/.
  2. SDL3 libraries are required to be in the path to be able to build and run it. Get the SDL3.lib, SDL3.dll, SDL3_ttf.lib and SDL3_ttf.dll development libraries for your platform from https://github.com/libsdl-org/SDL/releases
  3. Build and run a debug build using Cargo with cargo run -- [parameters].
  4. Build and run an optimized release build with cargo run -r -- [parameters].

Thanks to...

  • Geiger for some of the invaluable documentation about CT's internals.
  • Micheal Springer for Temporal Flux.
  • rivernyxx for CTExplore.
  • Mauron for help with some scene script specifics.
  • The Mesen emulator and its contributors
  • ...many other people who documented (small) parts of Chrono Trigger over the past decades.

Contributors

GitExl

Issues