• 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.

[Other] Need Help with R/B Map Editing Please?

RaidenRaider

I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    Hey all, I require some help please!!!

    I'm currently working on a hack of Pokemon Red using the disassembly on Github, but I have no experience of creating new maps, which are all in .blk format, so I've been using a vanilla Red ROM to create the new maps in UltraMap, then work on the events and Wild Pokemon in ClassicMap, but what I'd like to do is extract the maps from the Red ROM and save them as .blk files which I can then add to my disassembly. Now my problem is that I know there is a newer program called RBMap, which can save edited maps out as files on the computer, but it is a .jar file requring a Linux system and I'm running Windows 7, so it won't work for me.

    - Is there any other way I can extract these edited maps from the Red ROM, save them to my PC and place them in my disassembly?
    - Is there a way to use the pokemontools/redtools files in the pokered disassembly to decompile a Red ROM with my modified maps in place?
    - Plus, is there a way to get ShantyTown's RBMap Editor working on Windows 7?

    - Power Plant - Floor 2 : https://drive.google.com/open?id=0BwcLhqV-5CLmaWZTbDZQc2dnVWc
    - Seafoam Islands - Basement Level 6 : https://drive.google.com/open?id=0BwcLhqV-5CLmQlU5eVExTnlYUkE
    - Victory Road - Basement Level 4 : https://drive.google.com/open?id=0BwcLhqV-5CLmWVYyQTM2dFhNX1E
    Need Help with R/B Map Editing Please?

    Need Help with R/B Map Editing Please?
     
    Last edited:
  • 171
    Posts
    11
    Years
    Keep the new maps you create/modify in a separate Pokemon Red ROM and include them in the disassembly using the INCBIN directive.

    So you could replace (in main.asm)

    Code:
    PalletTownBlocks: 
    INCBIN "maps/pallettown.blk"

    with

    Code:
    PalletTownBlocks: 
    INCBIN "baserom2.gbc", $30000, 25

    where, in this example, baserom2.gbc is the name of the pokemon red rom that has to be inside your repository where you're editing the maps, $30000 would be the offset where the pallet town block data starts in the baserom2.gbc file ($30000 is not where the pallet town map is in original pokemon red, but you get the point), and 25 would the size (number of bytes) of said block data.

    Alternatively you could extract the map data to (a) separate binary file(s) so that you don't need to upload the whole rom.
     
    Last edited:

    RaidenRaider

    I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    Keep the new maps you create/modify in a separate Pokemon Red ROM and include them in the disassembly using the INCBIN directive.

    So you could replace (in main.asm)

    Code:
    PalletTownBlocks: 
    INCBIN "maps/pallettown.blk"
    with

    Code:
    PalletTownBlocks: 
    INCBIN "baserom2.gbc", $30000, 25
    where, in this example, baserom2.gbc is the name of the pokemon red rom that has to be inside your repository where you're editing the maps, $30000 would be the offset where the pallet town block data starts in the baserom2.gbc file ($30000 is not where the pallet town map is in original pokemon red, but you get the point), and 25 would the size (number of bytes) of said block data.

    Alternatively you could extract the map data to (a) separate binary file(s) so that you don't need to upload the whole rom.

    Thanks for the details on how to do this. Does this mean that say using the INCBIN directive, I could create my new maps using the unused/glitched maps in the Red ROM, then link them onto existing maps, via say a ladder or door, and then when the edited ROM is disassembled, it would create everything I need to add to my own hack?
     
  • 171
    Posts
    11
    Years
    The idea is that you modify a map like Pallet Town (the block data) in a separate ROM with a map editor, and include it in the disassembly wherever you want, not necessarily over Pallet Town. So yes, you can use it to add new maps that you create. You're not disassembling this ROM, you're just grabbing a patch of data from it. You could include the map data at the end of bank 6, 7, or 8 where the rest of the maps are located, but they don't necessarily have to be there.

    For the map headers, objects, warps, scripts and such, just look at how it's done with other existing maps in the disassembly. data/mapHeaders, data/mapObjects, and scripts are the folders that you will have to check.
     

    RaidenRaider

    I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    The idea is that you modify a map like Pallet Town (the block data) in a separate ROM with a map editor, and include it in the disassembly wherever you want, not necessarily over Pallet Town. So yes, you can use it to add new maps that you create. You're not disassembling this ROM, you're just grabbing a patch of data from it. You could include the map data at the end of bank 6, 7, or 8 where the rest of the maps are located, but they don't necessarily have to be there.

    For the map headers, objects, warps, scripts and such, just look at how it's done with other existing maps in the disassembly. data/mapHeaders, data/mapObjects, and scripts are the folders that you will have to check.

    Okay I think I'm getting it. I've edited the Power Plant, Seafoam Islands Map 2 and Victory Road Map 2, as I want to add a second floor to the Power Plant, a sixth basement to the Seafoam Islands and a fourth level to Victory Road.

    According to Koolboyman's Red Map (provided by Mateo), the start offset for the Power Plant is $1E446, the start offset for Seaform Islands (2) is $468FA and the start offset for Victory Road (2) is $519AF. Unfortunately, I don't understand what you mean by "25 would the size (number of bytes) of said block data." Do you mean the size of the map? As for an example, the Power Plant is X size=20 and Y size=18.

    For the map data itself, it could easily fit in either Banks 6, 7, or 8. I do need to study the data/mapHeaders, data/mapObjects, and scripts folders in the disassembly further to understand how to add the map headers, objects, warps, scripts and such too.
     
  • 171
    Posts
    11
    Years
    Do you mean the size of the map? As for an example, the Power Plant is X size=20 and Y size=18.
    Yes

    Code:
    ...
    ModifiedPowerPlant:
    INCBIN "baserom2.gbc", $1e446, 20*18
    ...

    Map headers are simple. Connections can be tricky but if you're fine with connecting your new maps through warps, you won't need to define any connection data.

    Map objects:
    You can check out the object macro definition in macros.asm for the description of each element of the object macro.
    Some posts of this thread can help you understanding warps and the like.
     
    Last edited:

    RaidenRaider

    I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    Yes

    Code:
    ...
    ModifiedPowerPlant:
    INCBIN "baserom2.gbc", $1e446, 20*18
    ...
    Map headers are simple. Connections can be tricky but if you're fine with connecting your new maps through warps, you won't need to define any connection data.

    Map objects:
    You can check out the object macro definition in macros.asm for the description of each element of the object macro.
    Some posts of this thread can help you understanding warps and the like.

    So by putting these lines into main.asm in place of the standard lines for the Power Plant.
    ModifiedPowerPlant:
    INCBIN "baserom2.gbc", $1e446, 20*18

    It will extract the modified/new maps from that ROM and place them into the disassembly in the maps folder as .blk files?

    What I plan to do is add a new ladder/stairs to the existing maps on Power Plant, Seafoam Islands Map 2 and Victory Road Map 2, so that when you step on them, it sends you onto the new areas, which are the new maps created by me. The only events that will be in these rooms are going to be Wild Pokemon, Items, and an encounter with a rare Pokemon.
     
  • 171
    Posts
    11
    Years
    You don't have to extract anything. INCBIN lets you include them straight from the .gbc file as binary data. The only requirement is that baserom2.gbc must be inside your repository.
     

    RaidenRaider

    I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    You don't have to extract anything. INCBIN lets you include them straight from the .gbc file as binary data. The only requirement is that baserom2.gbc must be inside your repository.

    Wouldn't that just overwrite maps that are already in the disassembly when compiling new ROMS though? Or even cause comflict between the edited map and the original in it's .blk format?
     
    Last edited:
  • 171
    Posts
    11
    Years
    You're not overwriting anything. You're just adding new map data in another, empty place, without overwriting any other existing data.

    .blk is just a file extension. The content of that file happens to represent the block data of a map, but in the inside it's just a bunch of bytes. There's no difference between including the map data from a binary file like .gbc than from a .blk file, because the raw bytes you're including represent the same thing.
     

    RaidenRaider

    I WILL Catch'em ALL!!!!
  • 21
    Posts
    8
    Years
    • Seen Apr 15, 2020
    You're not overwriting anything. You're just adding new map data in another, empty place, without overwriting any other existing data.

    .blk is just a file extension. The content of that file happens to represent the block data of a map, but in the inside it's just a bunch of bytes. There's no difference between including the map data from a binary file like .gbc than from a .blk file, because the raw bytes you're including represent the same thing.

    Okay thanks dude. I'm going to give this try over the next few days, once I've worked out all of the bugs out of my own hack (currently in development). I ask because I'm trying to update my project as I develop it onto Github for other people to use at a later date, so I do need all of the files to be a part of the disassembly, hence why I'm asking about the .blk files.
     
    Back
    Top