Game Development Community

Exporting a player

by Stephen · in Artist Corner · 07/20/2005 (10:10 am) · 18 replies

I have been searching the forum for any good tutorials on how to export a player model that will use dsq animations. I made a player model that is ready to exported, I have the textured, rigged it but I don't know how to export the model that it will use the dsq animations in the player that the orc model uses.

Any help would be nice,
Thanks

#1
07/20/2005 (10:24 am)
Well... This book teaches you how to do it.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5638
#2
07/20/2005 (1:46 pm)
I have the book and I looked at the Animation part and it shows you how to make the animations on the timeline. What I would like to do is use the already made dsq that the default orc model uses, so that I don't have to animation the model myself.

Thanks
#3
07/20/2005 (2:24 pm)
Okay, that's somewhat 'easy' to accomplish. Pull up a chair and I'll try to get you to the point you stated above. I've outlined this a few times in other posts, and I'll continue:

1. If you want to create a 'player', in Milkshape3D, that the default SDK sequences will load into[and for creating/loading 'custom' ones+SDK too!] you must use the rig that accompany's Chris Robertson's DTSPlus! exporter/Resource; bottom line. If some developer out there has another rig that will do the same, they should post their results, it may help the rest of the Community utilzing these tools.

2. After using the example rig in the documentation[I have another produced rig that has all 8 default mountpoints included and loadable of all sequences,;), and my customs, this is what 'cha shootin' fer, right?] to produce a player.dts shape. Animate this rig to produce additional .dsq's your custom 'default' player need for code. Throw ole 'Fluffy' in the Recycle bin, he's done. Same for 'BlueGuy' and 'FPS.StarterGuy'. Lol....you got your new 'default' out of MS3D!!! Aren't you clever, with a $25 3d modeling program?! And, the other 3 will NOT load these 'new' sequences[well, they will but it will be 'yet another' tragic teleporter accident{Rest in Peace, Scottie}], only the rig exported thru Milkshape3d with the rig/exporter, bottom line. Besides, you don't want ole 'Fluffy' doing custom stuf, do ya??

3. The big caveat/headache utililizing this method to have the defaults load, is that you must rig to the 'root' pose inside Milkshape3D. With no vertex weighting, this will necessitate very careful modelling, or segmenting the mesh to Assign verts then Regrouping them to be ONE single mesh[otherwise no dsq will load into a 'rigid' shape, I think..., must be a 'skinned mesh']. There are, of course, various methods around rigging to the 'root' pose in the Scene Root. One method involves a complicated series of steps to get the DTSPlus! rig in a state where it can be 'skinned'[Ms3d:AssigningVerts], and then reposed to the 'root' look to 'bend' the mesh to the the 'root' rig pose, then export the object as an .OBJ type file. This 'freezes' the mesh in the current pose. When imported , you get a 'posed' mesh. NB: Be careful when importing this .OBJ; otherwise, you'll end up with two meshes named the same! ReAssign the verts, proceed....;). It's long, gets ugly sometimes, but works. The easier method is to segment the mesh and do the above.


Wheeew! Hope that all made some sense.
Rex

...hope this was more of what you were looking for, Stephen. :), There are a lot of those type of 'answers' found on the site.....the 'linky' ones.
#4
07/20/2005 (2:49 pm)
That helps a little. So basicly what I do is use the default rig that comes with the exporter. Then I assign the mesh to the rig then I can export it?

Thanks
#5
07/20/2005 (2:56 pm)
Yep. Rinse, repeat.
#6
07/20/2005 (3:09 pm)
Okay cool, but is there anything I need to do in the export? Like one of the options?
#7
07/20/2005 (5:43 pm)
Yeeeesssss......lots. You need to specify proper Scale, wether or not animations are needed to be present, lots of stuf covered in the basic Art documents, ;).......ya gotta help yersef a bit my friend. Perhaps read a bit more before posting for help. Answering endless FAQ questions...eh. Good luck!
#8
07/20/2005 (8:28 pm)
Okay, I made a quick model to go with the default rig. Here's a picture in Milkshape on what the model looks like.

