Area Data[]
Each area's data has two parts:
- a list of two-byte pointers, one for each screen of the map.
- a list of encounter structures.
Encounter structure[]
Bytes | data |
---|---|
1 | Maximum number of enemies |
1 | Max chance |
5 | Chances |
2-10 | Prebuild enemy ids |
To explain the data, I'll use Oasis World as an example:
The ROM map will show you that the Oasis World data starts at 0x29773. We follow the first pointer to 0x297f3 to get the encounter for the first screen.
01 | 07 | 03 07 00 00 00 | 02 00 | 03 00 |
- 1 enemy can appear (if it was a 2 it would be 1 or 2 enemies)
- A random value lower than 7 is computed
- If it is smaller than 3 a Spotslime (02 00) appears (3/7 chance)
- If it is larger or equal to 3 and smaller than 7 a CactiBall (03 00) appears (4/7 chance)
Note that this instance uses only 4 out of the possible 10 bytes for ids.
Note that the last comparison value should be the same as the max comparison value, or the game will read into the id values.
Exceptions[]
Randomly generated maps such as LastLord, YlwPlain, RedLake, etc will not use this generation system. These maps, along with their encounters, are generated instead of being fixed to this structure. Prebuilt ID general usages
Organization in ROM[]
First Byte | Last Byte | Data stored |
---|---|---|
29773 | Oasis World | |
29856 | Well | |
2989B | Pirate World | |
29A4C | HoodSquid's cave | |
29A8A | Harmirror cave 1F | |
29AB7 | Harmirror cave 2F | |
29ADE | Harmirror cave 3F | |
29AFF | Moonrock tower 1F | |
29B14 | Moonrock tower 2F | |
29B29 | Ghost ship 1F | |
29B45 | Ghost ship 2F encounter data | |
29B58 | Ghost ship cabin encounter data | |
29B6B | Ice World | |
29D5D | Gold mine | |
29D9B | Spooky forest | |
29DCA | Sleep herb mountain | |
29DE7 | Ice tower 1F | |
29E0C | Ice tower 2F | |
29E2B | Sky World | |
2A028 | Fhunt tower 1F | |
2A03D | Fhunt tower 2F | |
2A052 | Fhunt tower 3F | |
2A06B | Fhunt tower 4F | |
2A084 | Heaven helm cave 1F | |
2A097 | Heaven helm cave 2F | |
2A0BA | Heaven helm cave 3F | |
2A0DD | Heaven armor tower 1F | |
2A0F2 | Heaven armor tower 2F | |
2A107 | Heaven armor tower 3F | |
2A120 | Heaven armor tower 4F | |
2A139 | Heaven sword castle 1F | |
2A160 | Heaven sword castle 2F | |
2A181 | Heaven sword castle 3F | |
2A1A2 | Heaven sword castle 4F | |
2A1BD | Limbo World | |
2A1FB | Darck's castle | |
2A220 | Elf World | |
2A2AB | AgDevil's lair | |
2A2D2 | Lonely World | |
2A2EB | Basement | |
2A300 | Traveler World | |
2A382 | Dark Merchant's Tower 1F | |
2A393 | Dark Merchant's Tower 2F | |
2A3AA | Dark Merchant's Tower 3F | |
2A3BF | Dark Merchant's Tower 4F |