Antal1987
Warlord
Hello, everyone!
I research Civ3 game and it's addons with ArtMoney and IDA.
My general purpose is developing ultimate trainer for this games.
Maybe using Save Game Editors is cool but doing same things in runtime is much more better. For example, I intend to study how city corruption and pollution are calculated to make them reduce to zero.
Here that I've already found:
All map tiles are stored in object array.
In C3C-v1.22 a pointer of that array is stored at 0x009C7474.
Also Map_Width is stored at 0x009C7494; Map_Height - at 009C7480;
The array itself is actualy array of pointers to Tile Class Object. Probably it's being created by command like:
Tile[] Map = new Tile[Map_Width /2 * Map_Height];
for(int i=0;i<Map.Length;i++) Map = new Tile(....);
Tile Object has size = 0xE8.
I've recognized the following Tile data:
+0x00 - Virtual Method Table Pointer for base class: Tile_Base_1 (4 bytes)
+0x08 - Resource ID (4 bytes integer). = -1, if there is no Resource; 0 - Horses; 1 - Iron; ....
+0x28 - Overlays. There are 8 bit flags:
[Flag]
public enum MapOverlays{
Road=0x01,
Railroad = 0x02,
Mine = 0x04,
Irrigation = 0x08,
Fortress = 0x10,
GoodyHuts = 0x20,
Pollution = 0x40,
BarbarianCamp = 0x80
}
Description can be found at (link).
+0x2D - Tile type = BaseType << 4 | RealType.
Each type by default is in the set: 0 - Desert; 1 - Plains; 2 - Grassland; .... ; 0x0D - Ocean;
So the value 0xDD describes the ocean tile. But it only affects on how the game thinks what this tile is. Rendering algorithm uses that value partially. It affects on view only for 'ground' tiles.
+0x3C - Virtual Method Table Pointer for base class: Tile_Base_2 (4 bytes)
+0x44 - 4 bytes string 'TILE'.
So each tile object can be found in artmoney by searching that string. There should be at least Map_Width * Map_Height / 2 found entries.
Now I'm looking for information about the other game data structures.
Maybe someone has investigated the game enough to find fixed data pointers and recognized some structures.
I research Civ3 game and it's addons with ArtMoney and IDA.
My general purpose is developing ultimate trainer for this games.
Maybe using Save Game Editors is cool but doing same things in runtime is much more better. For example, I intend to study how city corruption and pollution are calculated to make them reduce to zero.
Here that I've already found:
All map tiles are stored in object array.
In C3C-v1.22 a pointer of that array is stored at 0x009C7474.
Also Map_Width is stored at 0x009C7494; Map_Height - at 009C7480;
The array itself is actualy array of pointers to Tile Class Object. Probably it's being created by command like:
Tile[] Map = new Tile[Map_Width /2 * Map_Height];
for(int i=0;i<Map.Length;i++) Map = new Tile(....);
Tile Object has size = 0xE8.
I've recognized the following Tile data:
+0x00 - Virtual Method Table Pointer for base class: Tile_Base_1 (4 bytes)
+0x08 - Resource ID (4 bytes integer). = -1, if there is no Resource; 0 - Horses; 1 - Iron; ....
+0x28 - Overlays. There are 8 bit flags:
[Flag]
public enum MapOverlays{
Road=0x01,
Railroad = 0x02,
Mine = 0x04,
Irrigation = 0x08,
Fortress = 0x10,
GoodyHuts = 0x20,
Pollution = 0x40,
BarbarianCamp = 0x80
Description can be found at (link).
Each type by default is in the set: 0 - Desert; 1 - Plains; 2 - Grassland; .... ; 0x0D - Ocean;
So the value 0xDD describes the ocean tile. But it only affects on how the game thinks what this tile is. Rendering algorithm uses that value partially. It affects on view only for 'ground' tiles.
+0x44 - 4 bytes string 'TILE'.
So each tile object can be found in artmoney by searching that string. There should be at least Map_Width * Map_Height / 2 found entries.
Now I'm looking for information about the other game data structures.
Maybe someone has investigated the game enough to find fixed data pointers and recognized some structures.