tek0.net/torque/model.jpg
Now here's what it looks like in-game.

tek0.net/torque/weird.jpg
The weapon moves with the model it seems like, but I'm not sure on whats going on and why the rest of the model doesn't show up.

Rex, thanks for the information!

Thanks,
#9
07/20/2005 (8:49 pm)
Hmm....is the playerDataBlock set to render in first person??? A good place to start. He's throwing a shadow, though! Might be the appending detail numbers on the mesh[example=MrBox0]. The Group name of MrBox has a Zero appended to it to render the geometry when '0' pixels screen height. A zero would render the geometry from infinity to nearest. The appending # is code for render@screen pixel height.this. Or something similar...;). If your appending detail number for example this MrBox is high, at any 'great' distance from the Cam/Eye, and it winks out....what is your detail #??

Remember to load the defaults, your mesh needs to be a skinned mesh. All the segments as ONE single group, or take at least one vert per segment and assign it another bone. Makes for some weird stretching...but gets you going developing. Good luck! Looks like you're on your way....:). Great quick work.


...or I wonder if you created a single face[one per group/segment] in a hidden place and regrouped it with each 'parent' segment and then assigned the vertices of this remote portion of the group would be good enough to work?? Never tried that, but might help anyone needing a segmented shape that will load the defaults, the MrBox proves segment will load.:), and get you multiple textures!!! Hey, there's an idea, glad it popped in...remote groups!
#10
07/20/2005 (8:59 pm)
My guess would be that you incorrectly named your mesh objects. They should all have a trailing number like "head2" and "arm2".
#11
07/20/2005 (9:01 pm)
With the regrouping issue....and loading defaults...there should be just one group or use my tricky methods to fake grouping out....but yes, I agree, with no rendering geometry, detail levels are off. I see the shadow, the shapes are there, just not rendering...is that little flat rectangle a Left hand?? or part of the weapon???
#12
07/20/2005 (9:18 pm)
Quick question, can you move the joints from the example skeleton? or would that mess up the default dsqs? For example, the skeletons shoulders are too broad for my model, can i move them in without messing up the default dsq animations?


Edit, did a test, I think I came up with the answer, NO! When i moved the shoulders in just a pinch, mr box looked like a terrible science experiment gone horribly wrong!

hmmm
#13
07/20/2005 (10:51 pm)
Greg, it is possible to add additional Nodes, I've done this up to the default max of 8 and still had the shape correctly run the sequences[plus be oriented correctly! for proper use, even moved mount2 to a new location]. Moving them, I've not experimented with, but know would pose more difficult by far...you are altering the basic structure of the object and that won't be easy to untangle....;). Adding Nodes shouldn't be an issue. I'm already formulating how to get the body shape changed, heh, heh.....wait a minute, I just said I moved mountPoint2 to a new location and it worked! Yahoo! I'm golden......:). It can be done.....'eve'body do the Bender, uh-Huh!'

pages.sbcglobal.net/rexpiscator/_uimages/Bender.gif
Click on me to read more...."eve'body do the Bender, uh-Huh!"

I guess sloggin' away for two years here at this site is beginning to pay off! I've chiseled a crack in the wall 'twix coder and artist.
#14
07/20/2005 (11:49 pm)
Ok rex, heres an opinion question, which do you think would be quicker. Taking a my player model (not overly detailed), and modifying the mesh to fit the stock bone rig, or simply making all the dsqs myself? Thanks for your reply btw
#15
07/21/2005 (5:39 am)
On the model, I have alot of different boxes like head, arms, forearms, hands, etc... but when I export the model out. It adds a "0" at the end of all the names. So I should change those to "2"? Then I should try textureing the model?

Thanks
#16
07/21/2005 (7:53 am)
@Greg....from the stated goal of 'quicker', I'd have to say if you want fairly functioning player to begin GamePlay/Type testing, I'd have to say MODing the existing defaults. Otherwise it's a long process of animating, let alone the 'artician' skills of setting the shape and sequences up to function with existing SDK code. If your intention is to produce a 'finished' player from this, I'd have a different opinion; but that's not what you were asking, you want quicker.

