Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-01-26 15:29:23

Cloud
Member
Registered: 2010-12-18
Post 68/285

Help with map connection

I always wondering why when i resize an outside map like New bark town, there will be a tree in the center of the town and i can't go to route 29 because there is a tree. I think this is because of the map connection. I've tried Megamap and Johtomap to edit it but always fails. So, i think editing it manually is the only way... But, can someone explain how they work and how to edit it? I really need help in doing this!

Last edited by Cloud (2011-03-24 00:32:58)

Offline

#2 2011-01-27 23:48:19

Sawakita
Administrator
Registered: 2010-10-16
Post 83/364

Re: Help with map connection

Try giving a look here, here and here (actually this last one is for 1st gen but the two generations are pretty similar in this aspect so it should help, somehow).

Offline

#3 2011-02-03 09:40:53

Cloud
Member
Registered: 2010-12-18
Post 85/285

Re: Help with map connection

I'm confused

connection01.png

connection02.png

It's fine before i step in the connection. But,then...

connection03.png

connection04.png

I try to connect New Bark with Mahogany.

Last edited by Cloud (2011-02-03 10:03:31)

Offline

#4 2011-02-03 10:00:52

Cloud
Member
Registered: 2010-12-18
Post 86/285

Re: Help with map connection

This is the information in JohtoMap:

New Bark

  • Dest.bank = 02

  • Dest.map = 07

  • Width = 10

  • Height = 09

  • X = 09

  • Y = 04

  • OMDL = C730

  • CMPDL = C730

Mahogany

  • Dest.bank = 24

  • Dest.map = 04

  • Width = 10

  • Height = 09

  • X = 00

  • Y = 04

  • OMDL = C73D

  • CMPDL = C730

Offline

#5 2011-02-03 11:09:56

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

Re: Help with map connection

Umm, I'm not sure how to help you here. JohtoMap seems to miss the data pointer to the map's mapdata... At least it's not in the map connection dialog.

I'm guessing you got the map numbers right. Now, since this is a left-right connection, height is actually the height of the strip you see from the other map, so 0x09 seems fine here. Mahogany's width is 0x0A, so that seems fine. However, you mentioned that you resized New Bark Town, so the width might not be 0x0A anymore, screwing this up.

If the width still is 0x0A, we can go on:

Since both maps are 0x09 blocks in height and the exits match at Y = 0x00, your X and Y event lines for Mahogany should actually be X: 0x00; Y: 0x00, else you would have set New Bark Town 0x02 blocks above Mahogany (thus making events appear on the wrong location after changing maps again).
Now, since it's going to be a left connection from New Bark Town, the X event line should be (0x0A * 0x02) - 0x01 = 0x13, not 0x09. Since we don't want any block offset, Y line should be 0x00 again.

Now, OMDL is the target RAM location where the strip of the other map will be placed, starting from its top-left corner. Going left from New Bark Town:

0xC700 + (Width_of_current_Map + 0x06) * (Y_Offset_of_View_Strip_in_Blocks + 0x03).

As mentioned earlier we don't have a Y-offset. Width of New Bark Town is 0x0A, therefore: OMDL = 0xC700 + (0x0A + 0x06) * (0x00 + 0x03) = 0xC730, so that seems ok to me.

CMPDL is the top-left block you will see after changing the map. Since we use a left connection from New Bark Town's point of view, we will use this formula:

0xC706 + 0x02 * Width_of_connected_Map.

Width of Mahogany is 0x0A. Therefore OMDL = 0xC706 + 0x02 * 0x0A = 0xC71A != 0xC730, so I think your CMPDL is wrong. This means that after you've changed maps, blocks are going to start appearing as if you were lower on the map than you are.

Now for Mahogany:

Width of New Bark is 0x0A, or else all calculations are wrong anyway and you resized the map. Height of the view strip is 0x09, which is ok, since the map is 0x09 blocks high. X and Y event lines were dealt with above.
This is a right connection to New Bark Town from Mahogany's point of view, therefore for OMDL:

0xC6FD + (Width_of_current_Map + 0x06) * (Y_Offset_of_View_Strip_in_Blocks + 0x04)

OMDL = 0xC6FD + (0x0A + 0x06) * (0x00 + 0x04) = 0xC73D, which is what you put in there.

Now for after changing from Mahogany to New Bark Town:

We use 0xC707 + Width_of_connected_Map. CMPDL = 0xC707 + 0x0A = 0xC711 != 0xC730. Therefore, you will see blocks appearing as if you were lower on the New Bark Town map than you actually are and possibly as if you were outside of the map to the left.

This is shown very nicely in both of your pictures. Since the event lines were incorrect, too events will be loaded at the wrong spaces independently from blocks:
connection03.pngconnection04.png

See this is exactly what happened. New Bark is treated to be lower and on the left of the map, while Mahogany is treated as you being to the lower and right-hand side of the map.

If you use the values in this thread and if you did not resize new Bark Town, you won't have any problem. The only thing to take care of is that you will have to calculate the view strip pointer manually and plug it in there, since JohtoMap seems to be missing a field for it.

Also, I want to mention that I object to these crass and inaccurate labels in JohtoMap, since they are very misleading.

cYa,

Tauwasser

Last edited by Tauwasser (2011-02-03 11:12:19)

Offline

#6 2011-03-23 15:44:21

rockyrojas88
Member
Registered: 2011-01-23
Post 23/46

Re: Help with map connection

I had this problem too when editing Viridian City. I always got trees blocking me from the routes.. o.O

Offline

#7 2011-03-24 23:16:27

Cloud
Member
Registered: 2010-12-18
Post 170/285

Re: Help with map connection

View of Target

Direction of the connection - Account for the correct value (Based on a connection at the edge of the current map)

Top 0xC703 + X displacement of the visible part in blocks

Below 0xC703 + (0x03 + Height of the current map) * (Width of the current map + 0x06) + X displacement of the visible part in blocks

Links 0xC700 + (0x06 + Width of the current map) * (Y shift of the visible part into blocks + 0x03)

Right 0xC6FD + (width of the current map + 0x06) * (Y shift of the visible part into blocks +0x04)

Last edited by Cloud (2011-03-25 00:28:24)

Offline

#8 2011-03-25 05:33:22

Cloud
Member
Registered: 2010-12-18
Post 172/285

Re: Help with map connection

X-Y Event line

Y: Best (height of the attached map * 0x02) - 0x01 Below 0x00 Left / Right (Y shift of the visible part in blocks-0x02 *)

X: Up /Down (X shift of the visible part in blocks-0x02 *) links (X size of the attached Map * 0x02) - 0x01 Right 0x00

That actually answer all of my question. Thanks for the time.

Last edited by Cloud (2011-03-25 05:36:43)

Offline

Board footer

Powered by FluxBB