Sly 1:GS

From SlyMods
Jump to navigation Jump to search
Data Structure
GameSly Cooper and the Thievius Raccoonus
Official NameYes

GS (game state) is a data structure in Sly Cooper and the Thievius Raccoonus. It contains information about the current state of the game world, including an array of world states which, in turn, each contain an array of level states.

Fields[edit | edit source]

The GS struct has the following fields

Offset Size Type Name Description
0x0 0x4
gsv Unknown
0x4 0x4
cbThis Size of this struct in bytes
0x8 0x4
nChecksum Unknown, possibly compared against cbThis for integrity check
0xc 0x4
dt Total time spent in game (secs)
0x10 0x19c8
struct WS[6]
aws Array of world states
0x19d8 0x4
gameworldCur Current gameworld
0x19dc 0x4
worldlevelCur Current worldlevel
0x19e0 0x4
clife Lives count
0x19e4 0x4
ccharm Charm count
0x19e8 0x4
ccoin Coin count
0c19ec 0x4
grfgs Unknown bitfield, possibly settings flags
0x19f0 0x4
grfvault Bitfield of unlocked powerups
0x19f4 0x4
grfmovie Unofficial name, probably called something else internally
0x19f8 0x4
enum FGS
fgs Game state flags
0x19fc 0x4
last powerup? Unofficial name, may be wrong

GRFGS and GRFVAULT are aliases of int.

World states array[edit | edit source]

aws is an array of 5 WS structs, one for each world. In the release build, the order is as follows:

Bitfields[edit | edit source]

There are three sets of bitfields/flags after the world states.

Settings flags (GRFGS)[edit | edit source]

The purpose of grfgs is unclear. At least some of the bits appear to be used for game settings.

Powerup flags (GRFVAULT)[edit | edit source]

grfvault is a bitfield representing unlocked powerups. Each bit corresponding to a particular powerup being unlocked.

Cutscene flags[edit | edit source]

There are 16 bits for the cutscene flags, with each bit corresponding to a particular cutscene being unlocked. It is probably also stored as a typedef alias of int but the type is currently unknown.

Game state flags (FGS)[edit | edit source]

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

Name Value Description
FGS_FirstClue 0x1
FGS_HalfClues 0x2
FGS_AllClues 0x4
FGS_FirstVault 0x8
FGS_SecondVault 0x10