Dynamic debris shape?
by Daniel Buckmaster · in Torque Game Engine · 04/18/2008 (11:21 pm) · 0 replies
I couldn't think of a very good title for this thread, sorry. My idea is basically this.
For my current project, I've set up severable limbs with the mesh hiding and hitbox resources. It all works nicely - you can shoot a character's shoulder and their arm disappears. But that's just the problem - it disappears.
The easiest solution is to create a Debris object with the same shape as the arm, spawn it at the shoulder, and make it fly away. That would be a perfect solution. However, that's not a very eficient solution for my game. I'm using the mesh hiding resource for creating individual characters, as well as severable limbs. So each character may have three different sets of arms of a different type - the Debris would need to be of the right type.
I got thinking that it might be posible to create a Debris object with a dynamically created shape, not one defined by a DTS shape file. So when a character's arm is shot off, the engine takes the MeshObjectInstance that represented the arm, and creates a new TSShapeInstance with that mesh. Then it creates a new Debris object with that shape.
Would this work? I haven't delved too deeply into the workings of the resource manager and TSShape stuff, but it seems like it could. Is it efficient? I'd imagine synching with clients could pose a problem.
For my current project, I've set up severable limbs with the mesh hiding and hitbox resources. It all works nicely - you can shoot a character's shoulder and their arm disappears. But that's just the problem - it disappears.
The easiest solution is to create a Debris object with the same shape as the arm, spawn it at the shoulder, and make it fly away. That would be a perfect solution. However, that's not a very eficient solution for my game. I'm using the mesh hiding resource for creating individual characters, as well as severable limbs. So each character may have three different sets of arms of a different type - the Debris would need to be of the right type.
I got thinking that it might be posible to create a Debris object with a dynamically created shape, not one defined by a DTS shape file. So when a character's arm is shot off, the engine takes the MeshObjectInstance that represented the arm, and creates a new TSShapeInstance with that mesh. Then it creates a new Debris object with that shape.
Would this work? I haven't delved too deeply into the workings of the resource manager and TSShape stuff, but it seems like it could. Is it efficient? I'd imagine synching with clients could pose a problem.
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!