Larian Banner
Previous Thread
Next Thread
Print Thread
Modding DKS/ED #657488
04/12/19 07:58 AM
04/12/19 07:58 AM
Joined: May 2010
Posts: 4,486
The Frog & Hounds
vometia Online sleepy OP

Duchess of Gorgombert
vometia  Online Sleepy OP

Duchess of Gorgombert

Joined: May 2010
Posts: 4,486
The Frog & Hounds
Dunno if there's much interest in this, nor have I quite obtained clearance from tptb that it's 100% okay to discuss all of it in detail as there's one particular thing I need to clarify; but apart from that potentially gnarly issue the rest of it is fairly uncontroversial stuff.

Obligatory warning: MODDING IS AT THE USER'S OWN RISK! Your game could become unstable and your saves corrupted and smelly Gorgombert might gush out of your PC's USB ports. You have been warned.

Anyway, that aside, it does have some potential for modding even though apart from my own general meddling there doesn't seem to be much if any of it about.

Part of the problem is that the game doesn't load loose files nor additional DV2 archives, at least not without some incantation that I'm unaware of. And the contents therein are pretty much entirely stored in NIF format, which is a potential headache as it's a binary format, or rather it's a whole family of binary formats which vary from one game to the next and whose proprietary nature often means that the only understanding of their internal format is someone with a hex editor, a lot of time ant patients and probably as much trial and error.

From my perspective that means that modding is currently limited to modelling and retextures. Of the two, modelling has been the more straightforward as Blender 2.49 can read its NIFs directly, and can write them after a fashion, at least once I'd mangled the export script (which I shall upload somewhere, though it would probably be at least polite to check with the original author first). Getting the exported NIF into a format the game is happy with is easy enough and I'll explain in detail in a later post.

Textures are more fiddly, which seems surprising as retexes are the usual basic modding you do when nothing else is really accessible. The reason they're fiddly is that "everything is a NIF" approach, which seemed pretty bloody-minded to me but having finally developed a basic understanding of DDS files and exactly what the NIF contains I now understand why it's a thing: to be used effectively and efficiently, the DDS needs a fair bit of meta-data that the DDS itself doesn't include. The NIF is a nice handy way of storing it consistently. Provided you have something that can read and write its particular format, that is. Until recently I've been creating "FrankenNIFs" by sellotaping file fragments together but have finally written a script to do it properly. That can be made ready for public consumption without too much effort, the only minor snag being that I don't really "do" Windows, I'm a Unix hacker, so it requires Cygwin or a handy Unix/Linux box to run.

If I'm feeling adventurous I may attempt to analyse how the config files work, which are a sort of XML-in-NIF-format thing, though tbh I am not very optimistic: I'm not sure I have the ability, patience nor fortitude, but we'll see.

Anyway, I shall describe the various things I know are possible in more detail a little later.


J'aime le fromage.
Re: Modding DKS/ED [Re: vometia] #657791
17/12/19 02:13 PM
17/12/19 02:13 PM
Joined: May 2010
Posts: 4,486
The Frog & Hounds
vometia Online sleepy OP

Duchess of Gorgombert
vometia  Online Sleepy OP

Duchess of Gorgombert

Joined: May 2010
Posts: 4,486
The Frog & Hounds
A rather tardy update but my DV2 utility is available here if anybody is interested.

To reiterate the previous point, its use is strictly at your own risk! This is something I've written for my own convenience and thought I'd share, but it will be only randomly supported by me and is nothing to do with nor endorsed in any way by Larian. Sorry to be pedantic, but I figured it's important that nobody is under any illusions.

Talking of which, it is not immediately ready to run: it's source code only and needs to be compiled. For that you'll need a Posix environment so either a FreeBSD/Linux box or Cygwin for Windows as both a development and runtime environment. In the latter regard, you will need either gcc or clang as well as zlib-devel.

The source code is also the product of someone with chronic insomnia so it tends to meander about rather than being the product of a clear and definite design specification and good project management. If you do use it, back up your stuff first and it's at your own risk. It hasn't eaten my files but God knows what curious design ideas have gone through my head at 3am because I certainly don't.


J'aime le fromage.
Re: Modding DKS/ED [Re: vometia] #657844
20/12/19 04:19 AM
20/12/19 04:19 AM
Joined: May 2010
Posts: 4,486
The Frog & Hounds
vometia Online sleepy OP

Duchess of Gorgombert
vometia  Online Sleepy OP

Duchess of Gorgombert

Joined: May 2010
Posts: 4,486
The Frog & Hounds
A few updates to my DV2 program. Mostly some debugging and other stuff of little consequence but the main addition is a new flag to list the contents of a DV2 without going through the rigmarole of either unpacking or testing the contents of everything it contains.

I have also included a few other bits and pieces:
  • A reworked export script for Blender 2.49 so it will actually write NIFs now (it didn't when I first tried to do so). It still needs some work after the file has been written in order for it to work in DKS. I have included a brief explanation in the associated readme.txt file but more comprehensive documentation will follow soon.
  • The relevant part of nif.xml required for recent versions of NifSkope to open DKS NIFs. Somebody had already updated this to read DKS as well as the older ED NIFs but at some point afterwards there was a major revision of its NiGeometryData definition which broke it again. I have included the older version (but not the complete nif.xml).
  • A Bash script that takes DDS files and packs them into NIFs, which is the format DKS requires. It's rather slow and embarrassing but it may be useful to others. As with the DV2 source code, it requires Cygwin to run, as well as a functional file command that correctly identifies DDS files.


J'aime le fromage.

Moderated by  Bvs, ForkTong, Larian_QA, Lar_q, Lynn, Macbeth, Raze 

Powered by UBB.threads™ PHP Forum Software 7.6.2