Sign in to follow this  
a3a2004

detachable limbs

Recommended Posts

Jiia    592
I've been wondering what the best method for doing something like this is, myself. Say you have a solid SkinMesh, but want to allow a forearm to get blasted or cut off. Do you make an entirely new model missing that part? Not very flexible. Do you leave the parts disconnected? Visible cracks suck. Do you give each part of the body a different material ID, and dynamically change the mesh by removing and inserting faces (you would need to insert a bone / insides of the mesh).

I'm working on a zombie game, and I'm definitely going to have to allow some dismemberment :)

Share this post


Link to post
Share on other sites
Wildfire    154
Well, physics wise (what I guess a3a2004 wants to know) I'd say you duplicate the node the limb is attached to.

If this is the arm (the uppercase O is the shoulder)

-O---o---o---

you duplicate the shoulder note

-O o---o---o---

so that the arm is a seperate unit.

As for the mesh, I'd suggest keeping the ones that are 'arm only' and 'body only' as the are and remove those that linked arm to body and replace them with some kind of 'flesh' face to close the respective mesh.


===== ==\ /==
--O-- --> --o o--
===== ==/ \==

Something like this :) Hope you appreciate my crappy attempt on ascii art [cool].

You'll have to find a way to store which faces are shared between limbs and which nodes are detachable...

Share this post


Link to post
Share on other sites
jorgander    180
u could model the mesh with cracks, but make sure the points on the seam use the same normals (so it doesn't look like there's a seam). this will be harder if the mesh uses welded normals, but it's still possible.

also, depending on how complicated u want to get, u could move the vertices that make up inside of the limb (the part u see only when the limb is severed) to the end of the vertex buffer, then when the limb is severed just render that many more vertices.

Share this post


Link to post
Share on other sites
Impossible    134
This is a pretty game specific question... Assuming your game is 3D with skinned characters, one way to do it is to have separate limb meshes (just a leg, just an arm, just a head, etc.) When a limb is severed, scale the root of the limb by 0, making it disappear on the main mesh, and then draw the detached version in it's place. The detached version can be moved anyway you'd like, for the best effect it would be a ragdoll, but it could use a canned animation also. It'd also be a good idea to have some blood spray from the wound (particle system.)

There are of course a million other ways you could do this. You could simply have static meshes for each possible lost limb, for example.

Share this post


Link to post
Share on other sites
a3a2004    121
What about getting cut in any place and having the two halves slide off of each other? This couldn't be done with that method.

Share this post


Link to post
Share on other sites
Jiia    592
I think you would have to get very detailed to accomplish that. As in modeling as many possible splice types and having an inside for each one. Then just picking the closest match when a cut happens. You have to split at vertices, so I think it would be impossible to make it perfect. Edges of polygons run one way or the other. I don't see how you could make a diagnal-left slice AND a right. Not unless you used diamond shaped quads in your model, but then you can't do straight splits.

It could easily become a complicated mess :)

Share this post


Link to post
Share on other sites
jorgander    180
yah it would be a mess to support 'dynamic seperation'. splitting mesh triangles by a plane is simple enough in theory, but u wouldn't be able to pre-compute any of the interpolated texture and normal coordinates for the split triangles. it would take quite a while to do real-time.

also, if u have other engine elements such as skeletal animation it would be a nightmare to dynamically choose with bones to assign new triangles to (or point weighting for soft skinning).

Share this post


Link to post
Share on other sites
a3a2004    121
thought of a possibility: detect the entry and departure points of the cutting object, then calculate the nearest point with one of the coordinates an integer(x,y,or x) for each. Then use a few more of these semi-integral points and add one more in the middle, then connect them like this

0
0 - 0
- -0
0 i
0 0

and so on, just making triangles with those points and the center, animation is a moot point because the guy will be dead, with limbs I can use one of the mentioned methods


Share this post


Link to post
Share on other sites
Jiia    592
A plane slice would not be that bad. But unless you don't care about detail, the inside "guts" will be a nightmare. You could just simply generate polys over the holes and slap an "organ" texture on it, but it would probably be difficult to make it look decent. Or, slack off detail and just paint it red / black.

Unfortunately, my zombies can still animate after they get torn up. I was thinking of just making about 2-3 splice points on each arm / leg, and have "guts" props standing by. When a peice gets torn, just lock a gut prop to the bone that should control it, and avoid rendering the material id of the sliced off section afterwards. It may be possible to make a quick mesh-copy of the material to allow it to bounce around the room, or I could just model seperate limbs.

Fortunately, I'm not going "Return of the Living Dead" on it, and I don't have to worry about arms trying to come after the player :)

Share this post


Link to post
Share on other sites
a3a2004    121
sort of want it to look like kill bill, was just planning to slap a texture on it and do a good job with the particle system

game will be a sword based game, so all cuts will pretty much be plane cuts

Share this post


Link to post
Share on other sites
amedlock    100
Have you played Blade of Darkness? Its like 5-10 bux at most stores now and is a vastly underrated game of this type. It has the features you mention, though I think the cut points were pre-set.

Highly recommended game though. And remember, the Knight w/ elven sword is best.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this