Welcome Guest [Log In] [Register]
BN4-6/SF1 Mystery Data/Wave structure
Topic Started: Apr 28 2013, 10:15 AM (1,481 Views)
Prof. 9
Member Avatar
Moderaptor

See post #3 for BN4/BN5 differences.
Note: GMD refers to Green Mystery Data. Blue, Purple and Gold Mystery Data is not abbreviated.

At 0x080A3360 and 0x080A336C (Falzar, US) are arrays of area entries (8 bytes per area); the former for real world, the latter for Cyberworld. Each array is terminated by a 32-bit 0x00000001.

AREA ENTRY:
0x00 = Area (if 0x00000000, skip this entry) (32-bit)
0x04 = Subarea array pointer, points to an array of pointers to Mystery Data entry arrays, one for each subarea. (32-bit)



MYSTERY DATA ENTRY:
0x00 = Type (1 = Blue, 2 = Blue (dupe?), 3 = Purple Locked, 4 = Purple Locked (dupe?), 5 = Green, 6 = Gold Locked (probably unused)) (8-bit)
0x01 = Ignored (0x00) (8-bit)
0x02 = ID (starts at 0x1400?) (16-bit)
0x04 = Placement entry array pointer (32-bit)
0x08 = Contents entry array pointer (32-bit)



PLACEMENT ENTRY:
0x00 = Exists (1 = true) (8-bit)
0x01 = Probability (relative to TOTAL probability) (8-bit)
0x02 = Isometric x-coordinate (16-bit)
0x04 = Isometric y-coordinate (16-bit)
0x06 = z-coordinate (16-bit)
Terminated by an 8-bit 0x00.



CONTENTS ENTRY:
0x00 = Type (1 = Chip, 2 = Subchip, 3 = Zenny, 4 = Item 5 = BugFrag, 6 = Chip (trapped), 7 = Zenny (trapped), 8 = HP Memory, 9 = NaviCust Program, 10 = RegUP, 11 = SubMemory, 12 = ExpMemory) (8-bit)
0x01 = Probability (relative to TOTAL probability) (8-bit)
0x02 = Ignored (0xFF) (8-bit)
0x03 = Item subvalue or 0xFF (8-bit)
0x04 = Item value (32-bit)
NOTE: For HP Memory, RegUP, SubMemory and ExpMemory, the correct item values must still be set.
Terminated by an 8-bit 0x00.

Contents type:
1 = Chip (value is chip ID, subvalue is chip code)
2 = SubChip (value is item ID)
3 = Zenny (value is amount)
4 = Item (value is item ID)
5 = BugFrags (value is amount)
6 = Chip Trap (same as 1)
7 = Zenny Trap (same as 3)
8 = HP Memory (value is item ID, must be set to HP Memory)
9 = Navi Customizer Program (value is program ID, subvalue is color)
10 = RegUP (value is item ID, must be set to RegUP)
11 = SubMemory (value is item ID, must be set to SubMemory)
12 = ExpMemory (value is item ID, must be set to ExpMemory)
15 = Area map (value is item ID)
16 = Party Customizer Program (value is item ID)



On jacking in:
- Search every Mystery Data list for GMDs;
- For every GMD found, count the possible locations and contents;
- If a possible contents was already used by a previous GMD in the same map, then it is skipped;
- Using the probability values, randomly determine 1 position and 1 contents for each GMD.

What this means:
- The number of GMDs that will appear in a specific area is constant;
- Placement and contents of GMDs is determined on jacking in;
- Some locations and/or contents can be set to be rarer than usual;
- Two GMDs in the same map cannot have the same contents indices;
- In other words, if two GMDs in the same map use the same contents array, then they will never have the same contents;
- The codes of chips and amount of Zennys/BugFrags received from GMDs are NOT random!
The BN6 games have a hard limit of 32 possible contents or locations. Usually there are 8 possible contents that all have the same probability, and the possible locations all have the same probability as well. Also, no map in BN6 has more than 2 GMDs.







An array of gold area entries starts at 0x080A3428, terminated by a 32-bit 0x00000000.

GOLD AREA ENTRY:
0x00 = Area (8-bit)
0x01 = Sub-area (8-bit)
0x04 = Contents entry array pointer (32-bit)
0x08 = Probability relative to TOTAL probability (32-bit)

Among the regular entries, this array also has a number of "dummy" entries. If a dummy entry is chosen, no Gold Mystery Data will spawn. This allows a probability to be set for spawning the Gold Mystery Data at all. These dummy entries have area 0x01 and sub-area 0x00. In BN6, there is an overall 25% chance of a Gold Mystery Data spawning. This does not take into account what area you jack into; as such, a Gold Mystery Data may spawn in an area that is out of reach, further diminishing your chances of encountering one.

The contents entry structure is the same as for Green Mystery Data. Note that dummy entries must also define a contents entry array with at least 1 entry.

On jacking in:
- Select one Gold Area Entry using the probability values.
- Select 1 random Green Mystery Data and change it into a Gold Mystery Data.
- Choose random contents from the entry list for that Gold Mystery Data.

What this means:
- The data you get from Gold Mystery Data depends on the area it spawned in.
- At most 1 Gold Mystery Data exists on the Net at a time.
- Even though a Gold Mystery Data exists, it may not be reachable.
In BN6, Gold Mystery Datas spawn only in Internet areas, not in Comps.
Edited by Prof. 9, Apr 23 2017, 05:46 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Note: the player can interact with Mystery Datas if the difference between z-coordinates is 8 or less. So if the player is on z=0, then they can pick up Mystery Datas at z=-8, z=-7, ..., z=7, z=8.

