Terrain

Research By Malu05 2007

Basic Understanding

The terrain is stored in the memory as it is in the game. ADT Structure For entry understanding and editing try scan for the header "MHDR chunk" (you need to scan for "RDHM"). The editable terrain offsets are located in the "MCNK chrunk". Remember that any terrain modification requires a reload, so you eighter have to get the ADT out of render range and then in again or use the console command:

```/Console GXRestart
```

Offset Pointer

The higher you go in X the lover you go in HEX Diffrence in X = 0x100 This means that when you go 533,3333 up you go 0x100 up in hex

```X      	Y	Offset
2300   	.2300	= 00CBF3C4

00CBF3C4 = 	2300
00CBF2C4 =	2833,3333 (2300+533,3333)
```

A + C = B

== 00CBFEE8 00CBFEE8

Here is a example on how the Offset for the terrain block changes as my position changes.

```X      	Y	Offset
-12000		.0	= 00CC0ED8
-11000		.0	= 00CC0CD8
-10000		.0	= 00CC0BD8
-9000		.0	= 00CC09D8
-8000		.0	= 00CC07D8
-7000		.0	= 00CC05D8
-6000		.0	= 00CC03D8
-5000		.0	= 00CC01D8
-4000		.0	= 00CBFFD8
-3000		.0	= 00CBFDD8
-2000		.0	= 00CBFCD8
0		.0 	= 00CBF8D8
1000		.0 	= 00CBF6D8
1000		.0	= 00CBF7D8
2000		.0	= 00CBF8F0
3000		.0	= 00CBF2D8
4000		.0	= 00CBF0D8
5000		.0	= 00CBEED8
6000		.0	= 00CBEDD8

```

533.3333 2300 2300 00CBF3C8

Here is a example on how the diffrence between movement in X and Y is. Here the offset is - 0x8 while change in X was -0x200

```X      	Y	Offset
0		.-7000	= 00CBF90E
0		.-6000	= 00CBF904
0		.-5000	= 00CBF9FC
0		.-4000	= 00CBF8F4
0		.-3000	= 00CBF8E8
0		.-2000	= 00CBF8E8
0		.-1000	= 00CBF8E0
0		.0 	= 00CBF8D8
0		.1000	= 00CBF8D0
0		.2000	= 00CBF8C8
0		.3000	= 00CBF8C4
0		.4000	= 00CBF8C4
```

Main Block leads to OFFS A, C and E Each Offs contains a maximum of 8 adt files loaded.

```;;;;;;;;;;;;;;;;;;;;
;;   MAIN BLOCK   ;;
;;;;;;;;;;;;;;;;;;;;

00CBFBD8 - 0A16D9B8 - B
00CBFCD8 - 0A230008 - C
00CBFDD8 - 0A2319B8 - D
00CBFED8 - 0A484008 - E
```
```;;;;;;;;;;;;;;;;;;;;
;;    OFFS A      ;;
;;;;;;;;;;;;;;;;;;;;

0A16C240 - 12670008 - 1
0A16C8AC - 13070008 - 2
0A16CF18 - 14070008 - 3
0A16D584 - 166A0008 - 4
0A16DBF0 - 178A0008 - 5
0A16E25C - 182A0008 - 6
0A16E8C8 - 192A0008 - 7
0A16EF34 - 1A0A0008 - 8
```
```;;;;;;;;;;;;;;;;;;;;
;;    OFFS C      ;;
;;;;;;;;;;;;;;;;;;;;

0A230240 - 1A4A0008 - 1
0A2308AC - 1ACA0008 - 2
0A230F18 - 1C2A0008 - 3
0A231584 - 1C8A0008 - 4
0A231BF0 - 1FAA0008 - 5
0A23225C - 1FEA0008 - 6
0A2328C8 - 20CA0008 - 7
0A232F34 - 210A0008 - 8
```
```;;;;;;;;;;;;;;;;;;;;
;;    OFFS E      ;;
;;;;;;;;;;;;;;;;;;;;

0A484240 - 22CA0008 - 1
0A4848AC - 258A0008 - 2
0A484F18 - 2BB50008 - 3
0A485584 - 2BF50008 - 4
```