Jump to content

Home

WalkMesh format discoveries


Fred Tetra

Recommended Posts

I decided to take a look at the BWM (Bioware Walk Mesh?) format used in the .WOK, .DWK, and .PWK files used in KotOR I & II.

 

I have discovered a number of things so far and I'm getting closer to figuring out how it works.

 

I recently figured out the part of the data structure that tells the game engine what sort of surface you're on.

 

If you place this file in your KotOR I override folder, then load up the game, go to the Taris apartments where the hideout it (or warp to tar_m02aa), and visit the room where the Ithorian is, notice what happens as you walk across the floor. Must be a leak in the pipes!

 

If I keep making progress at the current rate, I might be able to write an import/export tool so we can work with these files in 3ds Max.

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Must try to resist outburst. Oh who am I kidding.YES!!!

 

Fred this is so awesome I couldn't begin to think of what else to say. Now if only Cchargin can decipher more of the model and model animation formats we could be able to open up even larger fields of greatness.

 

Thank you for your hard work.

Link to comment
Share on other sites

Hello everyone

 

I don’t know if this will help, but there is a .wok files reader for Never Winter Nights. It doesn’t open kotor .wok files because it needs ascii files.

 

I was wondering if it was possible to transform kotor .wok files in .wok ascii files (like for 3d models that are turned into mdl ascii files in order to be opened by nwmax plug-in).

 

You can find the .wok files reader at this address:

http://nwvault.ign.com/Files/other/...757900354.shtml

And the documentation associated here:

http://nwvault.ign.com/Files/other/data/1076068410000.shtml

Link to comment
Share on other sites

Well folks, I've looked into the MDL file format now, and I've determined that the nodes with the type '545' (as seen in the MDLOps data viewer) are indeed the AABB/walkmesh nodes I've been looking for. An AABB is an Axis Aligned Bounding Box; for more info look here.

 

Here's what an AABB node looks like in the ASCII version of a MDL file:

 

node aabb walkmesh
 parent M01ab_09b
 position -0.948535025119781 -0.00639647990465164 0
 orientation 0 0 0 0
 alpha 1
 selfillumcolor 0 0 0
 diffuse 0.800000011920929 0.800000011920929 0.800000011920929
 ambient 0.200000002980232 0.200000002980232 0.200000002980232
 render 1
 shadow 0
 wirecolor 1 1 1
 specular 0.000000 0.000000 0.000000
 shininess 0.000000
 bitmap NULL
 verts 4
   -1.87669003009796 1.69570994377136 6.1035200360493e-007
   -1.87668001651764 -1.70325994491577 7.62939009746333e-007
   1.87217998504639 -1.70325994491577 7.62939009746333e-007
   1.87216997146606 1.69570994377136 6.1035200360493e-007
 faces 2
   0 1 2 1 0 1 2 10
   2 3 0 1 2 3 0 10
 tverts 4
   0.0354645997285843 0.475322008132935 0.0
   0.5 0.475320994853973 0.0
   0.5 0.475320994853973 0.0
   0.0354645997285843 0.475322008132935 0.0
 aabb -1.87 -1.7 0 1.87 1.695 9.9e-007 -1
      -1.87 -1.7 0 1.87 1.695 9.9e-007  1
      -1.87 -1.7 0 1.87 1.695 9.9e-007  0
endnode

 

I've added support for them to MDLOps so that it can at least partially export them so that they show up in 3DS Max when imported with NWMax.

 

 

Right now, the mesh can be displayed, and the surface properties (metal, carpet, non-walkable, usw.) can be adjusted easily in Max. What cannot be done it to import the actual AABB data into Max. Those are the rows of 7 values you see in the "aabb" section of the node above. These represent the nodes of an AABB tree.

 

It looks like there was some intention to support these in NWMax, but what code there is, is commented out.

 

I still have some work to do with the BWM files, which need to be co-created when you export a model from Max. Also, I'll have to see about adding the AABB data export to MDLOps, or see if Chuck will be able to do it. (Which may be faster, given my relatively novice Perl skills!)

 

Meanwhile, you can look at this screenshot, which shows both the m02aa_01 (Taris south apartments) room and it's walkmesh side-by-side (for clarity).

 

The violet areas are non-walkable, the yellow is "carpet" and the green "grass". :)

 

m02aa_01a.jpg

Link to comment
Share on other sites

Some of that went over my head, but it sounds like we are one step closer to new areas.

 

So as it is now how far do you think this will reach. Do you see this as only being able to edit the walkmesh For a game model or would we actually be able to build a new model and walkmesh?

Link to comment
Share on other sites

Originally posted by T7nowhere

Do you see this as only being able to edit the walkmesh For a game model or would we actually be able to build a new model and walkmesh?

 

You see, once we know how the walkmesh is set up (which I think I do, mostly), you can create a new model with the walkmesh in it, along with the .WOK file (a BWM-format file, which I have also mostly figured out). I see only two other problems.

 

One is the creation of the .LYT file (which I can't remember much of how it works).

 

The second is that the only tool we have for placing elements within a module is the Module editor in Kotor Tool.

 

The problem with this is that it does not work in 3D like the NWN toolset. Rather, it uses a 2D map background generated from the module's MAX model as a reference for element placement. This means that after you create a new model, a map background for it would have to be created and coded for in Kotor Tool.

 

I had re-written a portion of the Module editor so that this sort of thing would be easier if it ever happened (like it looks it now might!), but it's not 100% done yet, either. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...