Author Topic: Roll the bones  (Read 425 times)

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« on: September 10, 2011, 10:36:49 pm »


                <shaking his fist...>

I was hoping to find some way to do bones in GMax... a work around or something.

Here's the situation: Sylvi'a's hair.  It's dangly mesh and it doesn't work for me.  Not only is the processing load heavier than I want, but I have no control over the stuff, unless I break Her hair up into bundles of rigid, linked tubes... Yuck! 

Bones were made for this.  I want Her hair to swirl when She pivots.  I want it to flip up when She jumps back or tosses Her head. IOW, I want to animate it, and not leave it at the mercy of any old engine :-/

Without getting my hands actually *dirty*, does anyone know how difficult it would be to muck about in the ascii file to get my bones? The idea being to create the mesh and stand-ins for the bones, then go into the ascii and change it to something taken from a model that has bones (currently looking at the Canolith... I totally borked them by scaling them in NwMax, *before* I read the CCG... I *can* learn from my mistakes. Honest. :-)

Any advice? (besides "get a real modeling app" :-( 

Or does someone know if there's a way to export bones from GMax (CCG said no, but it *is* old, and perhaps things have changed)?

<...and tossing the bones>
               
               

               


                     Modifié par Rolo Kipp, 10 septembre 2011 - 09:38 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Roll the bones
« Reply #1 on: September 11, 2011, 06:54:14 pm »


               

Rolo Kipp wrote...
I was hoping to find some way to do bones in GMax... a work around or something.

Here's the situation: Sylvi'a's hair.  It's dangly mesh and it doesn't work for me.  Not only is the processing load heavier than I want, but I have no control over the stuff, unless I break Her hair up into bundles of rigid, linked tubes... Yuck!

The whole procesing load thing: NWN passes both skin mesh and danglymesh to a vertex program which runs directly on your GPU.  Anything, including animesh, which deforms the position of individual vertices relative to other ones in the same mesh in-game is going to be done the same way.  If you're curious, you can see exactly how these guys work (they're stored in plaintext in nwmain.exe) by looking at a dump of the strings in the binary.  Search for "VP1.0" to see what I'm talking about.

So, AFAIK, there shouldn't be any big problems with doing her hair as danglymesh unless your GPU is really, really old.  Something under an NVidia 5000 series or something like that.  Even then...  Or maybe your hair is really complex?

You can also take some of the guesswork about why your model might be underperforming by compiling
it.  If NWN loads an ASCII model it will compile it and all that means is it converts the information in the model file so that it can be fed to the graphics system I talk about in the first paragraph.  The compiling that NWN does on the fly is substandard to compiling done outside of the game, though in most cases you don't see the weakness but it really is there.  I like to use this model compiler for everything but if you have problems with skin mesh (or anything else), try this one.  They may make a noticable difference in your model and it will definitely load faster.

Bones were made for this.  I want Her hair to swirl when She pivots.  I want it to flip up when She jumps back or tosses Her head. IOW, I want to animate it, and not leave it at the mercy of any old engine :-/

If you do it with bones you're going to be in for a lot of work, because bones don't know gravity or mass or inertia.  Those have to be animated.  Look at wwhip_m_011.mdl and play through the animations to see what I mean.  You'd have to either do it by hand or utilize 3DS Max, which has tools to do those sorts of calculations for you.  I don't know offhand what you'd use in Max to do it, though, maybe Reactor or something like that? GMax has more stuff available than you'd think but I don't think it can do what you'd like it to do.

Without getting my hands actually *dirty*, does anyone know how difficult it would be to muck about in the ascii file to get my bones?

You can't do the stuff you want in notepad, all of those things have to be done inside a 3D modeling program, AFAIK.

The idea being to create the mesh and stand-ins for the bones, then go into the ascii and change it to something taken from a model that has bones (currently looking at the Canolith... I totally borked them by scaling them in NwMax, *before* I read the CCG... I *can* learn from my mistakes. Honest. :-)

If the model you speak of has meshes with which do exactly what you want your hair to do, you can use the meshes as bones.  Just make your skin and set the meshes you want as the bones.

Any advice? (besides "get a real modeling app" :-(

You may qualify for a limited free 3DS Max license from AutoDesk '<img'>

Or does someone know if there's a way to export bones from GMax (CCG said no, but it *is* old, and perhaps things have changed)?

Yep, skin and bones are 100% exportable from NWMax.  Here's a quick demo video I did- everything in every way was created from scratch in GMax (except the texture):
'Image
Just remember, your skin has to be at the top of the modifier stack.  Bones will probably show up in game.  To get around this, select them all after your mesh is skinned and boned and right click and convert them to editable mesh. Then slap an AuroraTrimesh modifier on them with Render unchecked and they won't show up in game.
               
               

               


                     Modifié par OldTimeRadio, 11 septembre 2011 - 05:56 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Roll the bones
« Reply #2 on: September 11, 2011, 07:02:49 pm »


               If you want to use 3DS Max for this I highly recommend downloading the student version. It will work for you. It is free. As long as you don't create commercial work with it, its not a problem.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #3 on: September 11, 2011, 07:36:47 pm »


               <dips his quill...>

Quote
OldTimeRadio wrote...
The whole procesing load thing: NWN passes both skin mesh and danglymesh to a vertex program which runs directly on your GPU.  Anything, including animesh, which deforms the position of individual vertices relative to other ones in the same mesh in-game is going to be done the same way. 
...

Ahhh. Wasn't sure whether it was doing the dangly different (as in CPU, or something else barbaric) from skinmesh.

That's good to know :-)

However, there is *one* major difference... The engine has full control over the dangly (wind and motion calcs), whereas the animator has full control over the skinmesh. Specifically, when she twirls around, her hair should not stick out and rotate like a propeller blade, but swirl around in that lovely flowing spiral. :-)

Now, here's a fine question which will make little difference to how I do things, but would also be nice to know: Where are the calculations for danglymesh done? Who is doing the calculations for wind & motion and merging them? How does the vertex engine on the GPU know how much wind to apply? What force to apply for motion?

Quote

So, AFAIK, there shouldn't be any big problems with doing her hair as danglymesh unless your GPU is really, really old.  Something under an NVidia 5000 series or something like that.  Even then...  Or maybe your hair is really complex?

Well, it *is* pretty old (32mb ATI Mobility Radeon 7500) on a pretty old (and half-dead) laptop.

The hair I'm using I snatched off one of the long-haired heads someone did. It's actually pretty dirty, but is good enough for right now.  I want to get a usable in-game creature before I really start improving her.

The hair is a pretty big thing on that list :-)

Quote

You can also take some of the guesswork about why your model might be underperforming by compiling
it.  If NWN loads an ASCII model it will compile it and all that means is it converts the information in the model file so that it can be fed to the graphics system I talk about in the first paragraph.  The compiling that NWN does on the fly is substandard to compiling done outside of the game, though in most cases you don't see the weakness but it really is there.  I like to use this model compiler for everything but if you have problems with skin mesh (or anything else), try this one.  They may make a noticable difference in your model and it will definitely load faster.

Grabbed! Thank you :-)

Quote

If you do it with bones you're going to be in for a lot of work, because bones don't know gravity or mass or inertia.  Those have to be animated. 

Takes me back to when I started with Sculpt 3D... '86? '87? Something like that.

Yes, but then this creature is a work of love for me.  I will lavish upon her all the attention I am not giving the lesser models. :-P

Quote

You can't do the stuff you want in notepad, all of those things have to be done inside a 3D modeling program, AFAIK.

You may qualify for a limited free 3DS Max license from AutoDesk '<img'>

I'll see if I can do 3DS legally. If I can, well... that changes things, doesn't it?
Quote
Or does someone know if there's a way to export bones from GMax (CCG said no, but it *is* old, and perhaps things have changed)?
Yep, skin and bones are 100% exportable from NWMax.  Here's a quick demo video I did- everything in every way was created from scratch in GMax (except the texture):
[/quote]
Cool vid :-) Thank you again. I really appreciate the depth of your advice.

Hmmm... ok, then there is something else wrong with the Canolith model... Those are the bones that vanished when I exported them after scaling.  I'll play with it.

Quote

Just remember, your skin has to be at the top of the modifier stack.  Bones will probably show up in game.  To get around this, select them all after your mesh is skinned and boned and right click and convert them to editable mesh. Then slap an AuroraTrimesh modifier on them with Render unchecked and they won't show up in game.

