Author Topic: questions about walkmesh  (Read 706 times)

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
questions about walkmesh
« on: December 07, 2015, 07:18:22 am »


               

i'm learning about walkmeshes. i'd like to arrive at some sort of a tileset where a pc can walk into the water or a placeable can be placed on [i.e., in] the water, using [for example] the watery tiles in the tcn01 city tileset. disclaimer - i know nothing more about tilesets and walkmeshes than what i've been able to discover in the last day or two, so... yeah, right newb here. lol


 


i've learned that each face in a walkmesh has a numeric identifier that indicates whether or not that part of the mesh is walkable, and if so, what sort of sound should be generated. i found this article that mentions that faces having the identifier 17, for example, should not be walkable.


 


i exported a few of the watery tiles in tileset tcn01 using nwnviewer and looked at them with a text editor. daunting... although to be fair, i think i've figured out that the format under the 'faces' section must control walkability ; here i see sets of 4-tuples, and it seems that the 4th number in each tuple is the numeric identifier controlling the surface type. so here i go with some naïve questions :


- is my assumption correct ?


- would it be enough to replace the occurrences of '17' in these .wok tiles with, for example, '6' ?


- would this be advisable from a systems standpoint ?  [i.e., would any side-effects i introduce by doing this prove i really am i getting in 'over my head'... ;) ]


- if this seems like a reasonable approach, can anyone recommend a tool that would help me do this ? i think going about it in a text editor will take a lot of time.


 


thanks much for your insights.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
questions about walkmesh
« Reply #1 on: December 07, 2015, 09:43:13 am »


               I made just such a tile here.

I have little or no idea of what I'm doing with the text editor, but I didn't find it that complicated.

First, copy the pwk file for a tile that allows walking. Edit the name of the model wherever it occurs to match the new file name (this is essential for all models). Change the position statement to the desired height (the third parameter is the z axis).

Second, edit the water tile. There are various nodes in the model, mainly corresponding to planes. Adjust the the AABB plane to match the new walkmesh. The water surface plane will be at the correct height, but the mud plane may need to be raised or lowered to look right. All of this is managed with position statements.

Lastly, follow the tutorial to get your tile in the .set and .itp files.

This is a very simplistic approach - see caveats in the Read Me that comes with my model.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
questions about walkmesh
« Reply #2 on: December 07, 2015, 12:15:25 pm »


               


i'm learning about walkmeshes. i'd like to arrive at some sort of a tileset where a pc can walk into the water or a placeable can be placed on [i.e., in] the water, using [for example] the watery tiles in the tcn01 city tileset. disclaimer - i know nothing more about tilesets and walkmeshes than what i've been able to discover in the last day or two, so... yeah, right newb here. lol


 


i've learned that each face in a walkmesh has a numeric identifier that indicates whether or not that part of the mesh is walkable, and if so, what sort of sound should be generated. i found this article that mentions that faces having the identifier 17, for example, should not be walkable.


 


i exported a few of the watery tiles in tileset tcn01 using nwnviewer and looked at them with a text editor. daunting... although to be fair, i think i've figured out that the format under the 'faces' section must control walkability ; here i see sets of 4-tuples, and it seems that the 4th number in each tuple is the numeric identifier controlling the surface type. so here i go with some naïve questions :


- is my assumption correct ?


- would it be enough to replace the occurrences of '17' in these .wok tiles with, for example, '6' ?


- would this be advisable from a systems standpoint ?  [i.e., would any side-effects i introduce by doing this prove i really am i getting in 'over my head'... ;) ]


- if this seems like a reasonable approach, can anyone recommend a tool that would help me do this ? i think going about it in a text editor will take a lot of time.


 


thanks much for your insights.




 


[EDIT - to improve clarity and qualify a later statement better]


 


Changing walkmesh face material is an automated process in CM3. When you run the tiles through CM3 you will see an option to "change walkmesh material" adjacent to two boxes labeled "from" and "to." This will handle the task for you and is much safer than using a text editor to edit models.


 


