Game Development Community

Questions: Meshes and Materials, Modelling

by Timothy Volpe · in Torque Game Engine Advanced · 04/19/2010 (12:04 pm) · 8 replies

I have some questions and an issue with modelling that I haven't been able to figure out.

Question 1:

The first is Collision Meshes. I know how to add a bounding box, but I want an advanced col. mesh, because my shape isn't square. I want the col. mesh to be as excact as the shape as possible, the same shape as the model itself. There is a picture of the model below. I've seen people making col. meshes, and it looks like they just make another model, and make it the mesh. I am using MS3D, and I've seen people make collison meshes in MS3D-or atleast thats what I think they were doing. So, if its true they were making a col. mesh, how do I do it in MS3D. If its not true, how do I do it?

Question 2:

My second question is about materials. For my shape, (its a street light so you know) I want it to have unique materials, or skins as I call them, so that they are not all the same. By this I mean, like some with different colouring, some with like posters on them, ect. But, how do I make the material all in one PNG file, and the shape be able to switch around the skins. Would it be possible to have the skin be determined by a Dynamic Field in the Mission editor called "skin" and its a number value to pick like "lightPost_1.png, lightPost_2.ping, ect." So when the shape is spawned it will have that PNG on it? If there were no field, it would default to 1. It may be a little confusing the way I explained it, so if you have questiosn on my question, I will gladly answer them. A while back I worked with the Valve Source Engine, and skins came out like this:

i887.photobucket.com/albums/ac71/WillSmith_BL/ammocrate_grenade.png
That is how I would want my skin to turn out, to save space, and time, but what program would be able to generate this? My model was originally made in Autodesk Softimage, then I ported it to MS3D. Is there any program anyone knows of I can use the create a skin like this? I have photoshop, but it seems impossible to get it right.

Issue 1 [SOLVED]:

Solution: Opps I forgot to assign textures to the model.

I have 1 issue. Its with my model, when I spawn it, its all messed up. The picture below should tell you everything I mean.

i887.photobucket.com/albums/ac71/WillSmith_BL/peekarica_045-00001.png
Whats causing this issue? There are no console errors.

Issue 2:

When I make my model and bring it into the game, the model is just gray. The textures are in the same folder as the model, and have the same name. Theres nothing in the console. Why does this happen?

#1
04/20/2010 (6:25 pm)
For the first problem with better collision. Use polysoup. It's part of TGEA and works like a charm. As for making multiple collision meshes in MS3D I can't say since I do not use that and have very limited use with it.

For the material problem on your model. Make a material.cs file and do something like
new Material(streetlight)
{
   baseTex[0] = "streetlighttexture";
   translucent = false;
};
#2
04/21/2010 (9:02 am)
Okay, thanks. I'm on my laptop now, but I'll try that as soon as I get on my computer.

EDIT:

Okay, I just found Polysoup, so I'll try it out. Again, thanks!
#3
04/21/2010 (11:38 am)
collision meshes are pretty simple once you get the hang of it, and are pretty handy in comparison to polysoup particularly if you dont need fine resolution collisions, for example, a simple cylinder collision mesh around the pole of your lamppost is probably enough just to make players bounce off it, and you could pretty much make a 6-12 poly collision mesh vs a 200 poly lamppost.

Ive heard some horror stories about polysoup but tbh they all seem to be from a long time ago when both the engines were less polished and the technology wasnt anywhere near what we have today. I use a various methods, for simple objects i create collision meshes, i can honestly say ive never delved into the Torque code for collisions, however, planes and spheres are very simple objects as far as collisions are concerned, 6 sided rectangle and spheres for collision meshes should drive down computing requirements, tho your milage will vary depending on all kinds of factors.

I read somewhere that theers a limit of 9 collision meshes per model/object whether this still holds true for TGEA/T3D ive no idea, but you can cover quite a bit of ground with 9 primatives.

is that the farcry weapon crate texture btw i'm sure i remember it from somewhere but my memory is horrid at times, especially when it has to go a long way back :)
#4
04/21/2010 (12:45 pm)
As for the collision meshes, Polysoup did have several problems back in the day. I remember it causing torque to crash or bog up. But they have long since then improved the code it seems since I never had any problems using it. It's helpful when you want to quickly drop something in that's more complicated then a simple bounds and have detailed hitTests. But if you have something simple like a weapon crate or a lamppost then creating a simple box or cylinder as a bounding box is the easiest and most common practice to use as BloodKnight said.

Btw, I think it's from half life 2. I know I swear I saw a texture just like it too at some point. lol
#5
04/21/2010 (4:40 pm)
Polysoup: Okay, I'm a little confused... I'm not to sure how to install it, and really how it works. The installtion directions are weird, I can't understand them. Also, this is not for my game, its for a freinds that I'm working with. By what I read, it means to put them in my Torque/TGEA_1_8_1 file? Well, I can't edit my friends, so is there another way to make a collision mesh without engine modifications?

The box is from Half-Life 2, I'm using it as an example to show what I would want my texture to look like to reduce the space multiple txtures would take up. I've gotten that texture to work on the HL2 box model (converted into a DTS) in an Add-On for a TGE game. I ported it, but I won't get into that. I used to make Lua scripts and work with props in Valve Source, thats where I got the 1 PNG texture idea.

As for my shape, its like a highway lamp, it has a pole, then curves over. It looks like this:

www.westernpower.com.au/interface/images/theNetwork/assets/streetLight.jpg
#6
04/21/2010 (6:43 pm)
tgea has polysoup built in. Look in the scene inspector for your object and you will find a checkbox for it.
For a collision mesh for that lamp, all you need is a simple cylendar that's slightly larger than the pole named Collision-1
#7
04/21/2010 (8:29 pm)
as far as making a single texture to cover different meshes, its a relatively simple thing for simple shapes. and as it happens....

www.torquepowered.com/community/forums/viewthread/83861

a handy dandy video resource.


#8
04/28/2010 (3:09 pm)
Mike Rowley: Yes, I did notice something about that while reading a Torque Script tutorial earlier today, I wasn't %100 sure how to use it though. I will use that, thanks.

Bloodknight: Ok, I'll check it out, thanks to you, too.