• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Research: The Map System(R/S) only

cooley

///Keepin' it simple
1,148
Posts
17
Years
Here is a Document on the Map system(In English).
CopyRighted By → F-Zero
Yeah I know it's long but you'll learn something.

Map bank pointer Table:
Sapphire-Japanese = 2E0980
Ruby-Japanese = 2E09F0
Sapphire English = 308518
Ruby English = 308588
[Pointers in map bank 00] [pointer in map bank 01]…

Map banks:
[Pointers on headers of map 00] [pointer on headers of map 01]…

Map header:
[Pointers on map for tying up] [pointers on Eventdaten]
[Pointers on Scripts] [pointer on tying up]
[Music (2-Byte)][Map pointer index (2-Byte)]
[Name (1-Byte)][Cave (1-Byte)][Weather (1-Byte)][Permission byte (1-Byte)]
[0000] [names the map when entering indicate Ja=01/Nein=00 (1-Byte)][Combat type (1-Byte)]

Pointer on map for tying up:
This pointer is used only if the map is loaded as binding.

Map pointer index:
Sapphire-Japanese = 2DD310
Ruby-Japanese = 2DD380
Sapphire English = 304EA8
Ruby English = 304F18
[Pointers on map with index 1] [pointer on map with index 2]…
This Table is used only if the map is loaded as main map.

Name:
Index in folegender table: (First index = 00)
Sapphire-Japanese = 3BEF50
Ruby-Japanese = 3BEF6C
Sapphire English = 3E741C
Ruby English = 3E73C4
[X] [Y] [width 01 or 02] [height of 01 or 02] [pointers on map names]

X/Y/Breite/Höhe:
Position and size of the city on the flight map
The size can be for long only 01 for short or 02.
Starting from 03 nothing more is represented.

Weather:
00 = house weather
01 = sunny weather with clouds in the water
02 = normal weather
03 = rain weather
04 = 3 flakes
05 = rains with thunderstorm
06 = nebulas remains nearly on the place
07 = continuous snow
08 = sandstorm
09 = nebulas blows from above right
0A = poet bright fog
0B = cloudy
0C = underground flashes
0D = much rain with thunderstorm
0E = underwater fog

Permission byte:
00 = no flies; No Schaufler; No Teleport; Rahmen-Typ-1
02 = flies; No Schaufler; Teleport; Rahmen-Typ-2

Cave:
00 = normal
The following values need Rahmen-Typ-2
01 = darkness, lightning applicable
02 = darkness, lightning not applicable
Starting from 03 somehow only still darkly and lightning seems to be not applicable.

Combat type:
00 = coincidental
01 = arena Style
02 = team Rocket Style
03 =???
04 = 1. Top-4
05 = 2. Top-4
06 = 3. Top-4
07 = 4. Top-4
08 = large one red POKéBALL

Map:
[X-size] [Y-size]
[Pointers on edge right parallelepiped] [pointer on map data]
[Pointers on Tileset-1] [pointer on Tileset-2]

Edge right parallelepiped:
[Block on the left of above] [block on the top right] [block on the left of down] [block right down]
(Reference: Blocks are 2x2 Tiles largely, a whole right parallelepiped are 4x4 Tiles largely)

Tying up:
[Number] [of pointers on tying up data]

Tying up data:
[Direction] [shift (based on the edge of map)]
[Map bank (1-Byte)][Map number (1-Byte)][00] [00]

Direction:
01000000 = down
02000000 = above
03000000 = left
04000000 = right

Tileset:
[Determining byte (4-Byte)]
[Pointers in Tileset picture]
[Pointers on color data (color offset)]
[Pointer on block data]
[Pointers on tasks]
[Pointers on animation]

Determining byte:
[Tileset uses compression (N=00/J=01) (1-Byte)]
[Unterfarbwahl (color offset + C0 * VALUE) (1-Byte)]
(VALUE should be with Tileset-1 = 0 and with Tileset-2 = 1)
[00] [00]

Tileset picture:
Compressed or unkomprimiertes Tileset (depending upon determining byte)

Color data:
6 pallet entries to ever 32 bytes (16 * 2-Byte-Farbwert)

Block data:
[Block-Nr-Teil-2 (1-Byte)][Pallet (1/2-byte)][Block-Nr-Teil-1 + Flip (1/2-byte)]

Flip:
+4 for X-Flip
+8 for Y-Flip
+C for X-Y-Flip

Eventdaten:
[Number of persons/Warps/triggers/Signposts]
[Pointers on persons] [pointers on Warps] [pointer on trigger] [pointer on Signposts]

IMPORTANTLY: With the Events all segments without statement of size 1 byte are long!

Persons:
[Person number] [mask number] [??][??]
[X (2-Byte)][Y (2-Byte)]
[??][Line of sight] [movement] [??]
[Coach 1=Ja/0=Nein] [??][Range of vision with coaches (2-Byte)]
[Scriptpointer (4-Byte)]
[Nummer+Status (2-Byte)][??][??]

Warps:
[X (2-Byte)][Y (2-Byte)]
[Eventnummer??][Goal Warp number] [Warp] [map bank]