CM3 can be downloaded HERE. The program is well-documented and fairly self-intuitive (at least IMO).


 


Just a final word about text editing an ascii format .mdl file - aside from "discreet edits" or "systematic changes" (e.g. changing bitmap references, ) and unless you really know what you are looking at, editing an .mdl file with a text editor isn't always the best method. For more complex changes (e.g. changing walkmesh materials, moving verts, parenting nodes, etc.), the much safer alternative is to download GMax (and the NWMax Plus for GMax plugin) and use that program to work with models. This way you have a visual representation of the model that can be manipulated and adjusted as needed then exported.



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
questions about walkmesh
« Reply #3 on: December 07, 2015, 05:39:09 pm »


               


Just a final word about text editing an ascii format .mdl file - aside from a few rare cases (e.g. changing bitmap references) and unless you really know what you are looking at, editing an .mdl file with a text editor is BAD. The much safer alternative is to download GMax (and the NWMax Plus for GMax plugin) and use that program to work with models. 




I don't know what the words bad or unsafe mean in this context but when you make a discreet edit to a .mdl in a text editor, at least you know exactly what data has been changed when you hit save.  That's not always the case in NWMax/Plus.



               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
questions about walkmesh
« Reply #4 on: December 07, 2015, 05:54:58 pm »


               


I made just such a tile here.




 


OMG this is such an amazing thing !!  thanks for the link, you guys have done some really superb work. '<img'>


 


Lastly, follow the tutorial to get your tile in the .set and .itp files.

 


by tutorial, you mean the readme in the package ?  or is there something else i should be looking at ?


 


 




Changing walkmesh face material is an automated process in CM3. When you run the tiles through CM3 you will see an option to "change walkmesh material" adjacent to two boxes labeled "from" and "to." This will handle the task for you and is much safer than using a text editor to edit models.


 


CM3 can be downloaded HERE. The program is well-documented and fairly self-intuitive (at least IMO).


 


Just a final word about text editing an ascii format .mdl file - aside from a few rare cases (e.g. changing bitmap references) and unless you really know what you are looking at, editing an .mdl file with a text editor is BAD. The much safer alternative is to download GMax (and the NWMax Plus for GMax plugin) and use that program to work with models. 




 


got it. i'll stick to cm3 then, thanks for the link !


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
questions about walkmesh
« Reply #5 on: December 07, 2015, 11:35:21 pm »


               IIRC the Tileset Group Tutorial has a good discussion of .set and .itp (you can skip the model-making steps).


While NWMax (or similar) is essential for complex modelling, text editing is perfectly safe for simple, systematic changes, in my experience. Modelling tools have a steep learning curve, and are drawing-oriented, requiring skills I'll never possess. So, as a scripter, I stick to what I do best, treating models as script, while acknowledging that nothing elaborate can be made that way.
               
               

               
            

Legacy_cervantes35

  • Sr. Member
  • ****
  • Posts: 426
  • Karma: +0/-0
questions about walkmesh
« Reply #6 on: December 08, 2015, 07:14:12 am »


               

OTR changing areas of non-walkable or obscurring mesh to walkable also effects LOS and Pathfinding  which is a set file moodification that must be made as well. You must  have a good understanding of the whole tileset concept or you could cause more harm than good. Changing wokmeshes unless its clear cut like a gras to dirt is not adviseable to a novice modeler.


 


I do wish I was not overseas now away from my home computer because I have a completed set of all the TCN01 water tiles made them walable and added more tiles to them, I also fixed pathnodes and LOS. Since it actually sounds like this maybe used once I arrive back home I may post the tiles to the vault (Not until Feb of next year thou) man I am really missing my home computer. 



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
questions about walkmesh
« Reply #7 on: December 08, 2015, 10:36:07 am »


               


