Jump to content

Dark Souls 1/2 Resource Explorer


BurtonRadons

Recommended Posts

Hello everyone! I've been working on a program that can open up and comprehend a fair number of Dark Souls and Dark Souls 2 files (the latter with PS3; so once I get the PC version I'll need to do a little tweaking with textures that will probably be stored differently there, beyond the banal issue of byte order that I already handle). I eventually want to get it to the state where it can modify the archives and import models and textures and whatnot, with the possibility that the game engine will pick up any additional .bhd[5]/.bdt archives and use them as overloads. That would then allow proper mods without having to do anything nasty with the archives. I can't see why it wouldn't, I just haven't written the code to try it out. :tongue:

 

The code is public, bog-standard C# using WinForms and OpenTK, and so would probably compile with Mono with a minimum amount of effort. Anyway, I have a binary release here you can fool around with, which also links to the source code:

 

https://github.com/Burton-Radons/Alexandria/releases

 

The current release is:

 

https://github.com/Burton-Radons/Alexandria/releases/tag/v1.0.1

 

Just install, run, open a .bhd5 file, and check it out. Right-clicking on a file entry usually does something. I develop on Windows 7 with completely up-to-date ATI video drivers, so variation may cause problems (primarily in that I demand GLSL 4.3 in the 3D shader when I only use 1.0 features, oops).

 

Here's what you can do in "dvdbnd0.bhd5" from Dark Souls.

 

- "chr/c####.chrbnd.dcx" path contains character models; the ".flver" files should render, and the ".tpf" files contain the textures the things pull from. You can export models as Collada (missing stuff like bones, which I don't want to do because Collada's trash), which also saves the textures as ".dds" files. Some characters, particularly bosses, don't have textures packed with them. I haven't looked into that at all.

 

- "map/m##_##_00_00/" path contains map models in the ".flver.dcx" files. Their textures are supposed to work; I don't know why they don't. The textures for each map area are in "map/m##/m##_####.tpfbhd" archives.

 

- "script/*.luabnd.dcx" contain Lua binaries for general game logic. I wrote a quick disassembler for it that presents it in a comprehensible format, and a simple decompiler would not be hard.

 

Here's what you can look at in "dvdbnd1.bhd5":

 

- "menu/" contains a ton of images for building up the UI and telling you you suck. "menu_*.tpf.dcx" contains the most interesting stuff.

