XMLB Knowledge

Started by ak2yny, November 15, 2020, 06:56PM

Previous topic - Next topic
November 15, 2020, 06:56PM Last Edit: January 19, 2021, 04:03AM by ak2yny
General Knowledge about b-files (xmlb, engb, itab, gerb, chrb, etc.)

All of these files can be opened with a text editor before decompiling them, but as read only. Basically all values that exist multiple times, are converted into just one value. On the top we have a unreadable part with the complete content but only linking the values. Below, we can see the values. With this knowledge, we can open any of the "b-files" and check what's inside.
Eg.: I look for the conversation that uses the "uber_greeting_wolverine02.PY" script. I know, it's in conversations\act3\valhalla, but there are a lot of conversations, and I can't know which one wolverine uses, because they're all named similar (3_valhalla1_010 for example). Fastest way: Use Notepad++ (or similar batch text editor) and open all engb files in this folder without decompiling them. In the program (Notepad++), search for "uber_greeting_wolverine02" in all files. Et voilĂ , there we have the result: it's in "3_valhalla1_050.engb".
This is only one example for this useful knowledge.

Another common thing is the header of each file after decompiling. The first thing tells us what kind this is. There might be something like "XMLB conversation" or simply "values". Some files have extended "headers" that have values that account for each sub-entry. Just like it is with a fightmove in a powerstyle when it has sub-entries for effects and other things. When looking at the header, you can often discover what's in the file.






Specific Knowledge



data/values.xmlb

