Skip to content

GitExl/CTViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

152 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • 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
  • backspace to dump information and debug data to stdout and /debug_output
  • \ to write a screenshot of the internal render buffer to debug_output/screenshot.bmp

When viewing worlds, the following keys are available:

  • z disable debug rendering
  • x render collision data
  • c render exits
  • v render music data

When viewing scenes, the following keys are available:

  • z disable debug rendering
  • x render player collision data
  • c render NPC and battle collision data
  • v render Z plane data and flags
  • b render tile movement data
  • n render door data
  • m render sprite priority data
  • , render exits
  • . render treasures
  • / render actor data

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

  • The format of world sprite animation and assembly data is still not entirely understood.
  • World layer 3 animation is currently hardcoded. It is unknown where this information is stored.
  • Scanline animation effects (usually on layer 3) are not present. This requires a different tilemap rendering approach.
  • World palette animations are hardcoded. It is unknown where this information is stored.
  • 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.

About

A Chrono Trigger SNES/PC map viewer.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors