Jump to content

Photo

Editing Weapon/Armor Stats


11 replies to this topic

#1
jared19

jared19

    Journeyman

  • Members
  • Pip
  • 20 posts

Anyone know in what file weapon and armor stats are kept? I found these files in bbs_rpg.arc:

model\pl\parts\f_parts.amr
model\pl\parts\f_parts.nmr
model\pl\parts\f_parts.ntr
model\pl\parts\h_parts.amr
model\pl\parts\h_parts.atr
model\pl\parts\m_parts.amr
model\pl\parts\m_parts.aor
model\pl\parts\m_parts.atr
model\pl\parts\m_parts.nmr
model\pl\parts\m_parts.ntr

I suspect the .amr files list what armor uses what model. Decoded, it can be useful for model swapping, as it can add/remove parts to an armor. But I dunno how to decode it.

 

Others I dunno.

 

Can't seem to find an XML for the stats though



#2
joneirik

joneirik

    Newbie

  • Members
  • Pip
  • 11 posts

I can't answer, just posting to say I'm interested in knowing the same thing.



#3
gibberishly

gibberishly

    Journeyman

  • Members
  • Pip
  • 43 posts
I've spent tens of hours trying to figure this out and I finally accomplished something. You need to modify itemList.itl in bbs_rpg.arc, NOT the LvParam*.itemlv files.

I opened the file in Cheat Engine (apparently works as a hex editor, and saves changes when you close the program even though there's no option to save the file) and searched for 286, the base attack of the Thousand Stings mace. Got two results, both 4 Bytes. I changed both to 9001, repacked, reloaded the game. Thousand Stings went from 286 Strength/0 Magick to 809 Strength/4 Magick. That's not 9001, but I don't care! SUCCESS!

Damage still increases by 20 on the first few enhancements, so one star is 829 strength etc. Maybe the LvParam files are for enhancement values. Seems extremely likely, because of its name and since I saw a lot of unique low numbers repeated several times in close proximity, but don't quote me on that as that's just speculation and speculation like that led me awry and wasted many hours (found 3 people on the internet who said that item stats were probably in the .itemlv files, and apparently they weren't).

Edit: Yep, LvParamWepon.itemlv seems to change enhancement stats. I searched for every instance of 20 (seems like values in that file are Float) and changed them all to 200. One star enhanced Thousand Stings jumped by 180 attack, but not 2 star, suggesting upgrade values are probably cumulative. Also searched for every instance of 8 and changed them all to 200, and then two star enhanced Thousand Sting's stagger and knockdown increased by 192. I wasn't able to find its base stagger (273) in itemList.itl though.

Edit2: Ok, I've finally got this sufficiently figured out. My original purpose was to be able to make Patterned Gambeson invisible or model-swappable with something that doesn't cover the entire torso, without making the character's torso invisible (or give an applicable item Patterned Gambeson's stats). I have accomplished that. Turns out the flag to hide body parts is also in itemList.itl, together with the stats. Here are some examples.

Hard Leather Plate:
0C 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 FD 00 02 00 00 00 00 0A 00 00 00 02 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 1F 00 FE 2F F3 00 00 00 40 E2 FF 03 FD 08 00 01 D7 A3 F0 3E 28 3C 00 00 10 18 00 00 31 05 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 29

Patterned Gambeson:
13 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 02 02 00 00 00 0A 0A 00 00 00 05 05 00 00 00 00 06 00 00 00 00 06 00 00 06 00 00 00 DA 00 FE 2F F3 00 00 00 65 E3 FF 03 06 00 00 01 7B 14 2E 3F 78 9B 00 00 1C 3E 00 00 3F 05 00 00 00 00 00 00 00 00 08 00 10 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 29

Circlet of Enlightenment:
14 88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 01 00 02 00 00 02 00 0A 00 00 00 02 03 00 00 00 00 00 00 00 00 07 07 00 00 00 00 00 00 8F 01 FE 4F D5 00 00 00 89 E4 FF 03 09 20 00 03 8F C2 F5 3E 48 E8 01 00 54 0B 00 00 27 0C 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 29

Immortal's Helm:
55 B4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 03 00 02 02 00 00 FD 0A 0A 00 00 06 06 00 00 0F 00 00 00 00 00 00 00 0F 00 00 00 00 00 E0 00 B2 4C D5 00 00 00 6C E3 FF 03 D4 17 00 03 A4 70 FD 3F 80 FC 0A 00 00 65 04 00 DD 0B 00 00 00 00 00 00 00 00 08 40 10 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 29

The bolded value is the hide-body-parts flag. Changing that from 00 to 08 on the Patterned Gambeson will make it no longer hide your torso, and allow you to make its texture transparent as normal. Same deal with changing Immortal's Helm's 17 to 20. That was my primary motivation in digging through all of this, so I'm not really sure what all of the other values are. However, taking Patterned Gambeson as an example, the very first value (13 3C) is its physical and magickal defense. 13 is just 19 in hex, but I'm not sure how the magickal defense is converted. 05 05 is its knockdown and stagger resist. 7B 14 2E 3F is its weight, 0.6800000072, stored as float. 1C 3E is its market value/sell price, 15900, stored as 4 bytes. Patterned Gambeson's internal market value actually seems to be slightly less than its sell price as stated on the wiki, but the other 3 items are an exact match. I can also confirm that one of these values tells the game what model to load, as when I was trying to swap Hard Leather Plate & Patterned Gambeson's stats I accidentally swapped the model as well. Not sure which one though, and figuring all that out seems more difficult than simply swapping the models in their own arcs. Anyway, that's all for example values from me. The way I've been locating the hex strings of specific items with relative ease is by searching for the item's weight and sell price in Cheat Engine, and looking for a double match within a few bytes of eachother. Afterwards I open the file in a regular hex editor and go to that address.

Regarding the enhancement stats in the .itemlv files, I can only say that finding a specific item is very tedious. I had to manually go through over 50 different values and mod each one and reopen the game each time to figure out where Patterned Gambeson's upgrade stats were (they're at 000170AC). If someone wanted to mod enhancement stats they would probably have to write a script that searches for patterns of multiple values, lest they take 5 hours to mod 1 item. Good luck.