Oooh! Good advice. Never would have thought of that.

<...in the wrong ink>
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #4 on: September 11, 2011, 07:39:52 pm »


               <pats his...>

henesua wrote...
If you want to use 3DS Max for this I highly recommend downloading the student version. It will work for you. It is free. As long as you don't create commercial work with it, its not a problem.

I'm not planning to create commercial work, just labor-of-loves :-) I'll look into this today. TY, H

<...empty money pouch>
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #5 on: September 11, 2011, 08:01:53 pm »


               <crosses his...>

Well, the oldest edition I can DL is 2010 and I just *barely* meet the hardware reqs... :-(

DLing now.

But I'm drooling over Revit (I'm and old-school AutoCAD draftsman)...
I just wish I had something to run it on :-(

<...fingers>
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #6 on: September 12, 2011, 09:16:07 pm »


               <checks his sixes...>

Still DLing (83%)... *So* happy I can interrupt DLs :-P

Life @ *B would be difficult, otherwise :-(

<...and sevenses>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Roll the bones
« Reply #7 on: September 12, 2011, 10:52:40 pm »


               Same here. Using 2010. I have an old mac book that I salvaged from a friend's trash bin and swapped out the bad components on. It runs XP and OS X so covers me well for NWN. 3DS max has been working on it adequately.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #8 on: September 12, 2011, 11:24:26 pm »


               <looking uncomfortably...>

Holy moly. 5gb left on HD @_@

Installed, though :-)

Now I just need a mouse... Trackpoint hurts my finger :-P

Thanks for bumping me until I DLed it, guys :-)

<...cramped>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Roll the bones
« Reply #9 on: October 04, 2011, 05:12:22 pm »


               

Rolo Kipp wrote...
However, there is *one* major difference... The engine has full control over the dangly (wind and motion calcs), whereas the animator has full control over the skinmesh.

Good point.  It is basically a trade-off depending on how much control you want over how things work.

Now, here's a fine question which will make little difference to how I do things, but would also be nice to know: Where are the calculations for danglymesh done?

GPU

Who is doing the calculations for wind & motion and merging them?

GPU

How does the vertex engine program on the GPU know how much wind to apply?

It is passed that by NWN, probably as a value in the range of 1-255 or something close to that.  Don't think of it as wind, think of it as another envelope of influence (merely an all-encompassing one) affecting vertices which have some level of receptivity set to that influence.  Lots of that going on.  Turn on full grass and creature wind and run through the grass.  Aren't you essentially doing more or less the same thing to that grass that a bone does to deform skin mesh, but your player's perspace value in the 2da is the envelope of influence?

What force to apply for motion?

If you're talking about wind, wind is probably done as a grayscale value which is then fed into the scenegraph with all the other influences.  The number of transforms which are applied to vertices can only be described as enormous but those calculations are the bread and butter of a GPU.  If you ponder for a moment that all dangly vertices (at least) on your player inherit movement and wind influence at the same time and then realize that everything going on in the scene is also having these transforms applied per frame * number of frames per second...it gets dizzying.  At least it does for me.

One nice side effect of this rather esoteric point is that understanding how these things (generally) worked allowed me to understand why I could slam such highpoly models into NWN and have them work so smoothly: Compiled model data is not inspected or not inspected as closely before being fed into the Aurora Engine.  It appears to just be passed right in.  Which is why I can have a huge model, compile it, and it'll show up in game and its display will be dependent on your video card's horsepower, not on what NWN expects a model to be.  Or any other preconceived notions which might be hardcoded into the toolset or nwmain.

Also the "on the fly" ASCII model compilers for the toolset and NWMain don't seem to be the exact same thing and neither of them ever seem to work as well as external compilers.  They have preconceived notions about what data can be fed to them whereas an external compiler has much less restrictions.  Or, put another way, sometimes a model or VFX or animesh or any number of things might compile and give poor performance or not compile at all when using the toolset or nwmain to compile them.  But the models themselves are perfectly capable of being processed by an external compiler in advance and working in the Aurora Engine.
               
               

               


                     Modifié par OldTimeRadio, 04 octobre 2011 - 04:17 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #10 on: October 04, 2011, 05:33:48 pm »


               <chortles with glee...>