EDIT: Also added the missing Mystery Data contents types.
Edited by Prof. 9, Jul 20 2014, 11:28 AM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

BN5 does things a little differently. Instead of having each area entry have an area value, the current area value is used as an index of the area entry array. As such, each area entry is only 4 bytes. This also means that each valid area must have an entry in the array, even if it has no Mystery Data. Like BN6, the area entry arrays are terminated by a 32-bit 0x00000001.

AREA ENTRY (BN5):
0x00 = If 0x00000000, skip this entry. Subarea array pointer, points to an array of pointers to Mystery Data entry arrays, one for each subarea. Terminated by 0x00000000 (32-bit)

BN5 Colonel (U) pointers:
0x080AD8BC = Real world area entry array
0x080AD8D8 = Cyberworld area entry array

EDIT: Additionally, in BN5, Mystery Data IDs seem to start at 0x0E00.

EDIT2: All other structures are the same, including contents type values and Mystery Data type values, with one exception: Mystery Data type 0x06 which is Gold (Locked) in BN6, is just Blue (Locked) in BN5. Probably unused.
Edited by Prof. 9, Aug 4 2014, 03:50 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Correction: for BN6, subarea array isn't actually terminated by 0x00000000, it's just a fixed size (16 entries followed by 0x00000000). However, when generating GMDs, the game will move on to the next area if it finds a subarea pointer of 0x00000000.
Edited by Prof. 9, Jan 2 2015, 04:49 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Hart-Hunt
Member Avatar
Regular Member
Welp, this makes a point for me to not try to change Mistery Data in BN3. This sounds overly tedious to do for my project.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Mystery Data in BN3 is nothing like any of this. In fact, all of it is script-based. It's done in more-or-less the same way BN1 does it.
Edited by Prof. 9, Dec 23 2014, 06:06 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Hart-Hunt
Member Avatar
Regular Member
Thank you. I suspected BN3 followed BN1's engine here as well (I had already seen that topic), it's good to actually know it.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

BN4 works mostly the same as BN5, with one difference. Subarea pointer arrays are actually terminated by 0x00000000 and don't have a fixed size of 16 like in BN5 and BN6.

BN4 Red Sun (U) pointers:
0x080ADD18 = Real world area entry array
0x080ADD34 = Cyberworld area entry array
Edited by Prof. 9, Jan 2 2015, 04:55 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Hart-Hunt
Member Avatar
Regular Member
Prof. 9
Dec 23 2014, 06:06 PM
Mystery Data in BN3 is nothing like any of this. In fact, all of it is script-based. It's done in more-or-less the same way BN1 does it.
I've been trying to figure this out based on the BN1 format, but I got no results. Would you be able to give me a hand? I couldn't reach you in chat.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

The script pointer for BN3 is at 0x020094A8 so just open a BMD or GMD and check that to get to the commands. At 0x0802687E is the bx r1 that jumps to a script command's ASM routine so after you've found the command you want, you can just set a read breakpoint on it to get to its ASM routine, then set a breakpoint on that to catch any subsequent calls.
Edited by Prof. 9, Jan 16 2015, 02:18 PM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Hart-Hunt
Member Avatar
Regular Member
Thank you.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Here are some notes for Star Force 1. Mystery Waves in this game work similarly to BN4-6.

Area entry arrays start at the following positions:
- Pegasus JP: 0x021A6C54
- Leo JP: 0x021A6C50
- Dragon JP: 0x021A6C50
- Pegasus US: 0x021A2774
- Leo US: 0x021A2770
- Dragon US: 0x021A2770
- Pegasus EU: 0x021A3390
- Leo EU: 0x021A338C
- Dragon EU: 0x021A338C
The array is terminated by a 32-bit 0x00000001. Data is stored in overlay 3 for US/EU and overlay 2 for JP.

Mystery Wave types are: 1 = Blue, 3 = Purple, 5 = Green, 6 = Gold, 8 = Red. 2, 4 and 7 appear as Blue, Purple and Green respectively but are not used.
Byte 0x01 in the Mystery Wave entry indicates whether the Mystery Wave is locked (requiring an Unlocker or SunKey to open). But it doesn't seem to be used and the game appears to use the color type anyway.

Placement entries work the same.

Contents entries work the same. The possible types are: 1 = Battle Card (subvalue indicates color, where 0 = White, 1 = Yellow, 2 = Blue, 3 = Red), 2 = SubCard, 3 = Zenny, 4 = Item, 5 = Virus (not used), 6 = Power Up, 7 = Mega Weapon. For 2, 4, 6 and 7 the item value must be set to a valid item index.

Gold Mystery Wave (or Yellow Mystery Wave, YMW) has a 1-in-64 chance of spawning when you Wave Change into MegaMan. That means it will not be visible while you're walking around as Geo with the Visualizer on. The YMW appears in a separate location from other Mystery Waves (will not replace them like in MMBN6). It will always appear in an EM-Road you can reach from where you pulsed in (unlike MMBN6). If you pulse in at Echo Ridge, it may appear in either Echo Ridge's EM-Roads or in Deep Space EM-Road after you've unlocked it. One of the reachable Gold Mystery Waves is selected at random.

Red Mystery Waves only appear if you have a Boktai DS / Lunar Knights Brother. They require a SunKey SubCard to unlock and disappear after you pick them up.

Full dumps: https://pastebin.com/6xRVzgbv
Edited by Prof. 9, Jan 30 2018, 09:05 AM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Guides & Research · Next Topic »