Game Development Community

Swaping out body parts on a model?

by Chris Dickinson · in General Discussion · 09/20/2009 (1:10 pm) · 8 replies

I'm wondering if this is possible and how we'd go about it... I'm attempting to create a system where creatures can change over time. So basically we have a base model (a body), and we want to be able to attatch different limbs and such to it.

The graphic designer is actually wondering whether he can use morph points to do this, or should just go with different body parts which fit together on the same model. If anyone has any idea how Torque can handle this, any information would be greatly appreciated.

Thanks!

#1
09/20/2009 (2:22 pm)
one approach is to build all the meshes into a single DTS file and then programaticlly hide all but the handful you want shown. searching for "hiding meshes" in the resources should turn up something useful.

in my experience this works pretty well if you're just having a relatively small number of different body parts. if you start having very many, say over a couple hundred, the art pipeline here becomes very cumbersome. T3D has some new features which would allow you to keep each body part in a separate file, which should ease the art burden.
#2
09/20/2009 (2:28 pm)
hmm thanks interesting, sorry I don't know much about the DTS file type and how torque handles it. I can have multiple meshes in the same DTS file, and then within Torsion script set them to visible or hidden?

Cause that seems a fairly easy way of handling it :)
#3
09/20/2009 (3:12 pm)
yep. you name the meshes in your modeling app, then turn them on / off w/ torquescript. you may need to implement the mesh-hiding resource; i know i did, but i think there may be some stock functionality as well.
#4
09/21/2009 (12:22 pm)
Thanks, I've looked into it, looks great and rather simple to impliment :)

However, having thought about it, this would make swapping body parts for creatures simple as long as the body and thus points to fit the legs or the head remain constant. It won't work if they move around though...

Is it possible to use attatch points on the body to attatch different dts models?

EDIT: just found this http://www.garagegames.com/community/forums/viewthread/471

"the armor is attached to the nodes which are linked to the bones. they follow position and rotation of the bones to apear like they are being worn."

Which sounds similar to what we're doing. At the moment we're using the first Torque Game Engine (not even TGEA) for prototype purposes, so hopefully it's supported. Can anyone confirm if this method would work? And can anyone expand on how this is actually achieved?

Thanks.
#5
09/21/2009 (12:40 pm)
you can use the mesh method, this works and we have confirmed it. You might look into the MACK pack this has a very similar code that works.
#6
09/21/2009 (1:09 pm)
By mesh method you mean turning meshes on or off? The issue with that as far as I can see is that if we hide one body and show another which is a different size, the meshes which are meant to attatch to it will no longer be in the correct positions...

I've looked up this MACK pack, looks awsome. But again all the examples show human forms where the actual body never changes, it simply adds armour onto the body. We need to be able to change the attatch points on the body as the body is also capable of completely changing.

Any idea if this is possible?
#7
09/21/2009 (4:43 pm)
is the skeleton of the body changing ?
#8
09/23/2009 (10:32 am)
you can completely change each mesh portion, but you still have to accomodate each type of mesh, and certainly if you have different size meshes with different meshes there will be mismatches. Yes you can change the mesh body, but you are going to still come across the issue of size and scale and how to adapt that. unless you rewrite the entire system and physically mount arms and animate them independantly for each action ie. Small arms running, punching, holding weapons ect, large arms, ect, then of course you would still have the body, which you would mesh change, and probably would be your single actual player.. but this process is very complex and will require some fancy programming. Now you could do like spore and write a dynamic mesh system that blends the vertices on the fly and the skeleton is written dynamically to allow the mesh to stretch and such. But if this is your first project.. this might be a bit over the top in time and budget. Go with the MACK pack, mesh swapping and start there. probably will give you very close to your requested results.