Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#51 2011-08-28 18:42:22

Sawakita
Administrator
Registered: 2010-10-16
Post 198/365

Re: RGBY Map Headers

~Red wrote:

After picking up Wisteria again after some time to see if I could figure out I still was not able to get the connections right. I don't usually ask for handouts but I'm getting desperate, can someone tell me what data I need to input into connection data and explain how you got to that? I just cannot seem to connect route 5 to cinnabar, I managed to get cinnabar to connect to route 5, but not route 5 to cinnabar!

This is Route 5 header (Cinnabar's connection data in bold):

00 12 0A D245 B556 B256 0C
03 5E49 E8C6 10 14 23 0A BDC8
08 6940 3BC8 0A 0A 00 00 F9C6

Here is the connection data (I tested it, it works fine), explained:

Connected map ID = $08
Connection strip location = $4069
Current map position = $C6EB + (Height of Map + $03) * (Width of Map + $06) + X_Movement_of_Connection Strip = $C6EB + ($12 + 3) * ($0A + $06) + $00 = $C83B
map "bigness" = $0A
map width = $0A
Y alignment = $00
X alignment = $00
window = $C6EF + Width_of_connected_map = $C6EF + $0A = $C6F9

(all values are big-Endian, remember to convert to little-Endian where needed)

What is the part that confuses you?

Last edited by Sawakita (2011-08-28 18:53:48)

Offline

#52 2011-08-29 19:01:25

~Red
Member
Registered: 2010-10-16
Post 135/276

Re: RGBY Map Headers

Sawakita wrote:
~Red wrote:

After picking up Wisteria again after some time to see if I could figure out I still was not able to get the connections right. I don't usually ask for handouts but I'm getting desperate, can someone tell me what data I need to input into connection data and explain how you got to that? I just cannot seem to connect route 5 to cinnabar, I managed to get cinnabar to connect to route 5, but not route 5 to cinnabar!

This is Route 5 header (Cinnabar's connection data in bold):

00 12 0A D245 B556 B256 0C
03 5E49 E8C6 10 14 23 0A BDC8
08 6940 3BC8 0A 0A 00 00 F9C6

Here is the connection data (I tested it, it works fine), explained:

Connected map ID = $08
Connection strip location = $4069
Current map position = $C6EB + (Height of Map + $03) * (Width of Map + $06) + X_Movement_of_Connection Strip = $C6EB + ($12 + 3) * ($0A + $06) + $00 = $C83B
map "bigness" = $0A
map width = $0A
Y alignment = $00
X alignment = $00
window = $C6EF + Width_of_connected_map = $C6EF + $0A = $C6F9

(all values are big-Endian, remember to convert to little-Endian where needed)

What is the part that confuses you?


It's probably a combination of order of operations errors and the fact I don't know/understand what big/little Endian means.

Offline

#53 2011-08-30 00:10:11

Tauwasser
Member
Registered: 2010-10-16
Post 189/452

Re: RGBY Map Headers

Wikipedia has the answer. Order of operation should be clear from 5th grade.

cYa,

Tauwasser

Offline

#54 2011-08-30 18:57:59

~Red
Member
Registered: 2010-10-16
Post 136/276

Re: RGBY Map Headers

Tauwasser wrote:

Wikipedia has the answer. Order of operation should be clear from 5th grade.

cYa,

Tauwasser

I hope that wasn't a dig at my intelligence. We learned order of operations in Year 8, not "5th grade" (whatever THAT is). I never said I didn't know the order, I just made an error of sorts. (Brackets, Indices, Division, Multiplication, Addition, Subtraction).

Reading the wikipedia article just made my brain hurt. You have to explain things bluntly to me, not in language that I have to concentrate to understand.


@Sawakita I tapped in the values you gave me but it still does not transition smoothly. It connects but graphically it looks a mess, it seems the map is 1 tile too far south. Here is the ips file, I truly don't know what is wrong: http://www.mediafire.com/?bq6oem71zs6t3ce

Last edited by ~Red (2011-08-30 19:17:11)

Offline

#55 2011-08-30 22:22:00

Sawakita
Administrator
Registered: 2010-10-16
Post 201/365

Re: RGBY Map Headers

You had an error in Route 5's connection in Cinnabar header: Y-alignment's formula is:
   (Height_of_connected_map * 2) - 1 = $12 * 2 - 1 = $23
The byte you should change is at $1C011 (where you wrongly wrote $20).

About big-endian and little-endian:
big-endian = number's bytes are written starting from the most significant byte;
little-endian = number's bytes are written starting from the least significant byte.
Let's try with an example. Let's take an address, like $1AE (beginning of pointers to map headers):
$1AE is here written in big-endian format (01 AE). If you convert it to little-endian format you'll get AE 01.

Got it? (if not, maybe someone who is better at speaking english might explain it in a clearer way)

Offline

#56 2011-08-31 09:32:35

~Red
Member
Registered: 2010-10-16
Post 140/276

Re: RGBY Map Headers

Sawakita wrote:

You had an error in Route 5's connection in Cinnabar header: Y-alignment's formula is:
   (Height_of_connected_map * 2) - 1 = $12 * 2 - 1 = $23
The byte you should change is at $1C011 (where you wrongly wrote $20).

About big-endian and little-endian:
big-endian = number's bytes are written starting from the most significant byte;
little-endian = number's bytes are written starting from the least significant byte.
Let's try with an example. Let's take an address, like $1AE (beginning of pointers to map headers):
$1AE is here written in big-endian format (01 AE). If you convert it to little-endian format you'll get AE 01.

Got it? (if not, maybe someone who is better at speaking english might explain it in a clearer way)

That makes perfect sense, and I'll make the changes to the header data. Thanks so much for all your help!!!

Offline

#57 2011-09-03 08:29:14

~Red
Member
Registered: 2010-10-16
Post 148/276

Re: RGBY Map Headers

How do I change whether you can fly in an area or not?

Offline

#58 2011-09-03 08:57:54

Cartmic
Member
Registered: 2010-10-16
Post 72/156

Re: RGBY Map Headers

~Red wrote:

How do I change whether you can fly in an area or not?

Much that I enjoy helping people I think it would be better for you work it out yourself, you'll feel a greater sense of achievement when you do and your knowledge will increase.

Offline

#59 2011-09-03 09:12:42

~Red
Member
Registered: 2010-10-16
Post 149/276

Re: RGBY Map Headers

Cartmic wrote:
~Red wrote:

How do I change whether you can fly in an area or not?

Much that I enjoy helping people I think it would be better for you work it out yourself, you'll feel a greater sense of achievement when you do and your knowledge will increase.

I've tried, for some reason ever since I changed the tileset for Celadon City, you cannot fly out of it.

Offline

#60 2011-09-03 09:35:10

Cartmic
Member
Registered: 2010-10-16
Post 73/156

Re: RGBY Map Headers

~Red wrote:
Cartmic wrote:
~Red wrote:

How do I change whether you can fly in an area or not?

Much that I enjoy helping people I think it would be better for you work it out yourself, you'll feel a greater sense of achievement when you do and your knowledge will increase.

I've tried, for some reason ever since I changed the tileset for Celadon City, you cannot fly out of it.

What exactly did you change?

Offline

#61 2011-09-03 10:04:06

Sawakita
Administrator
Registered: 2010-10-16
Post 204/365

Re: RGBY Map Headers

How about using BGB debugger? (I know, it's my solution for everything!)

Offline

#62 2011-09-03 10:45:33

~Red
Member
Registered: 2010-10-16
Post 151/276

Re: RGBY Map Headers

Sawakita wrote:

How about using BGB debugger? (I know, it's my solution for everything!)

Well, I don't quite get how to use a Debugger. For instance, where do I set breakpoints? How do I make it follow my progress? It seems the pointer just stays at one address unless I know where to set a breakpoint.

Offline

#63 2011-09-05 13:18:54

Sawakita
Administrator
Registered: 2010-10-16
Post 205/365

Re: RGBY Map Headers

~Red wrote:

Well, I don't quite get how to use a Debugger. For instance, where do I set breakpoints? How do I make it follow my progress? It seems the pointer just stays at one address unless I know where to set a breakpoint.

I'm not sure what you mean here. There are two kinds of breakpoints in BGB:
- (code) breakpoint, which interrupts the game when the "program counter" reaches the given address (you can put a 2-byte address or you can put a "bank:pointer" address);
- access breakpoint, which interrupts the game when a register accesses the given location, according to the type of access you specified in the breakpoint (read, write, execute). The "read" and "write" options are pretty self-explanatory; the "execute" option has basically the same behaviour of the code breakpoint, if I'm not wrong.

If you meant you don't know where to start debugging from a logical point of view, a good option is putting an access breakpoint at a certain RAM location which you know the meaning of. Here is where Datacrystal's RAM map comes in handy.

Offline

#64 2013-06-05 13:04:19

80C
Banned
Registered: 2013-03-16
Post 642/1,257

Re: RGBY Map Headers

In the tutorial isn't explained how to edit properly the "Connection Strip Location" - in the section of hacking the map connections.
How to do that?


I left this forum.

Offline

#65 2013-06-07 16:35:20

pokeglitch
Member
Registered: 2013-02-20
Post 8/95

Re: RGBY Map Headers

I made a javascript app to calculate the connections for you.  Its not perfect, when I used it where was one connection that didn't work correctly and I had to manually fix. Every other map connection I used it for has worked, though.  The output is in hex, just copy and paste it into the map header, just make sure the connections are in the correct order as specified by the "type of connection" byte that occurs before any of the connection data.

The error doesn't have to do with the code, though. The equations that are used must be different for certain cases

here it is:

http://jsbin.com/uyasut/2

For more information about the connection strip location, you have to point to a specific block in the connecting maps block data.  Sawakita explains how to easily obtain it, here, but I'll copy the relevant data below:

Open RedMap. go to connected map.
If it is located:
East of current map: move the mouse on the block located on the first row (top-to-bottom), first column(left-to-right);
West of current map: move the mouse on the block located on the first row (top-to-bottom), third column(right-to-left);
South of current map: move the mouse on the block located on the third row (top-to-bottom), first column(left-to-right);
North of current map: move the mouse on the block located on the third row (bottom-to-top), first column(left-to-right);
Then take note of the offset (bottom left of RedMap's window), transform it in a pointer (little-endian) and there it is.

Last edited by pokeglitch (2013-06-07 16:41:11)

Offline

#66 2013-06-07 16:58:28

80C
Banned
Registered: 2013-03-16
Post 649/1,257

Re: RGBY Map Headers

Ouch - I didn't noticed of Sawakita's post, that would have helped me with bytes #2\3, I'll add this information in my personal notes on RGBY hacking information - crediting him-

My problem wasn't the calculation of the connections - but were bytes #2-#3 the major problem, the rest of the bytes I obtained were calculated with the formulas in the document.

Anyway, @Pokeglitch:
Thank you very much!
This tool is very useful and speeds up a lot the hacking of connections.

I've got another question left:
when I hack the connections, replacing new connected ones (like I did between Pewter & Route 9), I noticed a little error occours: the OW of the other trainers became weird and turns in other OW (like rockets, scientists, etc.) and also number\letter tiles when walking, this could be fixed directly in-game by opening the menu Pokedex or Pokemon -encountering a wild pokemon or also entering\exiting throught warps, but that OW effect looks weird, for now I only avoided this by inserting some Route Gates, some of them new, but I can't do this for every Route, because I may finish all the Gate Routes and, the biggest obstacle, some Routes doesn't have Warp Events (like Route 3 and 9).
I'll eventually try adding 3 new warps by erasing some people events' data in those maps and replacing it with warp events (1 new warp in Route 19 like in Yellow, 1 new warp in Route 21 and one in Route 9), but I should figure out that strange glitch.


I left this forum.

Offline

#67 2013-06-07 17:11:25

Danny-E 33
Administrator
Registered: 2012-06-09
Post 510/1,119

Offline

#68 2013-06-07 20:38:08

pokeglitch
Member
Registered: 2013-02-20
Post 9/95

Re: RGBY Map Headers

Glad you guys appreciate the app.

80C wrote:

I've got another question left:
when I hack the connections, replacing new connected ones (like I did between Pewter & Route 9), I noticed a little error occours: the OW of the other trainers became weird and turns in other OW (like rockets, scientists, etc.) and also number\letter tiles when walking, this could be fixed directly in-game by opening the menu Pokedex or Pokemon -encountering a wild pokemon or also entering\exiting throught warps

This exact same thing happened to me.  I am not sure why it occurs, but what I've noticed is that when the game is trying to transfer the new sprite data (from the new route that you just entered) into RAM, it uses FarCopyData2.  When you manipulate the code so that it uses CopyVideoData (ONLY when switching between routes/towns), then it correctly updates the sprites.  CopyVideoData only copies the data during a vblank, FarCopyData2 tries to copy the sprites, even when its not a vblank.  I THINK that the graphics cannot be updated when it is not a vblank, so the FarCopyData2 will not copy all of the data it should and/or data will be copied into the wrong sprite.

The issue with using CopyVideoData, though, is that there is a noticable pause while the game is updating the sprites, because it takes multiple vblanks. (unless they have a majority of the same sprites, which is how I currently plan on solving this). Another solution is to turn off the LCD before the sprites get copied and then turn it back on after.  This will produce a noticeable flash, though.  I am not sure why editing the map connection data glitches out the sprites, since it does not happen in the original connections.

Hopefully someone has had experience with this issue and can help us out even further.

Offline

#69 2013-06-08 13:26:18

80C
Banned
Registered: 2013-03-16
Post 650/1,257

Re: RGBY Map Headers

I got that error only when trying manipulate manually the sprites, but I edited 3 connections yesterday and with your tool those worked - better than the ones I've out, I'll try replace the original hacked strings with the tool ones, because it calculates better and faster... humans are humans and do little errors sometimes.

Anyway this "resource" is very very useful and my hack has a very new feeling and it now doesnt even looks like Red's Kanto no more... unleast you look closely the number of trainers, you don't recognise the map.

Great Job one more time!


I left this forum.

Offline

#70 2013-06-09 02:06:04

pokeglitch
Member
Registered: 2013-02-20
Post 10/95

Re: RGBY Map Headers

Glad it works for you! It only took me a couple hours to write but it saved me many more hours in calculations!  I was able to complete re-route my maps in a single day with the tool.  Let me know if you come across any errors, just so we can document them and try to find a connection between each one.

Offline

#71 2013-06-09 09:22:02

80C
Banned
Registered: 2013-03-16
Post 665/1,257

Re: RGBY Map Headers

Only once I got an error when trying to connect Pewter City in the South with Route 21, when I tried flying in there I landed and the game got frozen.
Fortunately I always keep tons of backups in ZIP files so I could extract the backup always, and sometimes when I do very important changes I simply create a new archive containing the last version and another with the new, that works well.
Maybe I did something wrong with the hex-ed, not sure, anyway I tried it a second time and worked well.


I left this forum.

Offline

#72 2013-06-14 17:04:05

pokeglitch
Member
Registered: 2013-02-20
Post 13/95

Re: RGBY Map Headers

Remember how we were getting issues with the sprites loading incorrectly and looking glitched out?  It turns out, that happens in Pokemon Red too.  The only reason we do not notice it is because they never change Sprite Sets while you are walking in the over world.  Whenever the sprite set changes, they have you enter a building or cave, and then when you exit, a new sprite set is loaded without you noticing.  If you try to have the sprite set change while walking in the overworld in pokemon red, the same glitch will occur.  So you can use the fix I posted above (which will result in a brief pause while the new sprites are loaded) or you can use their method, which is don't change the Sprite Set while walking between the maps in the overworld.

Offline

#73 2013-06-14 17:37:13

Danny-E 33
Administrator
Registered: 2012-06-09
Post 545/1,119

Re: RGBY Map Headers

That's reassuring. Is there anything else that was not quite right or is this pretty much working great then?

Offline

#74 2013-06-14 21:09:14

pokeglitch
Member
Registered: 2013-02-20
Post 14/95

Re: RGBY Map Headers

Well, the one issue that I had occurred in the connection strip when I was trying to link something to the south.  That part seems pretty straightforward, though, so I am not sure why it occurred.

If you check the source code of the jsbin link, you can see the code that worked for this one connection commented out in the connectionStrip function.  Again, this was only one connection that it worked for, every other connection worked with the original code.

The original code just points to the beginning of the connection maps blocks (for when you are walking south), but the modified one I had to add 2*X_movement to the blocks for it to work.  I honestly don't remember which map it is....maybe the block pointer is incorrect, but I think I double checked that.  Maybe after a certain X_movement, you can't point to the beginning of the connecting maps blocks because some of the initial blocks are off the screen?  I am not sure.

I guess if you run across any issues, let us know and hopefully we can find the connection between them all.

EDIT:  After looking at my notes, it looks like the issue was when Rt 6 is in the north and Pewter is to the south and a connection movement of -3.
The code gives:

Code for Route 6 Header (South Direction):
02 E6 45 38 c8 14 14 00 06 03 c7

But what I have in my notes is:
02 Ec 45 3e c8 14 14 00 06 03 c7

Again, not sure why that happened.  The code for Pewter worked correctly.

Edit Again:
I put the code that the app gave me into my game, and it seems to be working fine...  And on a second look, the alternative code does have slight bugs with tiles not appearing correctly.  Maybe this bug was from a different mistake I made.

Last edited by pokeglitch (2013-06-14 21:28:34)

Offline

#75 2013-06-15 19:35:21

80C
Banned
Registered: 2013-03-16
Post 709/1,257

Re: RGBY Map Headers

I'm not sure too, sometimes it works very weel, like I did between Vermillion City & Route 18 in the new W\E connection, other times sprite sets glitches up.

another strange thing is that this happened with 3 sprites in a map that is connected only by warps... that is Route 12 and it's connected with a Route gate that is connected to Route 18.

I think the problem isn't the connection, but the sprite set loading, because that occourred even in 1 map where you don't access with connections...

Isn't there a way to improve the sprite loading of R\B making it like G\S?
That could solve that sprite glitch.


I left this forum.

Offline

Board footer

Powered by FluxBB