EarthBound Beginnings/Map data: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(A little fixing up.)
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
EarthBound Zero uses one very large map containing all areas in the game. To accomodate this within the small space available in a NES cartridge, two levels of tiling are used: the map is made of 64x64 tiles, which in turn are made of 16x16 tiles.
{{subpage|game=EarthBound Beginnings}}
EarthBound Beginnings uses one very large map containing all areas in the game. To accomodate this within the small space available in a NES cartridge, two levels of tiling are used: the map is made of 64x64 tiles, which in turn are made of 16x16 tiles.


==Main map data==
==Main map data==
Line 5: Line 6:
<caption>Map bank layout</caption>
<caption>Map bank layout</caption>
<tr><th>Range<th>Bits 0-5<th>Bits 6-7
<tr><th>Range<th>Bits 0-5<th>Bits 6-7
<tr><td>0000-1FFF<td colspan=2>Map
<tr><td>0000-1FFF<td colspan=2>Map data
<tr><td>2000-2FFF<td colspan=2>64x64 tiles
<tr><td>2000-2FFF<td colspan=2>64x64 chunks
<tr><td>3000-37FF<td>16x16 tiles<td rowspan=2>64x64 palettes
<tr><td>3000-37FF<td>16x16 metatiles<td rowspan=2>64x64 chunk palettes
<tr><td>3800-3FFF<td>Map sectors
<tr><td>3800-3FFF<td>Sector properties
</table>
</table>
The main part of the map data, located at 2010-2000F, is "organized" into eight 16kB banks, each containing data for 32 rows of the map and 4 tilesets. Bank 0 is at 10-400F, bank 1 is at 4010-800F, and so on until bank 7 which is at 1C010-2000F. You may have noticed that bank 0 is partially outside the range given. Bank 0 is special in that it only contains tilesets; there is unrelated data in the first half of it where the map would be.
The main part of the map data, located at 2000-1FFFF, is "organized" into eight 16kB banks, each containing data for 32 rows of the map and 4 tilesets. Bank 0 is at 0-3FFF, bank 1 is at 4000-7FFF, and so on until bank 7 which is at 1C000-1FFFF. You may have noticed that bank 0 is partially outside the range given. Bank 0 is special in that it only contains tilesets; there is unrelated data in the first half of it where the map would be.


Ranges stated hereafter in this section shall refer to offsets within each bank, rather than the whole file.
Ranges stated hereafter in this section refer to offsets within each bank, rather than the whole file.


===Map===
===Format===
The map itself is in the first half of each bank, from 0000-1FFF. Each byte corresponds to one 64x64 tile. Bits 0-5 determine which tile to use. Bit 6, if set, will use a tile from the second tileset instead of the first. Bit 7 is set on tiles which change based on events, of which there are only two in the whole game: one north of Merrysville for the rocks blocking the way to Union Station, and one at the very top of Mt. Itoi behind the "XX".
Each part of the map corresponds to a square, and point to each other. For example, each group of 16 bytes (in the 2000-2FFF range) is called a "chunk", and if a chunk's bytes were:


===64x64 tiles===
<pre>
The composition of 64x64 tiles is at 2000-2FFF. Bits 0-6 select a 16x16 tile, and bit 7 determines whether to use the first or second tileset again. If the 64x64 tile was from the first tileset, then setting bit 7 will put in a 16x16 tile from the second tileset, and vice versa.
01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10
</pre>


===64x64 tile palettes===
The image would be shown as:
These are in the upper 2 bits of 3000-3FFF. Each byte determines the sub-palette for one of the 16x16 tiles that a 64x64 tile is made of.
 
<pre>
01 02 03 04
05 06 07 08
...
</pre>
 
 
===Map data===
The map itself is in the first half of each bank, from 0000-1FFF (except for bank 0, see above). Each byte corresponds to one 64x64 tile. Bits 0-5 determine which tile to use. Bit 6, if set, will use a tile from the second tileset instead of the first. Bit 7 is set on tiles which change based on events, of which there are only two in the whole game: one north of Merrysville for the rocks blocking the way to Union Station, and one at the very top of Mt. Itoi behind the "XX".


===16x16 tiles===
Unlike other types, they are not stored in larger squares. The chunks must be calculated manually and are not directly related to this data.
16x16 tiles are at 3000-37FF, in the low 6 bits only. Each byte selects one 8x8 PPU tile.


===Map sectors===
===64x64 chunks===
Properties associated with map sectors (squares, 4 tiles wide) are at 3800-3FFF, again in the low 6 bits only. Each sector has 4 bytes here; they are the palette, area, first tileset, and second tileset in that order. Map sectors with palettes differing from the current palette are not displayed.
The composition of 64x64 tiles is at 2000-2FFF. Bits 0-6 select a 16x16 tile, and bit 7 determines whether to use the first or second tileset again. If the 64x64 tile was from the first tileset, then setting bit 7 will put in a 16x16 tile from the second tileset, and vice versa. Each 64x64 chunk is a 4x4 grid of metatiles, so 16 bytes.