Now, since I've located the appropriate flags, I may pour another several dozen hours into this to produce an "Invisible Helmets" mod. I'm currently packing for a trip so that may take a few weeks, but if the mod isn't on the nexus within 2 months of this post then I probably didn't do it.

Edited by gibberishly, 17 December 2017 - 05:47 AM.


#4
Xervous

Xervous

    Newbie

  • Members
  • Pip
  • 14 posts

I started with what Gibberishly posted above and figured out what most of the values control.

Here's a visual guide detailing the (somewhat incomplete) function of each segment of an item's entry plus a suggestion on more easily locating the item you want to edit. (you could also search by its slash/blow/(elementals) in order as such combinations are very likely to be unique per item).
https://imgur.com/a/jt3BIvg



#5
zeuklie

zeuklie

    Stranger

  • Supporter
  • Pip
  • 1 posts

Thanks for the contributions and I may add somethings.

 

The 4 bytes before physical def are used for Strength and Magick

For example,

Baleful Nails

0A 50 00 00 01 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE 9F  7A 01 00 00 3F E4 FF 03 FF FF FF FF CD CC CC 3D  60 09 00 00 C0 03 00 00 90 07 00 00 00 00 00 00  00 00 00 00 10 00 00 00 00 00 00 00 00 00 01 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 31 29 00 00 

Baleful Nails boosts both Strength and Magick by 10, and in the data, 0A is Strength and 50 is Magick*8.

 

Then, about weapons, 