@Stephen...ah I see you've gotten to this point. Doesn't matter at this point either 0 or 2[I believe the 0 is added automagically], they'll both render at nearly the same distance. Depends on what you're doing, quick testing, or finished product. There are some UV/texture constraints that apply and could be perhaps worked around...all depends. I've found this type of developement to be a lot of 'Design by Sight' as I put it. You just have to see what happens....;), and adjust.

More background info on the .dsq files and what is possible with them. To begin: I believe this is the DTS format's constraints. Only 'Skinned Meshes' can load .DSQ fileTypes. 'Rigid Meshes', will NOT accept the sequences.

What is a 'Skinned Mesh': It is a geometric construction of vertices, edges, faces that has it's vertices weighted/MS-'assigned' to more than one Node/bone/joint.

What is a 'Rigid Mesh': It is a geometric construction of vertices, edges, faces, that has ALL of it's vertices weighted to only ONE(1) Node/bone/joint. Milkshape operates in this manor, one bone per vertex. This causes the 'tearing' at the joints when animating...;).

What this means in Milkshape3D: From the example of MrBox, you can see[also from your quick proto 'player'], that the whole shape is comprised of several different, enclosed, geometric constructions[meshes]/parts. Head, arms, hands, etc.... In Milkshape, a 'mesh' is the same object as a native Ms3d format 'Group'. Now while you are viewing several separate 'meshes'-body parts with both 'players', when you look in the Group Tab in the listing, you'll only see one (1) Group 'name' of MrBox0. This will become important when texturing this shape, because of another Milkshape constraint. That of only allowing UV mapping to occur with a single texture assigned to a single 'Group'. You cannot put faces from one single Group on two (2) separate textures...at least last time I checked.

This is where the workflow can branch....if you have multiple meshes, I feel it to be easier to UV unwrap and map a 'grouped' Scene/object, but then DTS/DSQ loading constraint calls for a skinnned mesh. So you can either Regroup all the subGroups into one[after texturing to ONE map], it's a 'skinned mesh' after assigning[unless you did all verts to one joint, LOL], orrrrrr, you could go into each 'part' and assign at least 1 vert to another Joint, orrrrrr, my latest idea is to have a separate small face, hidden inside the main mesh and assign all these verts to the first bone in the chain after Regrouping this remote face to a structural Group/mesh. I've not tried this last technique, but I have a strong idea it would work. Might cause a few extra Polys/Tris, but it wouldn't be much overhead, and give you multiple texures.

At any end, you need a NUMERICAL appending number AFTER the Group/'mesh' name......the exporter will probably add it for you and it can be edited manually via the super dialog Chris built.


Whew!....there should be a Tutorial on this process.....it's valid, it works. Gets you going very quickly....enjoy. Thank Chris Robertson for all his many hours put into the exporter and default rig.

Rex


lol....next question will probably be about LOD's.....;).
#17
07/21/2005 (3:10 pm)
Hey Rex, Thankyou so much for the help! I got the model to use the dsq animations. I change the model to be one big group instead of having many different boxes like the head, arms, legs, etc... Then I applyed a texture to the model (a simple blue texture) and then I loaded it in-game and it worked like a charm.

Thankyou again!! =) Here's a picture!

tek0.net/torque/working.jpg
I really don't need you to explain how to get the LODs to work but if you want to tell me that's fine with me.
#18
07/21/2005 (5:27 pm)
That is not really necessary for BoxyGuy there, but I will say be careful with what you export in the shape in regards to Nodes. Without using a .CFG file to manually direct the exporting of Nodes, the exporter automagically exports ALL Nodes present in the shape. You will end up with 'extra' Nodes/joints because the exporter adds objects to the Scene to assist in the conversion process. What this means is; if you start exporting objects and sequence files without maintaining a watchful eye, you'll get sequences unable to load into the base shape, because the sequence file may contain Nodes/joints not found in the baseShape. This ceases the loading process for that particular file.

These are a little more advanced topics and should be looked over in the 'official' documents to provide the full view.

Great work.

....didn't take very long did it? :), this should be a testimonial to Greg B. about which way is quicker!