==Map area random encounter table==
===64x64 chunk palettes===
{{Infobox table|name=Map area random encounter table
These are in the upper 2 bits of 3000-3FFF. Each byte determines the sub-palette for one of the 16x16 tiles that a 64x64 tile is made of.
|game=EarthBound Zero
|loc=ROM
|start=0x295A3
|end=0x295E2
|numentries=64
|entrylength=1
|totallength=64 bytes (0x40)
}}
This table, located at 295A3 to 295E2, determines both the set of random encounters and the frequency thereof with one byte for each map area. The frequency is in bits 0-2 (lower values mean more battles), and the group in bits 3-7.


===Group Values===
===16x16 metatiles===
* 0 = Player's Basement
16x16 metatiles are at 3000-37FF, in the low 6 bits only. Each byte selects one 8x8 PPU tile. Unlike the other types, this is 4 bytes long (a 2x2 grid).
* 1 = Podunk
* 2 = Cemetery
* 3 = City Zoo
* 4 = City Zoo Outskirts?
* 5 = Merrysville Outskirts?
* 6 = Reindeer Outskirts?
* 7 = Halloween Outskirts?
* 8 = Snowman
* 9 = Yucca Desert
* A = Yucca Desert Outskirts
* B = Swamp
* C = Ellay Outskirts
* D = Rosemary Manor 1
* E = Rosemary Manor 2
* F = Rosemary Manor 3
* 10 = City Zoo Office?
* 11 = Duncan's Factory 1
* 12 = Duncan's Factory 2
* 13 = Halloween?
* 14 = Sweet Little Factory
* 15 = Sweet Little Factory 2
* 16 = Mt. Itoi
* 17 = Mt. Itoi Summit
* 18 = Mt. Itoi Caves
* 19 = Mt. Itoi Lake
* 1A = Magicant
* 1B = Crystal Caverns
* 1C - 1F = Player's Basement<br clear=all>


==Random encounter groups==
===Sector properties===
{{Infobox table|name=Random encounter groups
Properties associated with map sectors (squares, 4 tiles wide) are at 3800-3FFF, again in the low 6 bits only. Each sector has 4 bytes here; they are the palette, area, first tileset, and second tileset in that order. Map sectors with palettes differing from the current palette are not displayed.
|game=EarthBound Zero
|loc=ROM
|start=0x29210
|end=0x2940F
|numentries=32
|entrylength=16
|totallength=512 bytes (0x200)
}}
The random encounter group table determines all the possible random battles. Whenever a random encounter starts, a random byte out of the appropriate group of 16 is picked. If it is 0, another byte is picked until a nonzero one is found; in this way there may be fewer than 16 possible battles. The byte refers not to an enemy, but to an enemy group.

Latest revision as of 12:15, 17 November 2024

This is a sub-page of EarthBound Beginnings.

EarthBound Beginnings uses one very large map containing all areas in the game. To accomodate this within the small space available in a NES cartridge, two levels of tiling are used: the map is made of 64x64 tiles, which in turn are made of 16x16 tiles.

Main map data

Map bank layout
RangeBits 0-5Bits 6-7
0000-1FFFMap data
2000-2FFF64x64 chunks
3000-37FF16x16 metatiles64x64 chunk palettes
3800-3FFFSector properties

The main part of the map data, located at 2000-1FFFF, is "organized" into eight 16kB banks, each containing data for 32 rows of the map and 4 tilesets. Bank 0 is at 0-3FFF, bank 1 is at 4000-7FFF, and so on until bank 7 which is at 1C000-1FFFF. You may have noticed that bank 0 is partially outside the range given. Bank 0 is special in that it only contains tilesets; there is unrelated data in the first half of it where the map would be.

Ranges stated hereafter in this section refer to offsets within each bank, rather than the whole file.

Format

Each part of the map corresponds to a square, and point to each other. For example, each group of 16 bytes (in the 2000-2FFF range) is called a "chunk", and if a chunk's bytes were:

01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10

The image would be shown as:

01 02 03 04
05 06 07 08
...


Map data

The map itself is in the first half of each bank, from 0000-1FFF (except for bank 0, see above). Each byte corresponds to one 64x64 tile. Bits 0-5 determine which tile to use. Bit 6, if set, will use a tile from the second tileset instead of the first. Bit 7 is set on tiles which change based on events, of which there are only two in the whole game: one north of Merrysville for the rocks blocking the way to Union Station, and one at the very top of Mt. Itoi behind the "XX".

Unlike other types, they are not stored in larger squares. The chunks must be calculated manually and are not directly related to this data.

64x64 chunks

The composition of 64x64 tiles is at 2000-2FFF. Bits 0-6 select a 16x16 tile, and bit 7 determines whether to use the first or second tileset again. If the 64x64 tile was from the first tileset, then setting bit 7 will put in a 16x16 tile from the second tileset, and vice versa. Each 64x64 chunk is a 4x4 grid of metatiles, so 16 bytes.

64x64 chunk palettes

These are in the upper 2 bits of 3000-3FFF. Each byte determines the sub-palette for one of the 16x16 tiles that a 64x64 tile is made of.

16x16 metatiles

16x16 metatiles are at 3000-37FF, in the low 6 bits only. Each byte selects one 8x8 PPU tile. Unlike the other types, this is 4 bytes long (a 2x2 grid).

Sector properties

Properties associated with map sectors (squares, 4 tiles wide) are at 3800-3FFF, again in the low 6 bits only. Each sector has 4 bytes here; they are the palette, area, first tileset, and second tileset in that order. Map sectors with palettes differing from the current palette are not displayed.