Ascalon
FE 61 0A 32 00 00 00 00  44 11 05 00 00 00 00 00 00 00 00 00 64 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 10 00 32 0C  A7 00 20 00 3E E1 FF 03 0B 00 00 01 85 EB D1 3F  60 F5 13 00 C0 FB 07 00 F7 03 00 00 00 00 00 00  00 00 00 00 10 00 00 00 00 00 00 00 00 00 37 00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 31 29 00 00 
Stats of Ascalon:
Strength 510(FE 01)->1st byte+ 2nd byte
Magick 332  (332*8=2656=60 0A)->2nd byte+ 3rd byte
4th byte probably percentage of elemental damage
Stagger Power 324 (44 01)->9th byte+ 10th byte
Knockdown Power 324 (324*4=1296=10 05) ->10th byte+ 11th byte
21th byte (64) is percentage of slash damage, 
22th byte (00) is percentage of Bludgeoning damage,
59th byte (20) is Element type (Holy)
for fire this byte set to 8, ice is 10, lightening  is 18, 28 should be darkness (not confirmed).

Edited by zeuklie, 14 August 2018 - 02:02 AM.


#6
vometia

vometia

    Enthusiast

  • Premium Member
  • 147 posts

Possibly a bit late in the day, but it seems that bytes 60 and 61 are the equipment ID and, confusingly at first glance, 61 and 62 comprise some sort of indicator as to which body parts are disabled or not (presumably a straightforward bitmask).  I had a hunch about this when I was poking around in some other files and could find the values I was looking for only if I treated it as a 12-bit value, i.e. 1.5 bytes.  I may of course be totally wrong but it appears that bits 0-3 of byte 61 are the high bits of the item ID which also consists of byte 60 (by which I mean the ID referenced by DDDA.sav.xml's mItemNo, not the one in the *.arc filename) and bits 7-4 usually seem to be set to 0xe.

 

I may be wrong about the high bits of 61 belonging to the body-part mask but it seems that the ID number if taken as a 16-bit value usually has 0xe000 ORed with it, that data seemingly being used for some purpose that is nothing to do with the ID no.

 

Edit: sorry, this is nonsense.  Well, half of it is: that the item ID is a ~12-bit number appears to be correct but my concentration was AFK and got the wrong bytes, which should be 56/57 (counting from 0, that is).



#7
vometia

vometia

    Enthusiast

  • Premium Member
  • 147 posts

I've been faffing about with this periodically and got precisely nowhere yet!  I guess there's a reason there isn't a huge amount of armour/clothing replacements out there.

 

AFAICT there's nothing in the itemlist.itl file that specifies which slots are to be occupied and optionally occluded; the only thing that changing byte 62 will do is make it look for a different *.arc to load and if it can't find it, you get the body part instead.  Maybe: that's what happens for chest armour but I didn't test it for things that can straddle (at least) two body parts such as gloves, boots, helmet etc.

 

I spent probably too much time trying to figure out exactly how the pathnames in the *.arc files are referenced and that seems to be courtesy of bbs_rpg/model/pl/parts/*_parts.amr; the format is a little confusing, I guess it's more of a data stream or hierarchical database than a bunch of defined record types, a bit like e.g. NIFs, which I guess isn't that surprising.  Anyway, it seems to be a short int containing the file's reference number followed by a short zero; the item number can be missing in which case the following strings are some sort of array or list but I'm not clear how they're referenced, maybe just by whichever one it finds.  Following that is a (presumably) long int which contains either 0 or 1; no idea what that does.  And then a null-terminated string which is the path of the model it wants minus its extension.

 

These file numbers are referenced by either the *.atr files; confusingly, it seems there isn't a f_parts.atr, just an m_parts.atr.  Anyway, this is what links the stuff you see in the *.arc files with the pathname, and contains the following:

 

int16 - arc number (e.g. 5500, Madeleine's outfit)

int16 - item type, e.g.0x400 body armour, 0x200 leggings, 0x500 boots etc.

int32 (maybe: I'm guessing as the high bytes of all the following numbers are zero) - no idea

int32 - no idea, again

int32 - number of models required

int32 (array defined by previous number) - pathnames referenced in *.amr

 

I have tested this and have persuaded it to load up additional models in a given outfit even for female characters so it definitely seems to do both.  However, what it does not do is specify where they're to be loaded and more specifically whether they're replacers or overlays.  It seems that is done elsewhere.  I suppose one could conceivably add the body part to the list of models to load, I've no idea if it would work whether the skin tone would be rendered correctly and if the textures would clash with each other.  Maybe I'll try at some point if I can find the patience!

 

There seems to be other stuff involved because just as an experiment I tried to see what would happen if I tried to change the arc number in itemlist.itl and m_parts.atr; first attempt at hex editing I made a typo and put the wrong value in itemlist so nothing loaded and I got a nude lack-of-outfit instead, but on correcting the typo it moaned that it couldn't find the constituent files, which was confusing.

 

Anyway, just documenting my findings to date as well as "and this doesn't work".



#8
vometia

vometia

    Enthusiast

  • Premium Member
  • 147 posts
It's apparent nobody else is (currently) looking at any of this, but for posterity... :D I'm still going back to this now and again because at this point I just kinda want to know the solution and it irks me that I haven't found it. What I have discovered so far:

What doesn't control the body-part map:
  • bbs_rpg.arc/etc/items/itemlist.itl (see note 1)

  • bbs_rpg.arc/model/pl/parts/[fm]_parts.amr (see note 2)

  • bbs_rpg.arc/model/pl/parts/m_parts.atr (see note 2)

  • eq/[aw]_*/[fm]/[fm]_[aw]_<part><no>.arc/model/pl/*/*/*.mod (see notes 2 & 3)
...and therefore what doesn't work:
  • Trying to respecify the model numbers listed in m_parts.atr (there is no corresponding f_parts.atr), including trying to forcibly add the underlying body parts.

  • Copying and renaming the *.mod and *.mrl files from a different model: the clothing/armour displays correctly but body parts to not activate or deactivate accordingly.

  • Guessing that it may be encoded into the file number: changing the number (which obviously includes changing the m_parts.atr file and even *.amr) makes no difference.
What works correctly:

Changing the equipment file number in both itemlist.itl and NPCs' *.edp file (see note 4)

Notes:
  • Although I have no idea what most of the stuff in this file means, changing the file number simply swaps in the relevant models and activates or deactivates the relevant parts as necessary. No further changes are needed.

  • This contains a number of fairly opaque (to me) binary values. I have no idea what any of them mean.

  • The *.mod files contain strings named [AB]XfBAN__E_00_m010_ followed by a (presumably decimal) number. I wonder if these correspond in some way to the values seen in *.amr and/or *.atr. It looks tempting but I'm not certain and it's very hard to see definite patterns emerging but it seems a tempting idea. If this is how it works, it might explain why I've seen no patterns as they could be worked out on a file-by-file basis; though that would make working out the co-existence of armour parts exceedingly complex. I mean more complex, e.g. the Gauntlets of Shadow which make the sleeves of torso armour disappear, and the torso armour in turn may make chest clothing's sleeves disappear, and the chest clothing may or may not make the character's arms and/or hands disappear... etc.

  • *.edp defines various stuff about the NPC's appearance, which is described elsewhere. In terms of what they have equipped, they use either an outfit ID, which is most of them and I have absolutely no idea where this is defined, or individual equipment parts comprising the file number and slot number it occupies (remember that equipment slot IDs are evidently not the same as body part IDs: it seems there are many more of the latter). Most NPCs use the outfit number, and others have documented how this can be changed which swaps everything they are wearing. The few NPCs have individual equipment IDs that can be similarly altered and doing so makes them behave correctly.
Conclusions

I still have no idea how and where this is controlled. It's either using a calculation using the data that's right in front of me that I'm just not seeing.

File formats
  • AMR files:

    These contain a list of *.mod/*.mrl files, one or more of which is included with each equipment file.
    • a header comprising four int32s:

      The first is set to 0x00726d61 ('amr\0'), the third is the number of records, and I've no idea about the second and fourth.

    • Variable length and comprising two int32s followed by a zero-terminated string.

      The first int32 contains a unique model number for each individual *.mod file starting from 0. They are not contiguous i.e. the entry for a model can't be inferred from its position in the list. Some entries are invalid (presumably deleted at some point) in which case this is set to -1 and skipped.

      I have no idea what the second specifies. It's usually set to 0 though a few have it set to 1.

      The string defines the path to the model (minus the extension; it expects to find both *.mod and *.mrl; the mrl defines the paths to the textures independently). As the variable-length thing is on a byte-by-byte basis the int32 values are often not word-aligned, something to be aware of if searching a hexdump. Some records have no strings but (obviously) still a null terminator.

    • After the records there're two (I think) int32s whose purpose is unknown and a chunk of data whose byte count seems to correspond to the number of records if we subtract the number that were skipped (e.g. set to -1). Might this be our body part data? Dunno, can't see any obvious patterns emerging.
  • ATR files:

    These link a list of model numbers to the equipment file number. They comprise the following:
    • A header comprising four int32 values which seem to be in the same arrangement as the AMR file, i.e. the first is set to 0x00727461 ('atr\0'), the third is the record count and, again, the 2nd and fourth are unknown.

    • A series of variable-length records comprising three int32s and "an array".

      The first int32 contains the equipment file number (effectively a short, I think) with the high byte set to the equipment slot number, e.g. 1 for chest clothing, 2 for leg clothing, 3 for helmet and so on. This corresponds to the files found in nativepc/rom/eq with the equipment slot number defining the directory and file prefix and the file number providing the numeric component.

      The second and third values are unknowns. The first contains an integer which is typically a multiple of 10, e.g. 580, 700, 800 but I have no idea what it means. Size? Weight? Probably not value as that's what itemlist.itl does. The second contains a smaller number; it's tempting to assume this is something to do with body parts but I can't see a pattern emerging.

      The "array" comprises an int32 specifying the number of elements and that number of int32s which specify which AMR entries are included.
Nomenclature:
  • "Model number": the ID number of the *.mod file specified in the AMR list, e.g. a pair of sleeves.

  • "Equipment number": the file number of an equipment definition, i.e. the numeric part of the *.arc in .../rom/eq and what was described in being in bytes 60/61 (I'm counting from 0; bytes 61&62 if counting from 1 as the attached image does) of the itemlist.itl file. This contains one or more model numbers defined in AMR, e.g. an item of chest clothing might contain the pair of sleeves mentioned and the waist part(s) such as belt etc in addition to the chest part itself.

  • "Item ID": the internal ID number of any given piece of equipment found in the likes of a save file and in bytes 56/57 of itemlist.itl


#9
vometia

vometia

    Enthusiast

  • Premium Member
  • 147 posts

Apologies for the rather leggy format, a combination of IP.Board's buggy editor and Nexus' insistence on the bloody awful Re:CAPTCHA which seems to be broken again is making it really hard to post.



#10
Thawfoot

Thawfoot

    Stranger

  • Members
  • Pip
  • 7 posts

Well thank Vometia  for posting this information. Altho it makes my head shake trying to under stand it. What i,m trying to do is basically turn on the underlying skin in certain arc.s . and while a model swap would work in some instances it wouldn't in others. If i understand from what i have read here "The bolded value is the hide-body-parts flag. Changing that from 00 to 08 on the Patterned Gambeson will make it no longer hide your torso, and allow you to make its texture transparent as normal" from what Gibberishly found? And this is changed on a case by case value ? or is that number change reflect the part in question like torso head ect?

I will be the first to admit i know less then nothing of hex editing. Beside what i read the last few days. still it bothers me to no end that i cant simply get the skin texture to show up on the model after modifying the armor texture to show more skin . from what i gather changing the enable / disable body part flag in the itemlist .itl will work for most items? most looking to alter female leg armor.. but hoping to turn on that as well for outfits altho seem to be way more complex? assuming the legs are only one part and outfits are multiples ?

 

 



Reply to this topic



  


Page loaded in: 0.956 seconds