Wednesday, November 19, 2014

Debug Strings in Battle Network

Let's look at a more interesting topic. Some of you may remember last time I went over this image.
Gamekyo, formerly JeuxFrance, got an exclusive hands-on look at an in-progress build of the then-upcoming MegaMan Battle Network 5 DS, for the EU region, way back in 2006 or so. This particular build of the game, and European of all things, has debug info on the screen! These strings still exist in their plain text for the most part, and it matches the debug font that every Battle Network game has had.

These strings show information about the player coordinates, possibly, as well as other things. This feature can be found as far back as the first Battle Network, in slightly different forms.
BN1 debug font, as seen in the above screenshot.
BN6 debug font
This font set no doubt was used to display the on-screen debug info in development builds of the games. They are always loaded into memory even on the release versions of the game, but are never used. What sets these apart from the in-game font is the fact that it is in ASCII order, which is something that's not done on the GBA Battle Network games.
This means they can be searched with ease!
Here are a list of probable strings I found in all the BN games. The percent symbols were used to indicate certain types of variables that would update on-screen.

Battle Network 1
UNCOMP %8x
This is found in all the games. It's relating to LZ77 decompression. The relevant ASM is directly below and anything that has to decompress passes near it.
POS X:%D Y:%D Z:%D A:%D
CELNO:%4X
C NUM:%D
X:%8X Y:%8X
AT V %3D
PL %8x %8x %8x
Position and coordinates. It would have shown X, Y, Z, and A. I don't know what A could have been. CELNO might refer to the current animation, but I don't know what the term typically refers to in game development. C NUM might be the index of the sprite.
I want to say AT V refers to attack value, so those might be battle debug coordinates. PL usually means player, so some of those values may refer to the panel coordinates.
00 X:%8X Y:%8X
01 X:%8X Y:%8X
02 X:%8X Y:%8X
03 X:%8X Y:%8X
Since these have little context, they could have been for almost anything. The game does support 4 enemies, so it could have been used for their coordinates, but I doubt it. Since this appears in later games, it could show info for up to 3 NPCs on the map.

X:%x
Y:%x
Z:%x
D:%x
H:%8x
More unknown coordinates. Now D might refer to direction, but unclear on H.

X:%X  Y:%X  OX:%X  OY:%X  TM:%D
More coordinates, but this time with OX and OY. That O may mean Overworld, if that's the terminology they were actually using. TM might be tilemap, but for what and why?

Battle Network 2
A lot of the same strings are used from the previous game so I'll only include the new ones from here on out.
RND=%X
SEQ=%X
PL=%X
X%D,%D,%D,%D
This could be anything. RND might be the random seed, which could have been displayed on screen for some reason.

SIO=%D,%D
Well, more link cable stuff started appearing, so it might be related to that.

PL X:%D Y:%D Z:%D
CAM X:%D Y:%D Z:%D
Since CAM is most certainly camera coordinates, these two might relate to how the player and camera coordinates can differ.

Battle Network 4
ID(%D) PL NUM(%D) SIO WAIT SIO OFF SIO ON SIO ERROR SIO ERROR2 ST:0x%X RNO:0x%X RECV:%X RECV:%X RECV:%X S:%D,R:%D
These are most likely link cable things.

MESS %D
Here is where MESS starts appearing, just like in the screenshot above! Most likely "message" and would probably display information about the dialog. Two of these appear close to each other, with no clear indication if one does something different than the other.
MOVE MAP JAPAN
MOVE MAP WORLD
Bonus! Some other internal plain text names. These are found right above the relevant area that sets the graphics for the world map in the game. The "Japan" map must refer to "Den City" as it's called in localization. "World" is obviously the world map where you can go to other countries that look like real-world countries. "Japan" is in the middle and looks like Japan. But this find is a bit interesting considering this is a rare case where an unused earlier graphic for ACDC Town exists but is not used. Maybe they let too much make its way in the build.

Battle Network 5
This game doesn't seem to have any new strings, but the MESS one now appears two more times. Here are some plain text swear words you're not allowed to use in some case where you can only use 3 letters in all caps. I could have sworn this was supposed to be in BN4.
--- ASS COK FUK FVK GAY DRE JAP JIZ KOC KUM LSD POT SEX TIT WOP 666 KKK HIV AUM SIT ASZ CUM DIK FAG KOK KVM AVM CVM A55 C0K J1Z K0C P0T 5EX T1T L5D W0P D1K K0K A5Z S1T H1V
Pretty clever, some of them. This list is also in BN6.

Battle Network 6

UNCOMP STR:%8x END:%8x SIZ:%X/%X
The UNCOMP stuff from BN1 is extended a bit to show some relevant parameters. The X and Y have a slash this time and a slash was seen in the image at the top. They don't look like they're for the same purpose though.

M%D
Yeah, that's a thing. Apparently MESS was just shortened to M this time around. 4 of them, just like in BN5.

Those are all the interesting strings I could find. You can only imagine what it would have looked like actually functioning in-game. Since their presence suggests the relevant ASM is nearby, it's possible to trace the routine a bit. This reveals that even though it tries to gather the necessary values, the code that parses the strings is nowhere to be found. And this is in each and every case. Even in BN5DS and OSS. Even the OSS demo!

The only way to ever see these in action would be on an actual debug or pre-release build of the game. They're unfortunately very rare or may not even exist anymore. Who knows what other gems are waiting to be discovered in those.

Much thanks to GM for looking into these.

3 comments:

Anonymous said...

that is so cool

Black Ace said...

There's really a word blacklist? Looking at it, someone had some fun with it...

Anonymous said...

How do you do all this at your age? (How old are you?)

Post a Comment