Trigger:
[X (2-Byte)][Y (2-Byte)]
[??][00] [????]
[??][00] [00] [00]
[Scriptpointer (4-Byte)]

Signposts:
[X (2-Byte)][Y (2-Byte)]
[00] [00=Kein hidden Item/07=Verstecktes Item] [00] [00]
[Scriptpointer (4-byte)]

Line of sight:
Person can turn freely:
00-02 = down
03-04 = above
05 = left
06 = right

Statically:
09 = above
0A = left
0B = right
0C = down

Movement:
01 = no movement
02 = simple movements

Nummer+Status:
Number:
Inquiry number (If)

Status:
02 = if Abfrage<>0, then visibly
03 = if Abfrage=0, then visibly


Wild Pokemon data:
THX go at Philb, without which I would have found the data very many later warscheinlich only.
Sapphire-Japanese = 3792FC
Ruby-Japanese = 379304
Sapphire English = 39D29C
Ruby English = 39D454
Each segment of this table is divided as follows:

[Bank and number the map on that the Pokemon to appear are] [00] [00]
[Pointers on grass] [pointer on water] [pointer on tree] [pointer on fishing rod]

Importantly:
If a map has e.g. no Baumpokemon, is in place of the tree pointer 00000000.

All segments sequence directly.
End of the table is characterized by [FFFF0000].

In order to find the Pokemondaten to a map, the table must completely
are scanned, until the number agrees with that the map.

General format of the data:
[Frequency index?][Pointers on data]

Grass data:
12 * [Pokemon]

Water data:
5 * [Pokemon]

Tree data:
5 * [Pokemon]

Fishing rod data:
8 * [Pokemon]

Pokemon:
[Minimum level (1-Byte)][Maximum level (1-Byte)][Pokemon number (2-Byte)]​

CopyRighted by → F-Zero
 

Ooka

[font=Maven Pro][color=#A75EE2]Cosmic[/color][/fon
2,626
Posts
16
Years
Well, can you specify what behavior bytes do what(if you already did then I must have missed it)
 
4
Posts
15
Years
  • Seen Sep 9, 2011
I'm trying to develop a tool that reads maps from Pokemon Ruby. So far I've gotten it to come up with the right amount of Map Banks, but not the right amount of maps in that bank. I'm really struggling to understand this documentation, so I might be assuming that something's a pointer when it really a header or something. If these are supposed to be the pointers to the headers in the mini-listing, then how do I tell how many maps there are?
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
I'm trying to develop a tool that reads maps from Pokemon Ruby. So far I've gotten it to come up with the right amount of Map Banks, but not the right amount of maps in that bank. I'm really struggling to understand this documentation, so I might be assuming that something's a pointer when it really a header or something. If these are supposed to be the pointers to the headers in the mini-listing, then how do I tell how many maps there are?
In G/S/C, there are "map bank pointers" which point to the first map header of that bank. I assume there can be as many map headers in map bank as you like. Then, the second map bank pointer points to start of map headers of bank 2 and so on...

So basically, if the system in Ruby is actually the same as in 2nd gen games, you can't know in the beginning how many map headers are in a selected bank. You're going to have to see it yourself.
 

Gamer2020

Accept no Imitations!
1,062
Posts
15
Years
I'm trying to develop a tool that reads maps from Pokemon Ruby. So far I've gotten it to come up with the right amount of Map Banks, but not the right amount of maps in that bank. I'm really struggling to understand this documentation, so I might be assuming that something's a pointer when it really a header or something. If these are supposed to be the pointers to the headers in the mini-listing, then how do I tell how many maps there are?

Hi. You are doing this in PHP? Interesting...

There are no set of bytes or anything at the end of the map table for a bank that you can use to tell the code to go to the next bank. What I did what have a check that compares the current pointer to the original. If the pointer is the same it load a preset number of maps. If it isn't then it means it is repointed and you have it load and stop when it is at a specific byte buffer. Advance map uses 0xF7F7F7F7 so I would recommend using that to make it compatible.

If you do not understand what I am trying to say feel free to PM me because the mods on this site like to delete my posts for no reason.
 

bcrobert

Lazy Antagonist
82
Posts
12
Years
  • Seen Aug 8, 2022
At first, I underestimated this data. But I found a little easter egg that could push my hack to the next level.

If a map has e.g. no Baumpokemon, is in place of the tree pointer 00000000.

Does this mean that every map in the game without wild pokemon technically has "empty" wild pokemon data? If so, that should mean it's always safe to use the "wild pokemon" tab in A-Map, right? I only ask because I'm working mostly with Emerald which is notorious for sound corruption due to the common mistake of overwriting certain offsets.

But if this is true then the map banks might store the wild pokemon data safely even in maps that are created by the hacker...maybe. Can anyone confirm my suspicions and/or keep me from getting my hopes up?

EDIT. To clarify, I could hex edit the table if I absolutely had to...but I love utilities. Someone please save me from my hex editor...it's just so tedious.
 
Last edited:
Back
Top