While searching for something HUD related, I stumbled over this file (and multiple other files in data folder), and thought: "hmm, that's interresting..."
When looking over it before decompliling, we see DMG and HLTH, among other things. That gives us an idea, about what is in the file.
After it's decompiled, we see these letters and numbers after them (eg. "M_DMG99") and min and max values.
As modders, we know that for the vast majority of values there's a range from a minimum to maximum value (usually displayed like this: "2 4", meaning from 2 to 4, or min. 2, max. 4).
The name (eg. "M_DMG99") is very interresting, because we know that the max Level (in MUA) is 99. Each abbreviation is grouped, beginning with number 1 and ending with number 99 (eg. "M_DMG1", "M_DMG99"). Now we know that the numbers are the level and the "DMG" part is damage (because it's obvious).
The "M_" part is less obvious, but it's still clear that it is a specific type of damage, or damage that is specifically for a certain group of characters.

Edit: After some comments and research by other members, I am not sure today that this file is used in MUA at all. The theory increases when we look at data/shared_talents.engb, where some values are found again, a file we know is used by MUA. In this file we also find the description of those abbreviations:

mdmg_high    monst_dmg_high      Monster Damage (high)       formerly M_DMG
mdmg_low     monst_dmg_low        Monster Damage (low)        formerly M_DMG
m_health        monst_health            Monster Health                    formerly M_HLTH


Let's go through it and find all abbreviations:
L (1-5+)                                  Low
M (1-5+)                                 Medium
H (only 1-6)                            High
K (only 1-10)                          Knockback
p (1-99)                                  Power/Energy
DMGS (only 1-4)                    Damage Scale?
DMG (1-103)                          Damage
M_DMG (1-99)                       Monster Damage
M_HLTH (1-99)                      Monster Health
RandFXWord2_4 (1 only)      (Random Effects Word?), is this a leftover of the effects (eg. "smack")?
CT_PROJECTILE (1 only)     Critical Chance (projectiles)
CT_RADIAL (1 only)              Critical Chance (radial)
CT_MELEE (1 only)               Critical Chance (melee)
CHARGE_DMGSCALE (1 only)    Damage increase when charged (2x)

The values all have to do with the level:
Difficulty level (L-H) (presumeably), the numbers 1-5 could stand for the acts
Level of certain functions (K)
Level of some stats according to the character level (var. DMG + HLTH + P)

Not sure this is used, but it might be used as a base to build stats from, or even only as a fallback solution.
Feel free to test changing the values.



data/review_stats.xmlb

I've discovered through this file how to fix the reappearance of custom SIM Discs of OCP 1.3.
When we look at the file before converting, we see the most important things already: "r_dr_disc", "r_upgrade_k", "r_upgrade_f", "r_upgrade_b", "r_upgrade_s". That tells us that it is about pickup stats for the review (all of those are pickups).
Now let's open the decompiled file.
Here, we see that each pickup has it's list of numbered items, with the location (act) where they are placed. But how did I discover how to fix disk placement? The biggest index for "r_dr_disc" is 30 and we realize that there are only 30 discs in the game. Now, we go into the maps files and search for a certain disk - let's take CMCAPTAINAMERICA, the first SIM mission, for this example - we can find it under an entity with the name "comic_captainamerica". Look what we find here: "variablename": "r_dr_disc" & "idnum": 2. The first entry in the "r_dr_disc" list of review_stats is indeed index 2! Notice that there are only disks with idnum 1-30 in the default maps engb's and the review_stats also has only 30 entries. There are also 30 simulations in simulator.engb plus 5 simulations that are hidden by default, but have been unhidden for OCP. Through testing, we have discovered that we can only add one more simulation which results in 36 maximal. But the idnum of disks for OCP 1.3 started at 40, which didn't work. I tested changing idnums to 31 and 36 and the disks stopped reappearing.
The stats don't have to be upgraded to make new pickups work. These are only for counting in the review menu. I haven't tested, if adding the pickups in this file works for the review menu, so feel free to do that. But make sure, that the numbers in the review_stats (bit_index) and the maps (idnum) match.

Here is a list for the default pickups:
r_dr_disc         SIM discs
r_upgrade_k   Skill point
r_upgrade_f    Focus upgrade
r_upgrade_b   Body upgrade
r_upgrade_s   Strike upgrade

November 16, 2020, 11:01AM #1 Last Edit: November 16, 2020, 11:44AM by BaconWizard17
CT_ could be critical chance.
XML2 has this file as well. Some interesting ones:
- In addition to L0 thru L5 and L0+ thru L5+, there's also an L5-
- There's H1 thru H6 and also H1+ thru H5+
- There's K1 thru K10 and K1+ thru K9+
- P goes 0 thru 99 and has + values for 0 thru 15
- There's a BST, which goes BST1 - BST9
- No DMGS, but DMG goes 1-101
- M_DMG goes 0-99
- M_HLTH goes 0-64
- There's one called M_AR, which goes 0-57 (Could be attack rating tied to the Speed stat, which MUA1 does not have)
- There's M_DR, which goes 0-57 (Could be defense rating tied to the Speed stat, which MUA1 does not have)

These are the only ones in the XML2 values file

In XML2, stats are affected as such, with formulas given:
- Body controls health points and chance for double health from potions
  - HP: 25 + 5 per level + 3 per body
  - double heal chance: formula not given
- Focus controls energy points, energy regen, melee mental damage, and chance for double energy from potions
  - EP: 30 + 4 per level + 2 per focus
  - Energy Regen: formula not given
  - Melee mental damage: formula not given
  - double energy chance: formula not given
- Strike affects damage done by melee attacks (as a percentage). Underneath it says: "DMG: regular attack, heavy attack"
  - damage bonus: +2% per striking
- Speed affects attack rating and defense rating
  - ATK: (increases chance to hit with melee attacks) 5 per speed - 35
  - DEF: (increases ability to dodge incoming melee attacks) 3 per speed

Ninja Kyden commented this below me as I was editing mine :P





I also checked XML1's to cross-reference:
- L0-L5 (includes + values for all, and - value for L5)
- M1-M5 (with + values for all)
- H1-H6 (with + values for all but H6)
- K0-K10 (with + values for all but K10)
- P0-P16 (with + values for all but 16)
- A1-A9
- XLT1-XLT6
- BST1-BST9

In XML1, stats are affected as such, with formulas given:
- Strike controls attack rating
  - Attack rating: 1 per level + 1 per strike
- Agility controls defense rating
  - Defense rating: 1 per level + 1 per agility
- Body affects max health
  - Health: 25 + 5 per level + 10 per body
- Focus affects max energy and energy regen rate
  - Energy: 30 + 4 per level + 4 per focus
  - Regen: +1% per level

For XML2:
DR = def rating, part of speed stat (DR is what's used in the XML2 talents file to reference defense, such as when def gets scaled up due to a character's boost power)
AR = attack rating, part of Speed stat (AR is what's used in the talents file to reference attack)
The values for DMG probably refer to ranges for strong attack damage values at certain levels and values for M_DMG probably refer to ranges for weak attacks since they are much lower in their ranges.

November 16, 2020, 11:38AM #3 Last Edit: November 16, 2020, 11:52AM by BaconWizard17
Okay, XML2 and MUA1 both have m_dmg, and in both, focus affects "melee mental damage". So M_dmg is this melee mental damage most likely. MUA1 also has a "defense" stat for its characters, but no M_DR. So this name was likely changed between XML2 and MUA1

Also, it looks like the file called "stat_rules.xmlb" affects how stat points are assigned for the various "autospend" categories (bruiser, bruiser_light, etc). MUA1 does not seem to have that one though. It may be deprecated though, because both XML2 and MUA1 have autospend.xmlb, which seems to do the same thing (but a bit more eloquently)

Quote from: BaconWizard17 on November 16, 2020, 11:01AM
I also checked XML1's to cross-reference:
- L0-L5 (includes + values for all, and - value for L5)
- M1-M5 (with + values for all)
- H1-H6 (with + values for all but H6)
- K0-K10 (with + values for all but K10)
- P0-P16 (with + values for all but 16)
- A1-A9
- XLT1-XLT6
- BST1-BST9

In XML1, stats are affected as such, with formulas given:
- Strike controls attack rating
  - Attack rating: 1 per level + 1 per strike
- Agility controls defense rating
  - Defense rating: 1 per level + 1 per agility
- Body affects max health
  - Health: 25 + 5 per level + 10 per body
- Focus affects max energy and energy regen rate
  - Energy: 30 + 4 per level + 4 per focus
  - Regen: +1% per level

Only for the record, and science's sake:

The Charman posted this about calculating with values.xmlb in XML1 (Wolverine's example):

<Talent name="wolv_slash" level="1" descname="Brutal Slash" description="Brutal claw slash and stab" icon_texture="textures/ui/wolverine_all.png" icon="0" power="0">
<level description="^L4 Physical Damage. ^3 Destruction. ^K4 Knockback. ^P1 Energy."/>
<level description="^L5 Physical Damage. ^3 Destruction. ^K4 Knockback. ^P1+ Energy.">
<require cat="level" level="3"/>
</level>
<level description="^M1 Physical Damage. ^3 Destruction. ^K4 Knockback. ^P2 Energy.">
<require cat="level" level="5"/>


It looks like XML1 is where this comes from.

He also gave a few more explanations:

L for low
M for medium
H for High or Heavy
CT is used for crits
P is for power or energy
XTL1-6 ??? (xtreme?)


And the complete content of values.xmlb in XML1:

<values>
<value name="L0" min="1" max="2"/>
<value name="L0+" min="2" max="4"/>
<value name="L1" min="4" max="5"/>
<value name="L1+" min="6" max="8"/>
<value name="L2" min="9" max="11"/>
<value name="L2+" min="12" max="15"/>
<value name="L3" min="15" max="18"/>
<value name="L3+" min="20" max="25"/>
<value name="L4" min="25" max="31"/>
<value name="L4+" min="37" max="45"/>
<value name="L5-" min="45" max="53"/>
<value name="L5" min="50" max="63"/>
<value name="L5+" min="65" max="80"/>
<value name="M1" min="80" max="100"/>
<value name="M1+" min="90" max="110"/>
<value name="M2" min="100" max="125"/>
<value name="M2+" min="110" max="135"/>
<value name="M3" min="125" max="150"/>
<value name="M3+" min="135" max="150"/>
<value name="M4" min="150" max="165"/>
<value name="M4+" min="160" max="200"/>
<value name="M5" min="175" max="215"/>
<value name="M5+" min="185" max="230"/>
<value name="H1" min="200" max="250"/>
<value name="H1+" min="225" max="280"/>
<value name="H2" min="250" max="310"/>
<value name="H2+" min="275" max="340"/>
<value name="H3" min="300" max="375"/>
<value name="H3+" min="330" max="410"/>
<value name="H4" min="360" max="450"/>
<value name="H4+" min="400" max="500"/>
<value name="H5" min="450" max="550"/>
<value name="H5+" min="500" max="625"/>
<value name="H6" min="600" max="750"/>
<value name="K0" min="0"/>
<value name="K0+" min="20"/>
<value name="K1" min="40"/>
<value name="K1+" min="80"/>
<value name="K2" min="120"/>
<value name="K2+" min="155"/>
<value name="K3" min="190"/>
<value name="K3+" min="215"/>
<value name="K4" min="245"/>
<value name="K4+" min="275"/>
<value name="K5" min="305"/>
<value name="K5+" min="335"/>
<value name="K6" min="370"/>
<value name="K6+" min="400"/>
<value name="K7" min="430"/>
<value name="K7+" min="465"/>
<value name="K8" min="500"/>
<value name="K8+" min="525"/>
<value name="K9" min="555"/>
<value name="K9+" min="585"/>
<value name="K10" min="620"/>
<value name="P0+" min="5"/>
<value name="P1" min="10"/>
<value name="P1+" min="15"/>
<value name="P2" min="20"/>
<value name="P2+" min="25"/>
<value name="P3" min="30"/>
<value name="P3+" min="35"/>
<value name="P4" min="40"/>
<value name="P4+" min="45"/>
<value name="P5" min="50"/>
<value name="P5+" min="55"/>
<value name="P6" min="60"/>
<value name="P6+" min="65"/>
<value name="P7" min="70"/>
<value name="P7+" min="75"/>
<value name="P8" min="80"/>
<value name="P8+" min="85"/>
<value name="P9" min="90"/>
<value name="P9+" min="95"/>
<value name="P10" min="100"/>
<value name="P10+" min="105"/>
<value name="P11" min="110"/>
<value name="P11+" min="115"/>
<value name="P12" min="120"/>
<value name="P12+" min="125"/>
<value name="P13" min="130"/>
<value name="P13+" min="135"/>
<value name="P14" min="140"/>
<value name="P14+" min="145"/>
<value name="P15" min="150"/>
<value name="P15+" min="155"/>
<value name="P16" min="160"/>
<value name="A1" min="5"/>
<value name="A2" min="8"/>
<value name="A3" min="10"/>
<value name="A4" min="13"/>
<value name="A5" min="16"/>
<value name="A6" min="20"/>
<value name="A7" min="30"/>
<value name="A8" min="50"/>
<value name="A9" min="80"/>
<value name="A10" min="100"/>
<value name="XTL1" min="15"/>
<value name="XTL2" min="20"/>
<value name="XTL3" min="25"/>
<value name="XTL4" min="30"/>
<value name="XTL5" min="35"/>
<value name="XTL6" min="40"/>
<value name="BST1" min="15"/>
<value name="BST2" min="16"/>
<value name="BST3" min="17"/>
<value name="BST4" min="20"/>
<value name="BST5" min="22"/>
<value name="BST6" min="24"/>
<value name="BST7" min="28"/>
<value name="BST8" min="32"/>
<value name="BST9" min="36"/>
</values>





All credits to The Charman


After playing around with the xmlb-compile.exe program to build binaries out of herostat text files, I got curious as to what exactly the program is doing and whether it would be possible to recode it.
I tried looking up the format and to check for NBA2KSTUFF remnants, but their website as well as most documentation on the tools they made seems lost.

I also tried some low-level probing on the .exe with PEiD, yielding that it was originally built with C++ v7.0, and subsequently gave a shot to the Hex Rays C++ decompiler, although admittedly, reverse engineering old software is not something I do often.

If anybody happens to have some clear idea or documentation on what the compile process entails, I would be happy to try making a newer, open-sourced version.


Quote from: Sagap on February 28, 2021, 04:46PM
After playing around with the xmlb-compile.exe program to build binaries out of herostat text files, I got curious as to what exactly the program is doing and whether it would be possible to recode it.
I tried looking up the format and to check for NBA2KSTUFF remnants, but their website as well as most documentation on the tools they made seems lost.

I also tried some low-level probing on the .exe with PEiD, yielding that it was originally built with C++ v7.0, and subsequently gave a shot to the Hex Rays C++ decompiler, although admittedly, reverse engineering old software is not something I do often.

If anybody happens to have some clear idea or documentation on what the compile process entails, I would be happy to try making a newer, open-sourced version.

I would recommend checking out nikita488's raven format script, which is a newer tool for compiling engb/xmlb/etc files. Nikita488 is also active on the forums and discord server