Jump to content

Home

WalkMesh format discoveries


Fred Tetra

Recommended Posts

  • Replies 52
  • Created
  • Last Reply

Hello all,

 

* attention chuck your help is needed in the walk mesh aisle *

 

These darn AABB nodes require a recursive sub to read them in. Why couldn't it be a simple pointer+count like everything else in an MDL?

 

Going from binary to ASCII wasn't as hard as I expected. Now I just have to figure out how to get back to binary...

Link to comment
Share on other sites

Originally posted by shosey

Forgive my nievity here, but do area's with slopes (hills and stuff), are they any different - or do they work the same as the flat apartment example you gave?

 

The walk mesh is just another mesh. It follows the contour of the model (generally) so the game engine can know where you can and cannot walk and is not rendered. It does not appear that it has to be flat, however. More research will prove me right or wrong :)

Link to comment
Share on other sites

Originally posted by cchargin

Hello all,

 

 

 

These darn AABB nodes require a recursive sub to read them in. Why couldn't it be a simple pointer+count like everything else in an MDL?

 

Going from binary to ASCII wasn't as hard as I expected. Now I just have to figure out how to get back to binary...

 

You finished the AABB tree output before I had to deal with it; thanks! I had just pulled out a Perl book, too! :)

 

Oh, and remember, not everything in a MDL is pointer+count; look at the nodes themselves. You have to do a recursion to build the node tree (in getnodes) too. :)

Link to comment
Share on other sites

Originally posted by Gsccc

Wait, so we will or will not be able to make/edit new area modules. Because I really need to know that for my mod, it would be just fantastic!

 

Well, there's still work to do before a definitive answer can be given, but things are looking bright so far.

 

I did a model this morning to replace one of the rooms in the Taris apartments. While everything was dark and had a black surface, the geometry was obviously there. I must have modeled the lights or something else wrong, but the last time I did anything 3D was on a Macintosh II using Strata 3D :)

 

As I mentioned before, the thing that would make it hard is the fact that Kotor Tool needs a background rendered from the model to be used as a reference for element placement. This is "hard" because I don't have an easy way for people to add their own backgrounds. As for writing a 3D editor like you get in the NWN Toolset, I don't see it happening as there doesn't seem to be enough interest to justify the effort to learn DirectX and write a whole new editor.

Link to comment
Share on other sites

Originally posted by Fred Tetra

The NWN editor is Tile-based, while KotOR is not. (best we can tell <grin>)

 

You are certainly welcome to try and make it work!

 

Me? But I'm not the one with the abilities. :D

Link to comment
Share on other sites

Hello,

 

I must have modeled the lights or something else wrong

 

Uh ya, lights. I am working on the import export lights thing. Right now they only export to ascii as dummies, and import to binary ignores them.

 

I have a lot of catch-up to do for area models. :) I spent most of my effort on items and bodies and such.

Link to comment
Share on other sites

Originally posted by cchargin

Hello,

 

 

 

Uh ya, lights. I am working on the import export lights thing. Right now they only export to ascii as dummies, and import to binary ignores them.

 

I have a lot of catch-up to do for area models. :) I spent most of my effort on items and bodies and such.

 

Wheh, well that's a relief :)

 

Well, here's another happy update for all of you. I managed to figure out how Placeable walkmeshes (.PWK), which are simpler than the ones for Modules (.WOK), work. I updated the vertices on the benches that are on the north side of the Taris apartment ring so you can't get close to them. In fact, you can only get within about a meter from the front and 2 meters from the sides!

 

I have a class written that imports the BWM files, now I just have to decide how to handle writing them out.

 

One idea is to read the aabb node data from the ASCII model or from the ASCII PWK file you can have created for you if you are using NWMax. So far, this looks like the most viable option.

 

Modules are harder, however. I did manage to figure out where the AABB tree data is stored (at least it looks like AABB tree data), but there are a few other arrays of data in the file, present only for modules, that I haven't figured out the purpose of.

 

So, who's interested in making placeables?

 

<Edit: fixed spelling error>

Link to comment
Share on other sites

More good news!

 

First, I was finally able to get MAX to write out a PWK file for my own custom placeable model. (see below)

 

Second, I was able to create a binary PWK (BWM-format) file for it, and while it wasn't a completely automated process, I was able to put the whole file set into the Override folder and have it show up in the game and not be able to walk through it.

 

The next step will probably be to write an ASCII importer for the PWK that MAX generates.

 

There are still some unknown sections of data in the BWM structure, but they don't appear to have any adverse affect on basic placeables when they're all set to zeroes. Further research will hopefully tell!

 

 

modeltest.jpg

Link to comment
Share on other sites

I've written an editor to make the BWM class more accessible to end users.

 

It allows you to read and write between Binary and ASCII PWK (Placeable Walkmesh) files as well as tweak some of the yet-unknown-function data in the binary format files.

 

I discovered that if you name the .pwk file after the ASCII-format .mdl file (e.g. plc_dungheap-ascii.mdl and plc_dungheap-ascii.pwk), NWMax will bring both of them in at the same time. Quite a pleasant surprise! You can always load them separately, of course.

 

Once you've altered a model, you can export both files back out (selecting the AuroraModelBase and choosing Export Geom), then convert them to binary format. (.mdl with MDLOps; .pwk with the PWK Editor)

 

