Jump to content

PL Tool

From SA Docs

PL Tool is an editor for Sonic Adventure lighting files (PL and SL files) used by Lantern Engine.

Using the Editor

Palette List

PLTool’s main window lists diffuse and specular palettes in the PL file. Click the palette to select it. Right click a palette for a list of options to edit it. You can create palettes with sliders like gradients in Photoshop, generate them like in the Preview prototype of SADX, fill them with a specific color (or a combination of colors), import and export palettes as PNG files, as well as copy and paste them. The B palette pair is not stored in the PL file and can be used for backing up palettes before editing them.

  • Note: Color Alpha is ignored in the game.

Create Gradient

This window lets you create gradients from four colors and an ambient color. Click each color box to set the color and drag the sliders to adjust the position of the two colors in the middle.

Generate Gradient (SADX Preview)

The SADX Preview prototype has a debug menu that creates gradients. This feature is recreated in PL Tool. The gradients are generated using the following formula:

Result = Ambient + CO1 * Pow((1 - Index / 256), CO1Pow / 100.0) + CO2 * Pow((Index / 256), CO2Pow / 100)

  • Ambient is the Ambient color R/G/B.
  • CO1 is Color 1 R/G/B.
  • CO2 is Color 2 R/G/B.
  • CO1Pow and CO2Pow are Color 1 and Color 2 power values respectively.
  • Index is the color index in the gradient (0 to 255).

Color Selector

The trackbar is used to select a specific color in the palette. Its index and R/G/B values are shown on the right side of the status bar. Click the small colored box in the status bar to edit the color.

  • Note: Color Alpha is ignored in the game.
  • The File menu lets you import or export the entire palette list as a single PNG file.
  • The Options menu lets you set a background color for the editor to make it easier to work with light or dark palettes.
  • The Level Select menu allows you to locate the PL file by selecting a stage. If you have opened a PL file previously, the tool will look for PL files in the same folder without an open file dialog.
  • The Format menu allows you to toggle the Endianness of PL and SL files. Leave it on Dreamcast for the Lantern Engine mod.
  • The Tools menu opens the editor for SL files (see below).

SL Editor

The SL Editor lets you edit light direction and Ninja Lights configuration.

  • The Environment Data box has the parameters for the Ninja lights. You can click the color box to select the color.
  • The Light Direction box has light rotation Y and Z values. These are used to rotate the default light direction vector. This light direction is used by palette lights and Ninja lights except the DIR light which has a hardcoded light direction.
  • The Free/Slave Data box has additional lighting data. This data doesn’t seem to be used by the game. It may be left over from the Saturn because a menu with similar data was found in a Burning Rangers prototype.
SA Tools Information
General Tools SALVLSAMDLSAFontEditTexture EditorData ToolboxSA Tools Hub
Sonic Adventure (DX) Tools SADXTweaker2SADXSndSharpSASavePL ToolVMS Editor
Sonic Adventure 2 (Battle) Tools SA2 Event ViewerSA2 Cutscene Text EditorSA2 Message File EditorSA2 Stage Select EditorSA2 Cutscene Effect EditorSA2 Light/Fog Editor
Other Command Line ToolsWorking with Binary Files