Game Development Community

From finished model to torque

by Robert Fritzen · in Artist Corner · 05/22/2013 (8:17 am) · 39 replies

So I've finally decided to give Blender 2.65 a run, and I must say, after learning the crucial keybinds, I'm very impressed at what it can do. I now have a few questions I'd really love to have answered by the artists out there with this experience.

So, lets say I have this model: http://staff.phantomdev.net/phantom139/images/m1911Final.jpg

1) How would I make the representative fire, reload, ect. animations, and make them compatible with torque?

2) Is there any easy way to bake multiple textures into the gun, IE: Weapon Skins that can be set via a torque command.

3) How to you export the model correctly in the DAE format for T3D MIT?

That's all I've got for now,my end game goal is to combine all of this into some form of resource/tutorial for everyone out there to use for a start to finish making a gun in blender, not to mention getting my own modeling good to go for my own projects.

All help would be greatly appreciated, thanks alot!
Page «Previous 1 2
#1
05/22/2013 (9:48 am)
This looks not finished... ;)
Ok I cannot tell you how to animate it, because for this you would need a rigged character and since the import/export of characters animations is somehow broken in blender, you would have to start from the very beginning and make your own character, rig him, animate him, import him and if you are done with that, the gun will be most likely not the big problem anymore.
Otherwise if you really plan to do a good quality fully functional weapon there is a lot more to do than you have now, at the moment you have a horrible mesh without textures of an anatomically incorrect gun, I do not want to demotivate you, for the beginning this is very good, but that's the way it is.

A good quality gun would look like this:
Proper Mesh of not too much polygons, maybe a poly count of 5000 at highest lod, then somethign like 2500, 1200, 600
Proper textured with an UV-map of 1024x1024, with normal and specular maps.
You would need the gun and a magazine, a bullet and the shell of the bullet. The gun needs a slider which can move back and an ejection chamber with a working trigger and the hammer on the back that launces the bullet, all things need to be rigged or movable so you can animate them.
You would need an animate muzzle flash attached to the gun.
Then you would have to set the Torque nodes, you need a mountpoint for where the bullets and the smoke comes out, one for the ejected shells and one for the retraction and one where the gun is mounted on the player.
And maybe a collision box.
After that you may be ready to properly animate and implement the gun into the game, but I did not reach this point yet.

But otherwise you can just replace the default gun with a similar static mesh and use the default animations, not authentic, but sometimes it works amazingly well.
#2
05/22/2013 (11:56 am)
1)
import a T3D .DAE Weapon
this way you can look up how the hirachy should look

now it is true u can not simply take and exchange the weapons in Blender
(well you can but it looks jerky)

what you can do is to animate your GunModel to the Handmodel of the Soldier/ Create new animations

there a dozenn of tutorials howto animate/ rigg in blender

the important part for Torque3D/ .dae models
is to bake the animations into the mesh( your GunModel)

Change the Window in Blender to Dopesheet
in the Dopesheet editor set it to Action
and select the action you wish to bake or just select all by pressing/unpressing A

now to bake Animations into your mesh press spacebar and type in - Bake Action

this way you are baking the animations into Mesh/ this is a must do step!

2)
multiple textures? If u mean already defining materials in Blender itself, yes u can do that
lets assume your exported model is a Gun
and portion of the Gun has a 2nd Material/uvmap
u can export it wih multiple materials

but if you mean defininf switchable materials in blender itself the no,
u are defining textures in T3D itself and by material.cs files
in Blender for export u just need 1material as without a material u can not export/ u can but it makes it harder lateron to setup a material for the model.

lets take a look
new Material(football_ball)
{
	baseTex[0] = "football";
	bumpTex[0] = "footballN";
	pixelSpecular[0] = true;
	specular[0] = "0.3 0.3 0.3 0.3";
	specularPower[0] = 5;
};

new Material(football_ball)
{
	baseTex[1] = "redfootball";
	bumpTex[0] = "footballN";
	pixelSpecular[0] = true;
	specular[0] = "0.3 0.3 0.3 0.3";
	specularPower[0] = 5;
};

as you can see baseTex reffers to the Diffuse Channel
an you can create upto 9 skins for a object with different Diffuse and Normal Map(bumpTex) Textures if u wish todo so
and there are even more Map types

but tbh am not quiet sure how you would want to switch those on a Gun/ am sure there are some hints in the player itself as its switching the skins all the time


Now i know its no real tutorial but should at least give you a start in the right direction

another way to get what you want is to just purchase Bryces TAIK ;)
as he has said yes to the wish regarding packaging up the source art aswell
this way you would have perfect Blender templates that actually work in T3D and Blender along with being able to export and import it into T3D directly.
(am currently waitin (un)patiently for the upcoming TAIK release that is supposed to have the source art included aswell)
However i do know howto get animated models into T3D - but Taik has it all set up so i wait to export my stuff over the Taik templates.
This way i can be sure that the endresult is what its supposed to be.
#3
05/22/2013 (4:45 pm)
Ok, so essentially, I should be starting by making a player model for my game, which I was eventually going to have to do anyways.

As for the materials, as long as I can control through torque script or C++ what texture appears on the gun I should be fine for my purposes, I'm good enough at the coding to figure out how to get it going once I know what functions I need.

I think what I was looking for was a sort of tutorial on the different nodes torque needs and how to define them in blender to get the gun properly working in game. I guess I'll be able to start once I get the player model situation worked out.
#4
05/22/2013 (5:38 pm)
I would take something finished so you can concentrate on what you actually want to do. There are some high quality free models around, so you can pick up a weapon and a model and try to get it working. Or you could use the makehuman software, you can generate an anatomical perfect human there, export it and start animating.
#5
05/28/2013 (8:55 am)
I'll start with makehuman for now, If there are any resources or tutorials for proper animating, texturing, ect. That would be a lot of help.

From there, I'll see what I can do with weapon models that already exist, maybe they'll provide some pointers as to how to set it up. I'll ask questions if anything comes up that I can't figure out myself.
#6
05/28/2013 (1:24 pm)
I did some tutorials, but later realized that they were not directly useful for using with Torque. With Torque you are a little left alone in some places and have to figure it out yourself.
I would also be thankful for any tutorials about importing characters and weapons with animations into Torque.
#7
05/28/2013 (2:08 pm)
You should be able to change the mesh through torque script in your own little function. Just think it through and you should be fine. I find that trying to work off other peoples larger codes can get confusing locating and understanding certain functions or unknown variables.
Just write a function to change the attached materials and see if it works.
As a side note, imo modeling is like writing. Try to avoid unnecessary details. I found that small details can complicate things and are only worthy if you're willing to go through the effort of dealing with them. For example, I made a holster on my biohazard character and decided that fine tuning on it wasn't unnecessary as long as the player could see what it was. Everything else was just in the detail of the attached material. You'd be surprised how well you can do with so little with the right art.
#8
06/08/2013 (1:58 pm)
Ok, so I'm seeing alot about nodes, torque points, mountpoints, ect.

Can you give me a general list of necessary ones for players and weapons and how to properly set up the "hierarchy" for these?

Other than that, I appear to be on good track, hopefully able to get something working soon.
#9
06/08/2013 (2:34 pm)
regarding the playermodel(s)

docs.garagegames.com/torque-3d/reference/classTSShapeConstructor.html

you will find most important
function MyShapeDts::onLoad( %this )
{
   %this.addCollisionDetail( -1, "box", "bounds" );
}
// This way you are adding the bounding box to your Playermodel
// so far i haven`t found a better way to add a boundingbox to the player.
// MyShapeDts can be either your dts model or u can use a collada model exported from blender u just have to change MyShapeDts into MyShapeDAE
about the playermodel hierachy
just take a look at the soldier model
that should give u a good idea whats needed
and u have the choice to use
either emptys or bones
for the important nodes
such as cam and Eye

regarding the other stuff
just get some of Duions free models
they are available as .blend files aswell
and there you can quick test and reparent stuff
opengameart.org/content/konserian-highlands-set


now lets assume u export your model as a single collada file that contains all your animations
singleton TSShapeConstructor( PlayerModelDts )
{
   baseShape = "~/art/shapes/collada/myPlayer.dae";
};

function PlayerModelDts::onLoad( %this )
{
   // Split animations from combined "ambient" sequence
   %this.addSequence( "ambient", "root", 0, 15 );
   %this.addSequence( "ambient", "run", 16, 40 );
   %this.addSequence( "ambient", "back", 41, 55 );
   %this.addSequence( "ambient", "side", 56, 70 );
   %this.addSequence( "ambient", "death0", 80, 120 );

   // Remove combined "ambient" sequence => we don't need it anymore
   %this.removeSequence( "ambient" );
}
// what u see here is a way to split the animations with the usage of the .cfg file.
// this way you do not have to manually split it in the shape editor u can just write your cfg and when u load your model into T3D you get it generated by T3D

and there is a way to add nodes afterwards
%this.addNode( "mount5", "Bip L Hand" );         // add a new node
// this way you could for example add a extra mountpoint or
%this.removeNode( "Nose" );
// you could remove unused Nodes
#10
06/10/2013 (4:47 pm)
Just going back to something I caught earlier, you said I can create up to 9 skins for an item. Say I want to make more, would this be an engine modification I'd be looking at?

Also, for the texturing of my models. How would I exactly do this, I've seen some video tutorials that use the Smart UV Unwrap feature (edit mode, then u) that is baked, edited in photoshop and reapplied. Question here I guess is how do I apply the UV Unwrap? I know how to add materials to the model, but not how to interface the blank material to the individual UV's.

My other question is now into animations. I know the basic keybinds for them, and I've seen Mike's Tutorials on adding animations. I followed it, but when I imported a test object, there were no animations on the object. I'm using the newest version of blender, so I'm not sure what's up.

Hopefully I can get enough information here to work with and get something working in my game, and from there, do my own video tutorials for the community. ;)
#11
06/10/2013 (5:07 pm)
didnt wanted to spoil but hell why not
am in teh process of finishin up a puppet system for T3D
its goin to be a simple mannequinn puppet
with animations along with that the blend file will be supplied
and within time it will evolve

