Data Global Variables

From OPU Wiki

Outpost 2 Global Variables


TethysGame global static variables

Address Description
56EB00 Number of players (including computer players)
56EB04 Number of human players
56EB08  ???
56EB0C BYTE (time scale?) **check this**
56EB10  ???
56EB14  ???
56EB18  ???
56EB1C Game time (Tick count)
56EB28 Local player number
56EB3C Multiplayer startup settings:
Bit 0 Can have disasters
Bit 1 Uses day and night
Bit 2 Uses morale
Bit 5 Can have cheats (no effect on "Dan's" cheats)
Bits 17-21 Number of initial combat units


GameMap static global variables

Address Offset Description
54F7F8 0  ??? (Base address of map object)
54F7FC 4 mapPixelWidthMask to wrap pixel coordinates around map
54F800 8 mapPixelWidth
54F804 C mapTileXMask used to wrap tileX coordinate around map (GetTile)
54F808 10 mapTileWidth
54F80C 14 logTileWidth (or logTileWidth+1 if < 9) (BYTE)
54F810 18 mapTileHeight (estimated - 2^logTileHeight)
54F814 1C clipRect.x1 - tile coordinates of leftmost x tile that a unit can move to, (0x20, internal coordinates of left edge of map) or (-1 if logTileWidth >= 9)
54F818 20 clipRect.y1 - tile coordinates of topmost y tile that a unit can move to (sample value: 1)
54F81C 24 clipRect.x2 - tile coordinates of rightmost x tile that a unit can move to (mapTileWidth + 0x1F, internal coordinates of right edge of map) or (0x7FFFFFFF if logTileWidth >= 9)
54F820 28 clipRect.y2 - tile coordinates of bottommost y tile that a unit can move to
54F824 2C numTiles (tileWidth*tileHeight)
54F828 30 numTileSets - amount of space reserved for "well????" file references (fifth DWORD of .map file (always 512?))
54F82C 34 logTileHeight - rounded up (BYTE)
54F830 38 leftmostTileX/Block tileWidth (1st copy)


Map Tile Format (32 bits)

Bit Offset Length BitMask Description
0x0 5 0x0000001F Cell type (GetCellType)
0x5 11 0x0000FFE0 Tile (GetTile)


Misc global variables

Address Description
4DEBA8 Base address of terrain data - (Fast Passable1, Impassible2, etc.)
Personal tools