Actions

User

MainMemory/S2LVL INI File Setup

From Sonic Retro

< User:MainMemory

SonLVL uses INI files to define both the levels in a game and the objects available in the game and each level. INI files are simple text files that can be opened with a text editor such as Notepad.

Main INI

This file defines the version of the Sonic engine, the file containing object definitions for the whole game, and the levels available for editing.

Engine Versions

Whenever a setting asks for an "EngineVersion", use one of the following settings that SonLVL supports:

Compression Formats

Whenever a setting asks for a "CompressionFormat", use one of the following settings that SonLVL supports:

  • Uncompressed - The file is not compressed.
  • Nemesis - The file is Nemesis compressed.
  • Kosinski - The file is Kosinski compressed.
  • KosinskiM - The file is Kosinski Moduled compressed. Only used in S3K and SKC.
  • Enigma - The file is Enigma compressed.
  • SZDD - The file is SZDD compressed. Only used in SCDPC.

File Lists

When a setting asks for a "FileList", it is capable of loading multiple files. In most cases, the files are loaded immediately following the previous file, in which case you can simply put one filename after the other, separated by pipe characters (|). If you require control over where files are loaded, add a colon (:) after the filename, followed by an offset in bytes in decimal or hex (use 0x for hex). The offset must be divisible by the size of the data.
For example, Hill Top Zone's 8x8 tiles are defined as: tile8=../art/kosinski/EHZ_HTZ.bin|../art/kosinski/HTZ_Supp.bin:0x3F80
The file "EHZ_HTZ.bin" will be loaded first, then "HTZ_Supp.bin" will be loaded over it starting at offset 0x3F80, overwriting the tiles in the first file in display and editing. When the files are saved, the overwritten tiles in the first file will be saved back unaltered.

Palette

Palettes are different from most data in that they are normally loaded from multiple files. You can specify a list of palette files to load in order, separated by pipe characters (|). Each file contains four parts, separated by colon characters (:). First is the file name, then the source index (in palette entries, not bytes), the destination index, and the number of entries to copy.
For example, Emerald Hill Zone's palette: palette=../art/palettes/SonicAndTails.bin:0:0:16|../art/palettes/EHZ.bin:0:16:48
For alternate palettes, the files are preceded by a name and a pipe character:
palette2=Water|../art/palettes/ARZ underwater.bin:0:0:64

Start Positions

Start positions have a filename, a sprite definition, and a name, separated by colon characters. For example: Emerald Hill Zone: startpos=../startpos/EHZ_1.bin:Sonic:Level Start
Multiple start positions can be specified, separated by pipe characters.

Global Settings

These settings affect all levels. Most of them will be overridden if the same setting is defined in a level group.

version=EngineVersion - This setting chooses the default data types used. If omitted, S2 will be used by default.
objlst=filename - Specifies an INI file with definitions for objects that are loaded in all levels, as well as Rings for S2 and S3K, and Start Position definitions.
tilefmt=EngineVersion - The format for the 8x8 tiles. Most games differ only in default compression type, but SCDPC uses an entirely different format for tiles.
tilecmp=CompressionFormat - Compression for 8x8 tiles.
blockfmt=EngineVersion - The format for the 16x16 blocks. All games differ only in default compression type.
blockcmp=CompressionFormat - Compression for 16x16 blocks.
chunkfmt=EngineVersion - Format of chunks. S1 and SCDPC use 256x256 chunks, S2NA, S2, S3K and SKC use 128x128 chunks.
chunkcmp=CompressionFormat - Compression for chunks.
layoutfmt=EngineVersion - The format of the level layout. More information can be found in the SCHG for each game. Of particular note is that S2, S3K and SKC use a single layout file, while others require both fglayout and bglayout files.
layoutcmp=CompressionFormat - Compression for level layout.
palettefmt=EngineVersion - The format of the palette files. All games use the same format except SCDPC.
objectfmt=EngineVersion - The format of the object layout file. More information can be found in the SCHG for each game.
ringfmt=EngineVersion - The format of the ring layout file. More information can be found in the SCHG for each game. S1 and SCDPC do not have ring layouts, and use objects instead.
colindcmp=CompressionFormat - Compression used for collision indexes.
colind=filename - Collision indexes for all levels. S2 and S2NA require colind1 and colind2 settings instead of a single colind setting.
colarr1=filename - Collision array (heightmaps) for all levels.
colarr2=filename - Rotated collision array for all levels. Generated from the normal one on saving.
angles=filename - Angle values for each heightmap for all levels.
buildscr=filename - Path to the build script for your disassembly, usually "../build.bat".
romfile=filename - Path to the built ROM file after running buildscr. Both of these settings together will allow you to use the "Build & Run" option in SonLVL after you set up your emulator.

Levels

Each level section starts with a line [Level Name Zone Act Number]. The text inside the brackets will be used as the name of the level in SonLVL. No two levels can have the same name. Backslashes will be used to create submenus in the Choose Level menu, for example, [Sonic 3\\Angel Island Zone Act 1] puts the level "Angel Island Zone Act 1" in a "Sonic 3" menu.

Level Settings

tilefmt=EngineVersion - The format for the 8x8 tiles. Most games differ only in default compression type, but SCDPC uses an entirely different format for tiles.
tilecmp=CompressionFormat - Compression for 8x8 tiles.
tiles=FileList - 8x8 tile file(s).
blockfmt=EngineVersion - The format for the 16x16 blocks. All games differ only in default compression type.
blockcmp=CompressionFormat - Compression for 16x16 blocks.
blocks=FileList - 16x16 block file(s).
chunkfmt=EngineVersion - Format of chunks. S1 and SCDPC use 256x256 chunks, S2NA, S2, S3K and SKC use 128x128 chunks.
chunkcmp=CompressionFormat - Compression for chunks.
chunks=FileList - chunk file(s).
layoutfmt=EngineVersion - The format of the level layout. More information can be found in the SCHG for each game. Of particular note is that S2, S3K and SKC use a single layout file, while others require both fglayout and bglayout files.
layoutcmp=CompressionFormat - Compression for level layout.
fglayout=filename - Foreground layout file.
bglayout=filename - Background layout file.
layout=filename - Foreground/Background layout file.
palettefmt=EngineVersion - The format of the palette files. All games use the same format except SCDPC.
palette=Palette - The level's normal palette.
palette#=Palette - Alternate palettes, for underwater and other effects. # starts at 2, and goes up to 9.
objectfmt=EngineVersion - The format of the object layout file. More information can be found in the SCHG for each game.
objectcmp=CompressionFormat - Compression for object layout.
objects=filename - Object layout file.
ringfmt=EngineVersion - The format of the ring layout file. More information can be found in the SCHG for each game. S1 and SCDPC do not have ring layouts, and use objects instead.
ringcmp=CompressionFormat - Compression for ring layout.
rings=filename - Ring layout file.
bumpercmp=CompressionFormat - Compression for bumper layout.
bumpers=filename - Bumper layout file, for Casino Night Zone.
startpos=StartPosition - Start positions.
colindcmp=CompressionFormat - Compression used for collision indexes.
colind=filename - Collision indexes for this level. S2 and S2NA require colind1 and colind2 settings instead of a single colind setting.
colarr1=filename - Collision array (heightmaps) for this level.
colarr2=filename - Rotated collision array for this level. Generated from the normal one on saving.
angles=filename - Angle values for each heightmap for this level.
sprites=filename - Sprite file, for SCDPC.
objlst=filename - Specifies an INI file with definitions for objects that are specific to this level.