- "msg/<LANGUAGE>/*.msgbnd.dcx" contains ".fmg" files that contain game text. I Google Translated the file names and list them at another site (https://sites.google.com/site/fileformats/engines/dark-souls).

- "obj/" contains models for general world decorations, it looks like. Sometimes the textures are there and work, sometimes they're not so they don't.

- "other/" contains some neat images.

- "params/" contains game parameters and rendering parameters for the different areas.

- "paramdef/paramdef.paramdefbnd.dcx" defines the format for the tables used in "params/".

- "parts/" contains models for clothing. I'm surprised it works so well, I haven't even looked at that before.

 

"dvdbnd2.bhd5" and "dvdbnd3.bhd5" are patches that provide new script/event and game texts.

 

I've also gathered quite a lot of the table data into a huge Google Docs Spreadsheet, which you can look at here:

 

https://docs.google.com/spreadsheets/d/1KukblWL61We64-gNIyaAShga9h8RTXYmyFs98eQhY4E/edit?usp=sharing

 

Most of the "English" text is Google translated, so figuring out what things are and mean can be a challenge; you should be able to add comments if you figure things out, or just ask to be an editor and I'll make you one.

Edited by BurtonRadons
Link to comment
Share on other sites

Are you the next Monarch?

 

This sounds amazing. I'll give it a go as soon as I get back from work.

 

[Edit] Or not. I get a crash at startup, something about System.ArgumentOutOfRange in mscorlib. I'm on .NET 4.5.1

 

 

Edited by blackchimes
Link to comment
Share on other sites

  • 3 weeks later...

Are you the next Monarch?

 

This sounds amazing. I'll give it a go as soon as I get back from work.

 

[Edit] Or not. I get a crash at startup, something about System.ArgumentOutOfRange in mscorlib. I'm on .NET 4.5.1

Agh, I thought I had tried installing it on another computer. Once I get DS2 working fine with my program on PC (they've encrypted and/or compressed the headers for some dumb reason - I hope they have better security against cheating than that, like using VAC) I'll make up a release and test it properly. Sorry about that!

Edited by BurtonRadons
Link to comment
Share on other sites

No problem man, if you get that thing working it will be the best thing that ever happened to Dark Souls modding scene since the "THANKS OBAMA" death message.

 

Hell, even just being able to actually look at enemy stats and drop rates would be great.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry about the delay, life has been intervening and it's proven rather annoyingly hard to get development environments up on any other computers I have access to. :smile: One thing I've been working on is the parameter data files, which are huge-ass tables containing pretty much all global data. I've been putting them in a Google Docs Spreadsheet and using them to gather more information about them for the code, which then gets fed back into the spreadsheet. The whole mess is here:

 

https://docs.google.com/spreadsheets/d/1KukblWL61We64-gNIyaAShga9h8RTXYmyFs98eQhY4E/edit?usp=sharing

 

Drop rates are in the "Item lots" sheet, which corresponds to item lot indices in the "NPCs" sheet. Every item there has a name and context, but it was of course in Japanese so I had to Google Translate it (even if I understood it; there's tens of thousands of lines). So figuring out what is what is a little difficult. If you add a comment to one of the entries to give the proper name, I'll see it and make the change. Or just ask to be an editor, whatever.

 

Also, I finally got everything together for a release. It doesn't crash on two different computers (all Windows 7, unfortunately, but a wide spectrum for hardware). On one of the computers it insists that everything is a cube and renders rats, tunnels, and even cubes as cubes. It is very odd and I don't know why it does that, but it doesn't harm any functionality so I'm going ahead and unleash this mess on the world. It's a zip file of an executable file because GitHub was being uppity (it does or did support executables, I don't know man).

 

https://github.com/Burton-Radons/Alexandria/releases/tag/v1.0.1

 

Edit: Noticed I had a dumb bug that reversed red and blue for textures. Fixed that, and then found out that Github remembered oh, it DOES support executable files in releases! Puppies and rainbows. So the release has an updated installer.

Edited by BurtonRadons
Link to comment
Share on other sites

f*** yeah, now we can get some modding done.

 

[Edit]How to read drop rates(based on common sense, gut feeling, and spending hours in Undead Burg farming enemies there for 10 Humanity several times):

 

There's two kinds of data for drops. Horizontal(Item ID 1, Item ID 2, etc.) and vertical(multiple entries for a single enemy ID, for example the Undead Warrior (Sword) has four entries: 25400000, 25400001, 25400002, 25400003).

 

The difference seems to be that out of horizontal entries, only one can drop at a time. So for our Undead Warrior (Sword) with ID of 25400000, we have 97% chance to get nothing(Item 1, empty value), 2% chance to get the Shortsword(Item 2, 2% value) and 1% chance to get the Cracked Round Shield(1% chance, Item 3).

 

So you can get either the sword or a shield from an Undead Warrior (Sword), you will never get both. Crystal Lizards(ID: 3300000) are another good example of this mechanic - they always drop two("Item count" value) Twinkling Titanite and one other random ore.

 

This limitation does not apply to vertical entries. These are calculated separately. So it is theoretically possible to get the entire armor set from an Undead Warrior (Sword) all in one drop. The chance of that happening is of course 1:1000000, so don't count on it.

 

I do not know how Item Discovery Rate affects these values. For this we'd have to peer into the source code.

 

In some cases the entry for the first item is over 100%. For example, for the Undead Soldier (Spear) (ID:25500004), the base drop chance for Titanite Shard seems to be 16%. Hovewer the chance for dropping nothing is 984%. I believe this means that the actual item drop rate is nerfed tenfold(984+16=1000), so in this example the 16% becomes 1.6%, which is more in line with what I observed in the game. This might be because whatever crazy formula FROM used for calculating drop rates only accepts integers. Or it might be because FROM is full of weirdos who love overly convoluted mechanics.

Edited by blackchimes
Link to comment
Share on other sites

Yeah, it's definitely summing the chances and then scaling percentages from that; I've changed the column names to reflect that. The Darkwraith, for example, has an 0.2% chance of dropping a Titanite Slab.

 

It'd be nice to know how Discovery Rate fits into that, and how Enable Luck fits into that. For the Darkwraith, Enable Luck is 1 for nothing but 0 for every item. So does that mean that with a 400% Discovery Rate it cuts the chance of getting nothing four times? Or, alternatively, does it mean that it increases the chances of getting nothing four times? :smile:

 

There were a bunch of comments, and I've integrated them into the spreadsheet; those were helpful, thanks! The translated names are scattered about the sheets and I'll change them over as I see them. The ones I have so far are:

 

  • Abyss - New Londo Ruins
  • Base - Firelink Shrine
  • Castle 1 - Undead Burg/Parish
  • Castle 2 - The Depths
  • Crystal Tower - The Duke's Archives
  • Daihaka - Kiln of the First Flame
  • Giant cemetery - Tomb of Giants
  • Immortality institute - Painted World of Ariamis ("Immortality" is used a lot; jushi.org tells me it also means "undead", and which we'd use as "Hollow")
  • Kage-machi - Blighttown
  • Metropolitan Waste - Demon Ruins/Lost Izalith
  • Moriniwa - Darkroot Garden
  • Ojo 1 - Sen's Fortress
  • Ojo 2 - Anor Londo
  • Past forest - Oolacile
  • Underground lake - The Great Hollow

Edit: I'm starting to use conditional formatting to gray out unused entries. I've done this to NPCs and to Item lots. NPCs also had some wrong data in it (mostly in the true/false values) because it's a rather early dump.

Edited by BurtonRadons
Link to comment
Share on other sites

Awesome job on this. That prototype character selection screen is real interesting.

 

One question though: Do almost all .flver files crash for everyone, or is this something only I'm experiencing? Sometimes I get an improperly rendered object with a texture, but a terrible form.

Edited by TheMysteriousMrM
Link to comment
Share on other sites

Awesome job on this. That prototype character selection screen is real interesting.

 

One question though: Do almost all .flver files crash for everyone, or is this something only I'm experiencing? Sometimes I get an improperly rendered object with a texture, but a terrible form.

 

If you mean the "Character initialisers" table, yeah there's some good stuff there. I need to fix names on it, since it's how it decides what humans wear, both friends and foes.

 

That sounds like the "everything is a cube" problem I have yet to hunt down. I'm spending some time working on that system. I want it to be easier to explore what each piece means, and there's some weird nonsense that happens with it (after awhile it stops generating new OpenGL contexts). Right now it sort of converts itself into a different model format to display things; I'm writing it to be based entirely on Dark Souls, with its own shader so lightmaps can be rendered properly. And then I'll figure out what's going on with that rendering stuff. What I really want is to get it to be able to display whole map areas so we can start seeing how data are working together.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...