Author Topic: aabb ?  (Read 781 times)

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
aabb ?
« on: February 19, 2016, 09:04:03 pm »


               

i'm trying to figure out a few things regarding tileset models and walkmeshes. there's a section of the .mdl and .wok files identified with the header 'aabb' that i can't quite grok and can't find much info on, certainly no format spec or anything. from what i can gather, it seems to be used in collision detection and/or pathfinding. does anybody know what this does and how to interpret the format ?



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
aabb ?
« Reply #1 on: February 19, 2016, 10:26:05 pm »


               

thats the mesh that contains WOK materials. In essence it becomes the WOK mesh for a tile, or the PWK for a placeable. WOK's and PWK's are companion files for the MDL. You model the "walk" mesh in the MDL using the aabb mesh, and then on export if it is a tile or a PWK the anciliary file (WOK or PWK) should be created.


 


here's a google search for some other threads on this. I am sure an expert will chime in with documentation etc...



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
aabb ?
« Reply #2 on: February 19, 2016, 10:39:30 pm »


               

As henesua said an aabb node contains data about the material of the tile (the faces section of the aabb node to be more secific). It's used to play the proper sound (like stone, wood, dirt) and defines where the player can and cannot walk.


 


Then there is a aabb section in the aabb node. AABB = Axis Aligned Bounding Box (Tree). Normally used to detect overlap of two objects in 3D space, i.e. collision detection.


 


Like the name suggests it's a couple bounding boxes stored in a tree data structure. If I remember correctly the format for NWN (the aabb section of the aabb node) is: box minimum (x, y, z), box maximum (x, y, z) and the face the box belongs to (-1 if the tree node is not a leaf). An exporter has to generate it from the mesh of the aabb node.



               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
aabb ?
« Reply #3 on: February 20, 2016, 01:07:55 am »


               

so in the .mdl 'faces' section, each line in the part starting w/the 'aabb' heading refers back to one of the faces listed in the section immediately preceding it ?  [e.g., an entry ending w/'15' would refer to the 15th entry in the 'faces' section above it.]


 


and from what i can see, the .wok's aabb section appears to be an exact duplicate of the .mdl's 'faces' aabb section. correct ?


 


so now a real[virtual?]-world example. suppose i wanted to change the height at which a character appears to be walking on a tile with snow on it, to make the character appear to sink into the snow by 1 foot. snow is material 19. would i first have to identify the lines in the .mdl's 'faces' section having material 19, then modify those lines' corresponding entries in the 'aabb' section by subtracting 0.31 from the 3rd value in the line ?  and then make a similar modification to the corresponding line in the model's .wok file as well ?



               
               

               
            

Legacy_T0r0

  • Sr. Member
  • ****
  • Posts: 380
  • Karma: +0/-0
aabb ?
« Reply #4 on: February 20, 2016, 01:20:41 am »


               Or you can just fire up gmax and visually lower the walkmesh faces you choose.. Much easier.
               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
aabb ?
« Reply #5 on: February 20, 2016, 10:38:00 am »


               

and from what i can see, the .wok's aabb section appears to be an exact duplicate of the .mdl's 'faces' aabb section. correct ?

 




That is correct.


 



so now a real[virtual?]-world example. suppose i wanted to change the height at which a character appears to be walking on a tile with snow on it, to make the character appear to sink into the snow by 1 foot. snow is material 19. would i first have to identify the lines in the .mdl's 'faces' section having material 19, then modify those lines' corresponding entries in the 'aabb' section by subtracting 0.31 from the 3rd value in the line ?  and then make a similar modification to the corresponding line in the model's .wok file as well ?


It's not that easy. It's not enough to modify only the bounding boxes belonging directly to the faces. Some boxes span multiple faces. The way they are generated is the walkmesh gets split into 2 parts (2 bounding boxes), then those two parts are split again and the resulting parts again until there is only one face in a bounding box. Finding out which box belong to which faces by hand is hard. And you still need to edit the mesh itself too.


 


With that said, I really don't recommend editing the aabb tree or walkmesh by hand. Toro is right, it's easier and safer to use gmax or blender to do that.


               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
aabb ?
« Reply #6 on: February 21, 2016, 05:39:21 am »


               

With that said, I really don't recommend editing the aabb tree or walkmesh by hand. Toro is right, it's easier and safer to use gmax or blender to do that.



yyeahhhh...  i'm more of a regexp kinda guy, actually. almost zero knowledge in modelling. ':wacko:'   every time i've tried to work in gmax, i end up screwing something up. i think i'll write this one off.


 


thanks for the input though !



               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
aabb ?
« Reply #7 on: February 25, 2016, 05:47:05 am »


               


yyeahhhh...  i'm more of a regexp kinda guy, actually. almost zero knowledge in modelling. ':wacko:'   every time i've tried to work in gmax, i end up screwing something up. i think i'll write this one off.


 


thanks for the input though !




 


Heh... I can understand... I was totally and completely afraid of using gmax and 3ds due to the amount of damage I had caused when I first attempted things... biggest suggestion is to STILL try it, and just reign in your expectations and goals at the beginning.  Meaning, take it slow, only make ONE change to a given tile OR other object, and export.  Test it in game, and see exactly what you just performed in the editor either did or did not accomplish your goal.  I kept trying to "fix" too many things at once at the beginning, and kept doing more damage than good.  After a while of reigning myself in to just accomplishing a single repair at a time, I finally gained enough knowledge to become truly dangerous as evidenced by the 12 or so tile-sets released under the CTP moniker. 


 


Anyway, if you have the time, and the patience, it can be worth it.  Of course, you need a computer that can handle things... which is what is blocking me currently.