Sly 1:GS

From SlyMods
Revision as of 02:14, 12 July 2022 by TheOnlyZac (talk | contribs) (Created article for data structure)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GS (Game State) is a data structure in Sly 1. It stores an array of World States, which in turn each store an array of Level States.

Structure

The GS struct is declared as follows:

Game State Flags

The current game state is represented the FGS enum, which has the following possible values:

World States

The GS struct stores an array of 5 WS struts, one for each world. The order is as follows:

  • 0: Intro
  • 1: Underwater
  • 2: Mesa
  • 3: Voodoo
  • 4: Snow
  • 5: Clockwerk

Unlockable flags

There are three[check] sets of flags after the world states.

Powerup flags

There are 16 bits for the powerup flags, with each bit corresponding to a particular powerup being unlocked.

Cutscene flags

There are 16 bits for the cutscene flags, with each bit corresponding to a particular cutscene being unlocked.

GRFGS

There is a set of flags defined by the GRFGS enum whose purpose is unclear. At least some of the bits appear to be used for game settings.