Game Development Community

Customizing t2dShape3D instances

by Jeremy Swigart · in Torque Game Builder · 02/22/2006 (7:50 pm) · 8 replies

Suppose one is making an RPG game using primarily the t2dShape3D for the characters. Currently it doesn't appear mounts are exposed so that you can attach objects to the shape3d. Would this be a relatively easy thing to add support for in t2dShape3D?

Secondly, I want the user to be able to do some limited customization of their character. I'd like to give them the ability to customize a few colors of the characters skin, hair, clothes. I like to think this could be done by blending a few colored texture layers with alpha everywhere except where they should color. This would seem to require essentially like 4 texture layers per character. Is there a better way to do this in Torque that I could expose to t2d? Any recommendations as to doing stuff like this?

Thanks in advance.

Jeremy

#1
02/23/2006 (5:29 pm)
Would this and my ground transform question be better off asked in the TGE forum? I never seem to get much response from questions about Shape3d.
#2
02/23/2006 (5:34 pm)
Since you have both TGE and TGB, you can certainly play around with combining TSShape and how it may interact with your customized TGB layer, but t2Shape3D doesn't do much more than render a 3D shape loaded from dts.

Regarding where to ask, yes the question would probably get more answers (since TGE is completely 3D based), but none of the answers would apply to TGB...TGB doesn't implement TSShape, it simply allows you to render 3-D models loaded from the dts file format.
#3
02/23/2006 (6:00 pm)
Hmm, I'm confused.

t2Shape3D contains a TSShapeInstance*, which in turn holds a pointer to a TSShape *

It doesn't look that different from the TGE version of tsShape.h and tsShapeInstance.h

There's only limit functionality exposed to script, but it appears to be largely the same in terms of the underlying shape.

It appears to me that were I to expose more functionality I could do much of these things that I'm wanting to do. Is that not the case?
#4
02/24/2006 (7:41 am)
Disclaimer: I haven't studied in depth exactly what was ported over to TGB.

Answer: TGE TSShapes are much more involved than just the TsShape.h and TsShapeInstance.h...in fact, the entire "ts" subdirectory in TGE is related to handling all the various things that can be done with TSShapes. In addition, GameBase and ShapeBase, as well as Player/Vehicle/Item all implement functionality that gives TSShape their flexibility and capabilities, and none of these as far as I am aware are ported over to T2D.

For example, one of your questions was mounting. The base mounting functionality is implemented in ShapeBase using root level methods in TSShape, and I know this wasn't ported.

The ground transform concept that you mentioned as well in TGE is based on collisions with the terrain object to properly select a speed for movement sequences timed to look "proper" based on the actual 3D velocity the player object is moving across the terrain. This is done based on structures and code in Player.cc/h, and also wasn't ported (specifically ::pickActionAnimation, as well as the PlayerData::ActionAnimationDef table defined in player.cc).

What you want to do certainly can be done, but it's a more involved merge of TGE functionality into TGB than was intended by the base t2dShape3D, and will require work on your part to identify and abstract the functionality you specifically want, figure out where it's implemented in TGE, and port it to your own project.
#5
02/24/2006 (8:14 am)
Thanks for the info. Perhaps our project would be better off as a top down TGE or TSE game. Between networking and character stuff it sounds to be the more mature option at this point.
#6
02/24/2006 (8:17 am)
Quote:customize a few colors of the characters skin, hair, clothes.

Last tiem I read the doc I saw support for skin swapping. That might help you achieve what youre looking for.
#7
02/24/2006 (8:31 am)
@Jeremy: I'd use the term "appropriate" instead of "mature". TGB is a 2d based game, and 3D shapes are there more as a very minor additional capability, not a core functionality like you seem to be looking for.
#8
02/24/2006 (12:36 pm)
Yes you're right. Bad choice of words. TGB is very awesome. When I saw the support for 3d shapes it seemed logical to use them rather than sprites, considering our artists were planning on doing the art in 3d anyways. The more that matured and questions I asked the more I was straying away from the intention of TGB. Appreciate the help. Probably going to switch to TGE or TSE and do some more appropriate stuff with TGB.