Skip to content

Compiled Ride Script (*.rse)

RSE is a file that encompasses compiled bytecode, the contents of which are decided by the appropriate RSS file. These files follow a simple layout:

File Format

Header

SizeDescription
8 bytesMagic number - RSSEQ (52 53 53 45 51 0F 01 00)
4 bytesvariable count (see String / variable table below)
4 bytesstack size (defined by #setstack)
4 bytestime slice - almost always 50 (0x32), preprocessor directive is unknown
4 byteslimbo size (defined by #setlimbo)
4 bytesbounce size (defined by #setbounce)
4 byteswalk size (defined by #setwalk)
16 bytesPadding - Pad Pad Pad Pad (includes a trailing space)

Body

SizeDescription
4 bytesInstruction count
n bytesInstructions

Instructions

Instructions are written in little endian, and take the following form:

SizeDescription
4 bytesOperand
n bytesOpcodes

Instructions can have as many opcodes as necessary (and can also have none at all), however most instructions only require 1 to 3 opcodes.

Opcodes and operands follow a specific format:

SizeDescription
2 bytesValue
2 bytesFlags

Flags are currently as follows:

  • 00 00 - Literal value
  • 00 10 - String (see String / variable table below)
  • 00 20 - Branch / subroutine
  • 00 40 - Variable name (see String / variable table below)
  • 00 80 - Opcode

String / variable table

At the end of the file, a list of strings and variables used within instructions is inserted. Strings are added in order for string literals to be usable within a ride sequence; variables were likely included for debugging purposes, however they have little to no use while in-game.

The format of the string table is as follows:

SizeDescription
4 bytesString length
n bytesNull-terminated string of characters

The first entry within this table will typically contain a list of null-terminated strings, one after another, that are used within the file (if any). The remaining entries will simply be variable names.