its a 3 Stages System i plan todo
and Stage one will be the puppet with basic animations
and howto
tutorials will follow within time

and no unlike what some might think
this is goin to be cc0 licensed therefore for free
so u might just want to get familiar with blender and lean back regarding your playermodel(s)
gonna happen sooner or later ;)

i.imgur.com/dD4r0hB.pngye its alive
nah dont comment was just a test to see if my mounts sit right
#12
06/11/2013 (5:04 am)
figured i would show it in blender aswell so you and others don`t get the feelin that am just playin with yaa

i.imgur.com/ybiPwPL.png
regarding the armature
it will receive a facerig aswell however
i do not plan any facial animations for stage 1
stay tuned
blog and update gonna follow in the next days/week
#13
06/11/2013 (9:05 am)
So for example here, would this be better for a third person weapon mesh?

http://staff.phantomdev.net/phantom139/images/AK47_TP.png

If so, let's turn back to my previous post, what do I do from here. Say I already have my player model (I don't, but lets say I did), what would I need to do from here?

And then I'd need to also know from my questions in #10, the proper texturing methods, IE: how to do it correctly in T3D.
#14
06/11/2013 (10:50 am)
Awesome model :D

The most simple way of modeling is to set a reference picture of the gun as background and after you are done project the texture on it.

At least this was the way I did it in my first try modeling a weapon.
The result was this: opengameart.org/content/stg44
Maybe you get it and look at it, so you roughly get an idea how its done also 1 Lod and nodes are already set up, you can switch it with the lurker and it should work.

#15
06/11/2013 (11:22 am)
Just a few more weapon questions.

I notice the texture already appears on your blender example, but there are other cases where leaving a blank material on the gun and then setting it via TorqueScript works. How exactly does one texture a gun so it works in T3D, I have no idea how to generate the different maps (normal, diffuse, specular) of the gun, or what they even mean for that case. How to properly do it so my gun appears correctly once in the engine is my question, and then back to #10, it was said that you can only have 9 different skins. Let's say I want to make lots of different weapon "camos" for my guns, is there any way past this 9 limit, or will I need to modify the engine to do so?

When you say 1 Lod done, how many LOD's are actually needed? I would think you would only need 2, one for the first person, and one for the third. Are more needed? if so, how do you differentiate from the LOD's in the game itself?

Lastly, I looked around and saw that there are a lot of files relating the PlayerAnim_ ect. in the generic guns and the guns in the art packs provided by GG. There are a lot of files referenced here. What are each of these for, and how do I make them for my own weapons, so they work properly?
#16
06/11/2013 (12:35 pm)
@Duion
it is not about looking pretty
its about beign useful
and a mannequinn like model is the most logical approach for my stage 1

@Robert
www.blendswap.com/category/weapons

blendswap has a vast library of models
where u just might find some for your project

just look for cc0 licensed stuff
now the good thing here is that
u can
a) see how those models look from the sturcture/ polycountwise
b) find some useful ones aswell

and well u do seem a bit to ambitious
i mean i read stuff like different weapon skins
lod stages and so on and on
start small padawan
especially since we have no real blender to t3d turoials yet
however they gonna come
in the meantime i would really advice you to get familiar with blender
therefore
www.youtube.com/user/RivenPhoenix/videos
this guy is not only covering blender but is gettin mroe in depth when it comes to animations and other stuff
usually u would have to pay for a course of this range
believe me its worht to sit down and watch those videos
#17
06/11/2013 (12:44 pm)
You seem to be really new to modeling...
So you have to go the painful way and read/watch tutorials relating the different steps.
You have to apply the texture in blender, cause you need to see what you do, you cannot texture in Torque, you can just change materials, that will work if the UV-layout is compatible.
LOD's are just to save additional polygons, in my case probably not needed, because my model is almost as low as possible, but modern models have a lot of polygons and LOD's are essential for that.
#18
06/11/2013 (12:50 pm)
@Duion: Yeah, that's all I needed to know there, so you apply the UV in blender and texture it like you would any other model. From there, you would just add the necessary mount points to the model, export it, and test it. Obviously the first person model would require much more work as you'd need to do the rigging and animating alongside the other stuff.

@J0linar: Having a lot of free time makes you ambitious to get something working, lol. ;)

I'll keep working on this, Hopefully I can get something working. When I do, it'll be off to my video recording software and the world of tutorial making, lol.
#19
06/11/2013 (1:41 pm)
You do not need animation, it pretty much fits with the lurker animations, since it is a rifle also, just adapt it a little in the shape editor, since it is a little smaller, for first person, you can take the same model also and you have a provisional solution.

#20
06/11/2013 (1:50 pm)
Alright, I'll give that a run and see what happens. But, eventually I'm going to want to do so, are all of those DAE files in those folders just the same model with a different animation?

That seems kind of redundant and a waste of file space, you could just bake ALL of the animations into the file. Or am I thinking entirely wrong here and it's something much different?
Page «Previous 1 2