Game Development Community

Is this type of "mounting" possible with TGE/TSE at all?

by Stefan Lundmark · in Torque Game Engine · 09/09/2004 (12:20 pm) · 5 replies

Lets say you have a basic mesh of a character. You want to equip this character with armour, clothes, a pair of shoes, whatever.

1. You make one DTS for the basic body. Then you create a DTS with shoes on, one with shoes AND helm, one with only helm - etc. The problem I see here is that the number of DTSs will go insanely high, and its just not practical.

2. You mount the helm on a mountpoint, for instance. I can see how this works for backpacks, helms, maybe shoes.. but not armor or sleeves. Why do I say that? Because sleeves need to bend with the arm when it moves, and same with armor. Helm does not, because the head doesnt usually bend like that.

3. You create a basic body divided into different meshes. When you equip, say a helmet, you hide the head and put the helmet there. Only thing is that I dont quite understand how this would be possible :/ And it still comes down to alot of combinations.

Am I correct in these assumptions? Will normal mounting (nr. 2)work or will the armour go through the body when the character bows, for instance?

Any insight is appreciated.

#1
09/09/2004 (12:26 pm)
I think it might be able to work with a few adjustments. I think instead of putting all new armor pieces on you could instead change the texture map and then mount small pieces onto different parts of the mesh. Another option is to just use a segmented mesh which would make it easier to sub pieces in and out for. Number 2 could probably work. It would take lots of mount nodes and pieces of armor though.
#2
09/09/2004 (12:48 pm)
The segmented mesh is a good option, and would look good for everything except like a "wool cloak" or something.

Otherwise, you could create all meshes in the _same_ dts, and hide the ones that are not equipped. So if cloth armor is equipped, you show that, but hide the "metal armor" and "chest plate" types. This would only need to be done for things that don't work well with the current mounting system, like torso armor and leg armor. There are resources (or at least forum threads) on how to hide nodes in a DTS object in code, so I won't discuss it here.

Changing the skin for different armors within the same class (i.e. "red cloth armor" and "blue cloth armor") would reduce the number of actual models you would have to make. Changing the texture on an object at runtime is probably not trivial, and would require a bit of creativity, but I don't think it would be too incredibly hard. I do know that there are "render to texture" functions available.
#3
09/09/2004 (1:00 pm)
@Greg Hoffman
Nice suggestion about attaching small pieces.

I wonder how other games do it..

Unfortunately I don't know a way to hide/show segmented meshes based on scripts called in TGE, so this leads me back to mountpoints again.

@John "Cycletronic" Atherton
Oh, but I thought you could change textures already via script, for damage meshes etc etc. I'm pretty sure of this, can anyone confirm or deny?

I think making all the meshes in one DTS would slow it down ALOT.
Or is the mesh not rendered when it's invisible?
#4
09/09/2004 (2:00 pm)
Keep in mind that by creating all meshes, I mean just the base armor classes meshes. The whole character remains the same, but you create a new node for each armor class (attached to the torso or wherever). So you have a cloth base (which would be good for rags, chainmail, leather, etc.), thicker armor (for plate armor, etc.), even thicker armor. Are you planning on making 100 different armor models? That would probably be slow any way you do it. I know when nodes are hidden they do not show up, but whether or not they are transformed (to render) I don't know. You're asking to do something that is somewhat complex... so you might not be able to do this without losing some fps.

Another way to do it would be to change the texture on the sleeves, and just mount the armor as usual.

As far as changing the texture... if it's all in one DTS the damage mesh skin change might not work. (unless you made a skin for each armor configuration) Again, I'm not sure, you'd have to try or ask someone else who's already tried.
#5
09/09/2004 (2:06 pm)
Thanks guys for the help, I actually found a resource that did exactly what I wanted.

It can be found here for anyone that has run into the same thing and wants to try a solution.