[xoreos-devel] question on NWN2 capability

Sven Hesse drmccoy at drmccoy.de
Thu Nov 6 00:02:40 CET 2014


Hej hej!

On 2014-11-05 14:07:20 -0500, Rowan Dersault wrote:
> But I was wondering how hard it would
> be to read in some of the scenery and objects from a NWN campaign

Not that hard. NWN's basic formats are relatively well documented by
BioWare themselves [1] (if you excuse some mistakes here and there)
and the model format is reasonable well understood as well [2].

[1] The old nwn.bioware.com site is long gone, but I took the liberty
    of mirroring the released specs here:
<https://github.com/xoreos/xoreos-docs/tree/master/specs/bioware>

[2] Torlack's old site is gone too, but his RE'd specs are available
    in the same repository:
<https://github.com/xoreos/xoreos-docs/tree/master/specs/torlack>

> translate them into an RIFT-compatible object model like the Unity engine.

I have no idea at all about Unity (apart from taking apart some games
data files with disunity [3] and looking into a few compiled game
scripts with IDA) or the RIFT, so I have no idea how well the NWN
stuff translates.

[3] <https://github.com/ata4/disunity>

> I was hoping I might be able to use Xoreos to do the reading of NWN files
> into an object model, and, as I understand it, Xoreos in it's current state
> can be pointed at some files and it can read them in.

xoreos can be pointed to a directory containing a full NWN
installation, and it will run the game as normal (or, at least, try
to, since a lot of things aren't implemented yet). Yes, it can read
NWN models and area descriptions, and display the area including
objects and character models.

Right now, the camera is set up in a first person perspective, and you
can fly around the area. This is of course supposed to change later.

See for example this screenshot here:
<https://xoreos.org/screenshots/nwn/ingame02.png>

It can not export models or sceneries into a generic format.

The relevant code in the xoreos repository is
- Basic file formats: <https://github.com/xoreos/xoreos/tree/master/src/aurora>
- NWN specific file formats: <https://github.com/xoreos/xoreos/tree/master/src/engines/nwn>
- Image formats: <https://github.com/xoreos/xoreos/tree/master/src/graphics/images>
- Models: <https://github.com/xoreos/xoreos/blob/master/src/graphics/aurora/model_nwn.cpp>

> The wiki says only "initial model
> support".  Does that mean it will load files into a model?

xoreos can read parts of the NWN2 model format MDB. Specifically, it
can read geometry (textured vertices and faces) from RIGD and SKIN
packet. This is enough to display most static geometry from a single
model file, like for example this house here:
<https://drmccoy.de/zeugs/20141105T223203.png>

Nothing more, nothing less.

It can't yet load area / scenery description either.

The MDB format is documented here: <http://nwn2.wikia.com/wiki/MDB_Format>,
and the relevant file in the xoreos codebase is this here:
<https://github.com/xoreos/xoreos/blob/master/src/graphics/aurora/model_nwn2.cpp>.

As you can see, you can not directly use xoreos to export NWN or NWN2
areas into something to hook into Unity; you would have to write
something like that yourself. But you can use the code in xoreos as a
guide or even a starting point (*), and/or you can use the existing
specs.

(*) If what you're writing can be interpreted as a derivative work of
    xoreos or of a part of xoreos, you would of course need to adhere
    to the GPLv3. I.e. if you distribute your derivative work, it
    needs to be licensed GPLv3 as well and you need to provide full
    sources to whoever you distribute the work itself. Just a heads up.
    Software freedom is a very important thing for me, so please keep
    that in mind. Thanks.

I personally am not a fan of Unity and I have no Occulus Rift, but I
find the general idea of flying through NWN and NWN2 areas
interesting. From what I heard though, existing game spaces are often
not that great up-close with a VR device: the proportions don't fit,
object placement doesn't make sense, etc.

Still, good luck and please, keep me informed about your progress! :)


Cheers
Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://xoreos.org/pipermail/xoreos-devel/attachments/20141106/15ab5046/attachment.asc>


More information about the xoreos-devel mailing list