OldTimeRadio wrote...
One nice side effect of this rather esoteric point is that understanding how these things (generally) worked allowed me to understand why I could slam such highpoly models into NWN and have them work so smoothly: Compiled model data is not inspected or not inspected as closely before being fed into the Aurora Engine.  It appears to just be passed right in.  Which is why I can have a huge model, compile it, and it'll show up in game and its display will be dependent on your video card's horsepower, not on what NWN expects a model to be.  Or any other preconceived notions which might be hardcoded into the toolset or nwmain.

Me thinks I must start trying compiled versions... :-)

Also the "on the fly" ASCII model compilers for the toolset and NWMain don't seem to be the exact same thing and neither of them ever seem to work as well as external compilers.  They have preconceived notions about what data can be fed to them whereas an external compiler has much less restrictions.  Or, put another way, sometimes a model or VFX or animesh or any number of things might compile and give poor performance or not compile at all when using the toolset or nwmain to compile them.  But the models themselves are perfectly capable of being processed by an external compiler in advance and working in the Aurora Engine.

*Very* good to know, especially when I start mastering effects, I think. 

Now, to be clear:

Animesh is sampled vertex (& tvert! Hooray! I can make a face scowl!) deforms done on linear keys.
Skinmesh is bone-influenced vertex deforms done on defined keys.

Is this right? What are the pro/con's of each approach?

I *think* I want to set up bones and make Her hair swirl... but could I save the set up, using animesh, to just deform Her hair and then sample the deforms?

The bones, I think, would give easier animation at the cost of set up. Animesh, I think, would allow me to heavy-hand the mesh and save it, but at the cost of ease (for other anims, particularly) and lots of data(?).

What am I overlooking?

<...Glee is not amused>
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Roll the bones
« Reply #11 on: October 04, 2011, 06:36:50 pm »


               Short uninformative answer:

animesh -> dramatically more memory required, because it stores every vertex position multiple times
skinmesh -> more processing power required, because it calculates every vertex position for every frame

It's similar to the tradeoff between using baked and runtime lighting (which, yes, is not really relevant to NWN, though is possible with selfillumcolor). However, the GPU is probably better at using skinmesh than animesh. NWN has additional considerations, though. A skinmesh will only work in NWN if each vertex is affected by 4 bones or less. Any more, and it will either crash, or just ignore the additional bones. Certain operations, like scaling, require animesh to produce accurately as a result.

Animesh is also useful if you need to animate UV mapping, to scroll it for instance, which is impossible to do using txi settings (the txi settings can only split a texture into fixed frames, not scroll it per pixel).

In most situations, bones are actually a lot more intuitive a method for creating animations anyway.
               
               

               


                     Modifié par _six, 04 octobre 2011 - 05:39 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Roll the bones
« Reply #12 on: October 04, 2011, 06:57:48 pm »


               

Rolo Kipp wrote...
Now, to be clear:

Animesh is sampled vertex (& tvert! Hooray! I can make a face scowl!) deforms done on linear keys.

Not quite.  The best way my limited understanding permits explaing it is this: The vert and tvert position deformations don't involve linear keys like you might imagine.  Those animation keys (for our purposes, at least) take place at the object level.  An object rotates or moves via those keys  Vert/tvert movement occurs at the sub-object level- though I'm labeling tvert movement like that, you can still move it around with a gizmo on another modifier in the stack and make keys for that) Whenever you click on the plus next to Editable Mesh and fiddle around with verts, faces, edges or those other things listed under that modifer in the modifier stack, you're working at the sub-object level.  This may not be universally true because there are some freaky things you can get up to in Max but generally that should be the case.

If you export an animesh object you'll notice that the animation slider does more than one scrub over the animation while exporting.  I am presuming part of that scrubbing (moving the animation slider along the bar) process allows the export script to capture the position of individual vertices, which are always assigned a number (vertex1,vertex2 or something similar to that) so that their position can be recorded however many times, based on the # of samples you set in the animesh modifier.