I don't know what the words bad or unsafe mean in this context but when you make a discreet edit to a .mdl in a text editor, at least you know exactly what data has been changed when you hit save.  That's not always the case in NWMax/Plus.




 


Good point, I should have been more explanatory in the difference between a discreet edit (such as the example I gave) and an edit that could bork the entire model. Personally, I've never had an issue with NWMax Plus changing things - even emitter exports are much improved - to a point where the model is unusable. I can't say the same for models that, in the past, I'd used a text editor on to make changes.


 


I edited the above post to clarify better.



               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
questions about walkmesh
« Reply #8 on: December 08, 2015, 08:32:48 pm »


               

just curious, can anyone point me to a document explaining the .mdl file format ?


if not, does anyone happen to know what the 8 numbers in a face designate ?


e.g., the '0 1 2 1 0 0 0 17' in the following snippet ?



  faces 120
    0 1 2 1 0 0 0 17
   .
   .
   .

pretty sure the last one is the surface type, but have no clue as to the other ones.



               
               

               
            

Legacy_rjshae

  • Hero Member
  • *****
  • Posts: 553
  • Karma: +0/-0
questions about walkmesh
« Reply #9 on: December 08, 2015, 09:14:24 pm »


               

I seem to recall that at least three of them are the indices of points. I.e. the three corners of the triangular face. The other three escape me at the moment.


 


Ed.: The other three might have been indices of edges (for cases where the faces aren't joined).



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
questions about walkmesh
« Reply #10 on: December 09, 2015, 04:32:20 am »


               

For faces, I believe it's... 


V V V S T T T M


V - Row # of the vertex in question as listed under "verts", which contains its x,y,z position


S - Smoothing group


T - Row # of the tvert in question as listed under "tverts", which contains its x and y position- with the 3rd digit hardcoded to 0


M - Material ID


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
questions about walkmesh
« Reply #11 on: December 09, 2015, 05:58:44 am »


               There is an unofficial (but useful) description of the .mdl format on the Wayback Machine.

If anyone has the time and knowledge, it would be helpful to turn this into a working document before it disappears from the web.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
questions about walkmesh
« Reply #12 on: December 09, 2015, 06:44:27 am »


               


There is an unofficial (but useful) description of the .mdl format on the Wayback Machine.


If anyone has the time and knowledge, it would be helpful to turn this into a working document before it disappears from the web.




It's interesting, in that it looks to have been written before the game itself was even released.  I'm not sure that particular document itself would need to be saved, as much as a proper one needs to be written up and placed somewhere it can be easily checked.


 



 


setanimationscale [float]


From the name I would guess this is a global control on the length of animations for this model. All of the character models use this setting, the tile and item (which aren't animated) do not.



  That part, for instance.  setanimationscale actually controls the scale that animations the model is supermodeled into are calculated at.  It's set, essentally, as the ratio of the model's rootdummy height to the animation supermodel's rootdummy height, with the supermodel being considered "1".

  As a note on it, that's also why character models differing too far from human standard size don't chair sit at the proper heights using the standard (a_ba/a_fa) animations, since the rootdummy is still located based on the distance from ground height, rather than from the chair up.


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
questions about walkmesh
« Reply #13 on: December 09, 2015, 03:57:59 pm »


               It would be very helpful if you, or someone else with the knowledge, could fill in the blanks.

As far as I know, this is currently the best documentation out there - and it might not be there for long. Despite its shortcomings, it's enabled me to do stuff that I certainly couldn't do otherwise, so just archiving it in a downloadable format would be a start.
               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
questions about walkmesh
« Reply #14 on: December 09, 2015, 06:58:35 pm »


               


As far as I know, this is currently the best documentation out there - and it might not be there for long. Despite its shortcomings, it's enabled me to do stuff that I certainly couldn't do otherwise, so just archiving it in a downloadable format would be a start.




 


done.


see this entry in the vault. i've made this redistributable by anybody at any time, so please feel free to amend and update as necessary to bring the info more in line w/your own experience.