• 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?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: HGSS Mapping - Section 0 & BDHC (Terrain Settings)

1
Posts
14
Years
  • Seen Feb 8, 2015
Hi guys. I've recently been looking at ROM Hacking for Gen 4. It seems that the R&D scene is prety dead right now for this Gen, so I'm not sure if this info will actually get put to any use, but I just thought I'd post this anyway. Pokemon is not my primary passion, it's just been something different for me to do during the holidays, so I could lose interest in this quite quickly. Therefore I figured that now would be a good time to share what I've discovered recently.

There doesn't seem to be much info around about these particular elements of map modding, so hopefully this is new to people...

Section 0
-----------------------
First of all there's an Int16 which is always 0x3412.
After that there's another Int16 which says how many more bytes there are to make up the rest of the section.

I've discovered that this particular section is all about creating sound zones. I took New Bark Town as my sample, and came up with this diagram...

[PICTURE] --> mediafire(dot)com/convkey/6772/s9lfl5335pq7du26g.jpg?size_id=5


Here is the Section 0 data for New Bark Town, which is 0x58 bytes long...

01 00 00 80 08 14 0C 18 - Blue box
01 00 00 80 13 16 17 1A - Blue box
01 00 00 80 12 06 14 08 - Blue box
01 01 00 80 14 17 16 19 - Green box
01 01 00 80 09 15 0B 17 - Green box
02 01 00 80 1C 0E 1C 12 - Pink box
01 01 00 80 12 06 13 07 - Green box
01 00 00 80 19 0D 1A 0F - Blue box
01 01 00 80 1A 0D 1A 0E - Green box
02 00 00 80 1B 0E 1B 12 - Cyan box
02 00 00 80 1A 10 1A 12 - Cyan box

To break down the data...
Byte 1 = sound code
Byte 2 = Volume (?)
Bytes 3 & 4 = (?) Padding
Byte 5 = Top Left X
Byte 6 = Top Left Y
Byte 7 = Bottom Right X
Byte 8 = Bottom Right Y

Essentially the data creates zones by defining the top left and bottom right corners of each zone, relative to the top left corner of the entire map.

I coloured the boxes in my diagram according to the sound code and volume. In the Blue and Green areas you will hear the windmill sounds, with Green being louder. In the Cyan & Pink areas, you will hear to sound of the sea, with Pink being louder.

To test this out, I found that it was better to disable to background music on the map. I did this by editing the arm9 file using CrystalTile2. I set the day and night music pointer to zero rather than 1000 (and something)...



BDHC
-----------------------

I've not discovered much about this yet, only how the data is arranged in sections.

Header,
Of course, we have BDHC as the "magic word".
Then after that will come six Int16 numbers which describe how many ELEMENTS are in each of the follwing six sections. I will call these six numbers P,Q,R,S,T,U.

Data,
The length of each section is then determined like so...
1) - P * 8
2) - Q * 12
3) - R * 4
4) - S * 8
5) - T * 8
6) - U * 2

And that's about all I've got so far! :) I've tested this BDHC theory on a few maps in HGSS, and so far it's held up nicely.


Like I say, I hope this is useful stuff, even though there doesn't seem to be much Gen 4 activity going on. I hope it might spark someone else to delve deeper into this, as Pokemon really isn't my primary focus for game modding, so I doubt I'll ever put this towards anything. I just love trying to reverse engineer file formats :)
 
Last edited:
3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024
Very nice work!
I've been wanting to look into those sections for a while now, but I never really did get to it.
 
Back
Top