All files then go in the Override folder.

 

If anyone is willing to invest the time to determine what the unknown data does and help test it, please contact me.

 

 

PWK_Editor.jpg

Link to comment
Share on other sites

Originally posted by Hive

Have you considered asking Bioware about those unknown values? Who knows, they might be kind enough to tell you what you need...

 

Unfortunately, it's not like I have a phone number or email address of somebody there to ask. :)

Link to comment
Share on other sites

Fred, I found some interesting things when i was trying to find out where the gui recsources (not the .gui's but the way to make your own/ edit the the scripts that fire with gui buttons/how to link a button to go to a different gui) and i looked in layouts, there are some interesting files in there, that talk about .max things. Have you investigated into these files? .lyt

You probably have it just seemed interesting as it has to do with modules and their module pieces.

 

Here is the one for a telos module

 

#MAXLAYOUT ASCII

filedependancy 208TEL.max

beginlayout

roomcount 10

208TELb -3.58082 57.1766 0.0

208TELm -15.8099 77.3582 0.0

208TELo -704.341 762.388 0.0

208TELp 9.83827 36.4066 0.0

208TELq 27.8152 31.2205 0.0

208TELr 32.8151 8.08161 0.0

208TELs 13.61 -3.07471 0.0

208TELt -38.1694 23.2644 0.0

208TELu -38.2872 7.73002 0.0

208TELL -16.0946 -13.1766 0.0

trackcount 0

obstaclecount 0

doorhookcount 8

208TELb Door_12 0 -28.6856 20.7387 0.0 0.707107 0.0 0.0 0.707107

208TELb Door_07 0 -11.0115 16.7274 0.0 1.0 0.0 0.0 0.0

208TELb Door_11 0 5.7831 30.4662 0.0 0.707107 0.0 0.0 0.707107

208TELq Door_09 0 22.406 16.7274 0.0 1.0 0.0 0.0 0.0

208TELr Door_10 0 13.7781 3.59844 0.0 0.707107 0.0 0.0 0.707107

208TELs Door_08 0 9.76652 16.7274 0.0 1.0 0.0 0.0 0.0

208TELt Door_06 0 -32.6256 16.7274 0.0 1.0 0.0 0.0 0.0

208TELL Door_19 0 -11.0009 -0.740909 -0.0049721 0.0 0.0 0.0 1.0

donelayout

 

Anything interest you?

 

EDIT: Also Fred, have you looked into door walk meshes (.dwk)? I assume they are quite similar to pwk's in format, obviously some differences, but it would be cool to be able to make our own doors as well, except soem have animations so, hmm.

Link to comment
Share on other sites

Originally posted by Gsccc

Fred, I found some interesting things when i was trying to find out where the gui recsources (not the .gui's but the way to make your own/ edit the the scripts that fire with gui buttons/how to link a button to go to a different gui) and i looked in layouts, there are some interesting files in there, that talk about .max things. Have you investigated into these files? .lyt

You probably have it just seemed interesting as it has to do with modules and their module pieces.

 

Here is the one for a telos module

.

.

.

.

.

Anything interest you?

 

EDIT: Also Fred, have you looked into door walk meshes (.dwk)? I assume they are quite similar to pwk's in format, obviously some differences, but it would be cool to be able to make our own doors as well, except soem have animations so, hmm.

 

I've looked at these before, and I think I know how the layouts work. Once I can really bring in models that are lit (right now they're all black!) I can experiment more with them.

 

As far as DWKs go, yes, they are quite similar to PWKs (and WOKs!). I have, in fact, been working on them this past week and was able to make a correlation between the 3 DWK files for a door and the model files.

 

Another side benefit was that I think I may have discovered another bit of info that may help with model animations. CChargin and I have had some discussion on my findings and perhaps we'll see some updates in MDLOps in the future using them. (If they are valid, of course!)

 

I also figured out that NWMax will open the DWK file along with the model it's for when you import. Only my VIP users have the version that can convert PWK/DWK <-> ASCII right now, but it should be available in a future release for everyone else.

Link to comment
Share on other sites

Originally posted by Fred Tetra

Unfortunately, it's not like I have a phone number or email address of somebody there to ask. :)

 

Well I was thinking that maybe you could PM one of them on their boards or something... or if that doesn't work, start a thread there...

 

But perhaps I'm just being naive...

Link to comment
Share on other sites

Update:

 

I have figured out how to get NWMax to export the AABB (axis aligned bounding box) data. AABBs are used to determine where you can and cannot walk in KotOR modules. (Read more here)

 

I have also written a parser to bring this ASCII data into a binary representation, as well as an algorithm for recreating the tree node linkage data. (I tested all 1200+ WOKs in KotOR I, with one file having 21725 nodes!!)

 

Of course, further testing is necessary, but I think I'm closer to being able to create totally new module content.

Link to comment
Share on other sites

PRAISE THE LORD!!!!!!!!!!!

 

Excellent work Fred, This is great news, especially for the people doing storyline mods. I for one am very greatfull for your hard work on this Fred. Glad to hear you have been working so hard and that it has paid off:) .

 

Not to pester you or anything but, when do you think we will be able to make new modules?

Link to comment
Share on other sites

Archived

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


×
×
  • Create New...