So when you save it off the only keys you're going to see in Max are your regular keys while the real animation keys (the samples) for the verts/tverts are actually in your exported model.

Skinmesh is bone-influenced vertex deforms done on defined keys[/.

The whole defined key thing is a misnomer I think because the movements of the bones and their affect on vertices continue to occur between the keys.  This "tweening" thing is really important and I think you already know but I just wanted to make it clear if not.  Otherwise you're right.

What are the pro/con's of each approach?

For the purposes of what we're talking about (her hair), I think you're still going to get the best deal by using Flex.

Flex = Less work, you weight the vertices and the engine takes care of all the influences (like wind or rotation of her head) automatically.

Bones = You rig her hair with bones and then you animate the bones from scratch or use some Max system like...I have no idea to be honest.  Like Reactor or maybe an unusual use of the cloth modifier or something.  Generates a heck of a lot of keys.  If you try to chop out too many keys it starts not to look good because Max tweens between keys and the guesses it makes are not always the best.

Animesh = You make her hair strands (I'm thinking more like dredlocks) and then apply modifiers using modifier keys (they're like rotation and position keys but they affect settings on a modifier over time) to ape the movement you want over time.  You basically snapshot every single vertex in her hair over the life of the model.  I have no idea what kind of considerations you'd have to take into account trying to do that on a model.  That's waaaaay beyond my experience to even guess at.  I'm not even sure if the way animesh is set up if only those meshes with animesh modifiers or if every mesh in the scene during the animation selected in the animesh modifier is sampled.  You would definitely want to experiment with that to find out before doing much work because although animesh has gotten a sort of unnecessarily bad rap, using it in certain ways is definitely going to expose the very worst drawbacks of it as a tool.

Maybe someone has input on how hair can be done like you would like, that doesn't involve Flex and is easier somehow...(?)

I *think* I want to set up bones and make Her hair swirl... but could I save the set up, using animesh, to just deform Her hair and then sample the deforms?

Maybe.  You're probably going to be doing lots of deformations with modifiers of some sort so you'd need to look into what modifiers would do what you want.  You can set modifier keys as I mentioned above so there might be some modifier which fits the bill.

The bones, I think, would give easier animation at the cost of set up.

Yes.  Setup and animation.  See, I think of you setting up your hair with the same level of detail that, say, the whip has.  And that could get old really quick doing it by hand.

Animesh, I think, would allow me to heavy-hand the mesh and save it, but at the cost of ease (for other anims, particularly) and lots of data(?).

Yeah, that's basically my understanding too.  Animesh can be tuned down and optimized but for some things it's simply not the best tool.  Even with the granularity it captures, you wind up fighting that when the number of verts and samples involved starts going up.

What am I overlooking?

No idea because I'm sure I'm overlooking probably a dozen things, too.  ':lol:'
               
               

               


                     Modifié par OldTimeRadio, 04 octobre 2011 - 06:05 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #13 on: October 04, 2011, 07:29:11 pm »


               <taking copious notes...>

_six wrote...
Short uninformative answer:

animesh -> dramatically more memory required, because it stores every vertex position multiple times
skinmesh -> more processing power required, because it calculates every vertex position for every frame
...
A skinmesh will only work in NWN if each vertex is affected by 4 bones or less. Any more, and it will either crash, or just ignore the additional bones. Certain operations, like scaling, require animesh to produce accurately as a result.

Thank you. That's what I was looking for.

Animesh is also useful if you need to animate UV mapping, to scroll it for instance, which is impossible to do using txi settings (the txi settings can only split a texture into fixed frames, not scroll it per pixel).

Oh, drat! So I can't have Her lower her brows, flare Her nostrils and glare? Just flip between expressions... Well, that's something.

In most situations, bones are actually a lot more intuitive a method for creating animations anyway.

Confirming my initial evaluation... Again, thanks.

<...and hoping the author doesn't notice they're missing>
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Roll the bones
« Reply #14 on: October 04, 2011, 07:32:50 pm »


               <trying to be concise...>

OldTimeRadio wrote...

Rolo Kipp wrote...
Now, to be clear...

...Yeah, that's basically my understanding too.


TY, OTR :-) I always appreciate the knowledge you disseminate :-)

<...but not really understanding what "concise" means>