Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-11-26 14:01:46

Irrelevant
New member
Registered: 2011-11-26
Post 1/4

[G/S] Map Connections

Hello, I recently just got into hacking the Pokemon games and I've been playing around with maps first and I found some documentation for completing the Map Connections (here and here). And after editing both New Bark Town and Route 29 and trying to do the map connections; I can't figure why the character disappears as he tries to cross the boundary into Route 29. I assume its a problem with the map connections but I can't see where I did wrong... So I'm hoping someone can steer me in the right direction. My notes on for completing my connection are below (shame there's no spoiler tag though =p).

"New Bark Town"
Map Bank: 24 (0x18)
Map #: 04
Height: 12 (0x0C)
Width: 13 (0x0D)
Connection Strip: 0xBC3A

"Route 29"
Map Bank: 24 (0x18)
Map #: 03
Height: 12 (0x0C)
Width: 24 (0x18)
Connection Strip: 0xBCED

New Bark Town to Route 29 0x97DB9

02 18 03 EB 7C 39 C7 0C 18 00 2F 36 C7

00 Connection Type 
    Left 0x02
01 Bank of the connected Map
    0x18
02 Number of the connect Map 
    0x03
03 Pointer to the Connection Strip
    0xBCED - 0x4002
    0x7CEB Big Endian
    0xEB7C Little Endian
05 Current Map Position 
    0xC700 + (0x0D + 6)*(0 + 3)
    0xC739 Big Endian
    0x39C7 Little Endian
07 Map Height
    0x0C
08 Map Width
    0x18
09 Y Alignment 
    0x00
0A X Alignment 
    0x18*2 -1
    0x2F
0B Window
    0xC706 + (0x18*2)    
    0xC736 Big Endian
    0x36C7 Little Endian

Offline

#2 2011-11-26 16:09:56

Miksy91
Member
Registered: 2010-10-16
Post 623/2,305

Re: [G/S] Map Connections

I tested the values through and it looks like all of them are calculated correctly.
I suggest you to open the map connection with Johtomap to see whether I've written the "Structure" right or not because I'm not quite sure anymore (have been editing the map connections with Johtomap only).

Anyway, if that's not the problem, you should post a screenshot about the map data of Route 29 so we could see, where "Pointer to Connection Strip" leads in the connected map.

P.S
"Map Height" is actually "Width of connection in the connected map"
In some cases, you don't want the width of the connection be as big as the map data itself.

Last edited by Miksy91 (2011-11-26 16:11:43)

Offline

#3 2011-11-26 17:00:52

Irrelevant
New member
Registered: 2011-11-26
Post 2/4

Re: [G/S] Map Connections

The structure appears to be correct, I checked a few times to be sure. You'll have to excuse me since I'm still getting use to the terminology. By screen shot of Map Data, you mean a screenshot of the hex at the start of the map or something else?

Offline

#4 2011-11-26 17:34:45

Miksy91
Member
Registered: 2010-10-16
Post 624/2,305

Re: [G/S] Map Connections

I meant a screenshot like this one

screenshotah.jpg

*As you probably know, you're supposed to point to the 3rd tree block counted from the upper-right corner of the map.

Then again...have you changed the scripts of the map's Script Header ?

Offline

#5 2011-11-26 18:19:07

Tauwasser
Member
Registered: 2010-10-16
Post 237/447

Re: [G/S] Map Connections

Irrelevant wrote:

"New Bark Town"
Map Bank: 24 (0x18)
Map #: 04
Height: 12 (0x0C)
Width: 13 (0x0D)
Connection Strip: 0xBC3A <-- You put your map in rom bank 0x02?

"Route 29"
Map Bank: 24 (0x18)
Map #: 03
Height: 12 (0x0C)
Width: 24 (0x18)
Connection Strip: 0xBCED

New Bark Town to Route 29 0x97DB9

02 18 03 EB 7C 39 C7 0C 18 00 2F 36 C7

00 Connection Type
    Left 0x02
01 Bank of the connected Map
    0x18
02 Number of the connect Map
    0x03
03 Pointer to the Connection Strip
    0xBCED - 0x4002   <--- What are you doing this for?
    0x7CEB Big Endian
    0xEB7C Little Endian

You're probably disappearing because the game is using invalid collision data from some scratchpad in RAM after the map change.

cYa,

Tauwasser

Last edited by Tauwasser (2011-11-26 18:20:18)

Offline

#6 2011-11-26 19:00:28

Irrelevant
New member
Registered: 2011-11-26
Post 3/4

Re: [G/S] Map Connections

Connection Strip: 0xBC3A <-- You put your map in rom bank 0x02?

That's where JohtoMap repointed it :x

0xBCED - 0x4002   <--- What are you doing this for?

I'm not experienced in gb hacking, I've only done it for psx. I read somewhere that you have to correct your pointer because of the way the ram/rom is loaded; it has to fall inbetween 4000 - 7fff? Is this wrong too?

Then again...have you changed the scripts of the map's Script Header

I deleted most of the events from the maps and added a few simple ones while I'm learning.

ss.jpg

Offline

#7 2011-11-26 19:27:24

Miksy91
Member
Registered: 2010-10-16
Post 625/2,305

Re: [G/S] Map Connections

Your most upper-right tree block is at offset $BCED right ?
Then, the pointer should lead to $BCEB instead.

Anyway, I wouldn't recommend using Johtomap to repoint map, event or script header datas.
You should do it manually by going to the Secondary Header with a hex editor.

This is because there is lots of unused data in the end of the rom which you should use for your own stuff.
Then again, the first rom banks contain a lot data which you might want to expand later (movesets for instance) so you shouldn't use their rom banks for scripts and such.

Irrelevant wrote:

I'm not experienced in gb hacking, I've only done it for psx. I read somewhere that you have to correct your pointer because of the way the ram/rom is loaded; it has to fall inbetween 4000 - 7fff

Correct - this is because Gameboy can only store two rom banks in ram at the same time.
Rom bank 0 is always loaded in ram (0000-3FFF) and also another rom bank (which can be any bank in the rom data) but this one will change every time the game has to call data from another rom bank. This rom bank is copied to 4000-7FFF in ram.

Last edited by Miksy91 (2011-11-26 19:34:47)

Offline

#8 2011-11-26 20:13:52

Irrelevant
New member
Registered: 2011-11-26
Post 4/4

Re: [G/S] Map Connections

Is there any bank that is preferred for this data? Or is not terribly important?
And, finally, if a map has no events/scripts on it; how would you set the map script, Event Data, etc. pointers? I tried to find a map used in-game that had 0 events on it but I couldn't find one.

And thanks for being so helpful ^_^'

Offline

#9 2011-11-26 20:26:43

Miksy91
Member
Registered: 2010-10-16
Post 627/2,305

Re: [G/S] Map Connections

You could for example start putting new data in 0x1BC000 -->
All data there is 00 and unused.

A:
In this case, set bank of Events/Map's script to 6F (because 0x6F * 0x4000 = 0x1BC000 which leads to rom region $1BC000 - $1BFFFF).
Then, for example Script header point to 00 40 so it would point to offset 0x1BC000 (which could be in basic case just 00 00).
*Read about how Script Headers work in Tauwasser's scripting compendium, 00 00 indicates for no special happenings when the map is entered.

If your Map's Script is just 00 00, you can set Event data pointer to 02 40 so it would point straight to 0x1BC002.
This is what event structure looks like: http://skeetendo.110mb.com/scriptingcod … ventaufbau

Offline

Board footer

Powered by FluxBB