Jump to content
Hash, Inc. Forums
Sign in to follow this  
Paul Forwood

*** AMXdtsPlus ***

Recommended Posts

I'm taking my first tentative steps into producing DTS files from A:M13 with Obsidian Games' new plugin beta, 'AMXdtsPlus'. Thankyou, Chris, for pointing out that I need to do a little bit of preparation work before running the exporter plugin. I have read through your notes and looked at the example projects but I am still a little puzzled. I wonder if you might clarify some of the fuzzier areas that I outline below? This is the way I am seeing it at the moment so please correct me where I am off course:

 

I understand the scaling and rotations that are required to get a model from the A:M world into the Torque world and I think that I have that setup correctly. From a Top view in A:M my model looks like he is standing on his head and facing me. (This matches the Thom example). He now stands about 1.2 cm high instead of 1.2 metres. Now we get to my confusion...

 

1) The bounding box: This is not well documented but I assume that a bounding box is just a standard 6 patch box which describes an area around your model that is large enough to contain all the parts of your model through any of it's actions. So this takes a bit of experimenting and foresite before you can be sure that it is set to the optimum size. I gather that this box is used within Torque for a number of things, including collision detection? This box must be held in A:M as a seperate model and named 'bounds'. The orientation of the bounding box must match the orientation of the rotated and scaled model?

 

2) The base01 folder contains two items, BoneLink and detail#. Are these just nulls which are created in the PWS? Does the number which follows 'detail' describe the height, in pixels, of the image map that will be generated from the model and exported to Torque? If this is correct does it have to match the size of the image used in your decals or does this just set the size of the image that will be generated for Torque?

 

3) Does 'BoneLink' have to be the top item in the 'base01' folder?

 

4) When creating models for DTS export should I have just one model/character per project or is it possible to have a project with many models setup for DTS export?

 

5) Can you describe the difference between a standard mesh and a skinned mesh? Is it just that a standard mesh has no bones and a skinned mesh does?

 

6) I notice that there are no relationships in the Thom project. Should they be stripped out of models that are created in A:M? If this is so then how can actions be exported? I imagine this will require me to study the Torque documentation in order to understand how Torque handles bones.

 

7) I have several actions that have an action object in them. Should I delete this object from the project and save it as a seperate DTS model via another project?

 

8) There is no documentation regarding rigging. What are the requirements and are there compatability problems with complex rigs such as TSM2 or the new squetch rig? I notice that after scaling and rotating my model that the TSM2 foot controls have not scaled and so my actions are no longer correct. The Thom example seems to use a very basic rig. A paragraph or two, in the documentation, about rigging requirements would be very useful to all AMXdtsPlus users.

 

I'm sure that I will have more questions, particularly regarding the less documented areas.

------------------------------------------------------------------------------------------------------------

Hmmm. Too bad this forum doesn't allow image attachments. I am still getting that 'Config file error' when exporting DTS files.

Share this post


Link to post
Share on other sites
Hmmm. Too bad this forum doesn't allow image attachments. I am still getting that 'Config file error'.

 

Contact Will Pickering at willp@hash.com and he may be able to make it so files can be attached.

Share this post


Link to post
Share on other sites
Contact Will Pickering at willp@hash.com and he may be able to make it so files can be attached.

 

Its not vital, Rodney, but as AMXdts develops, and as Hash have pledged some extra support for these tools, I just thought that there might be alot of questions asked from all sides that would be aided by occassional illustrations. Better to keep this in the 'Game Development' forum than posting all over the place where possibly useful, and relevant, information would get buried quickly.

Share this post


Link to post
Share on other sites

I am still getting an error message when AMXdts creates a dts file but when opened the file in the Torque viewer the model doesn't show up.

 

The 'dump file' shows alot of 'Export Error' statements when it gets to the 'Adding sequence' sections.

 

Can actions that were created an a full scale model in A:M be applied to the model when it is scaled down to .001 of it's original size? I can see how rotations would be unaffected but translations would remain at their A:M scale and so would be useless. I think that is what I am seeing in my actions.

 

This raises questions about whether any animation data could be transfered from the TWO movie to the TWO game. It looks like all game animation would have to be done afresh using the scaled down models. Thats okay, so long as we recognise this from the start. Having said that I would prefer it if some hidden magic where added to the exporter to automatically handle the donkey work like scaling, rotating and converting the models and actions from A:M space to Torque space. As one unit of measurement in Torque space represents 1 metre and 1 unit of space in A:M generally equals 1 centimetre it would make sense to me to apply some automatic conversion routine within AMXdts which divides all model coordinates by 100 if an option is selected in the exporter interface.

 

Of course it is very possible, in fact very likely, that I have got this all wrong. Just my confusion. Nothing that a little conversation can't sort out. So am I way off course again?

Share this post


Link to post
Share on other sites

Paul, I'll answer your first post first. I've bolded your questions, and my answers follow.

 

1) The bounding box: This is not well documented but I assume that a bounding box is just a standard 6 patch box which describes an area around your model that is large enough to contain all the parts of your model through any of it's actions. So this takes a bit of experimenting and foresight before you can be sure that it is set to the optimum size. I gather that this box is used within Torque for a number of things, including collision detection? This box must be held in A:M as a separate model and named 'bounds'. The orientation of the bounding box must match the orientation of the rotated and scaled model?

 

You pretty much got this one dead on, except for collision detection. There are separate objects (LOS & Col) which are used for collision detection. The bounding box must encompass your entire model during all all animations, where as you can get a little more fine tuned when creating LOS & Col (line-of-sight & collision) objects.

 

2) The base01 folder contains two items, BoneLink and detail#. Are these just nulls which are created in the PWS? Does the number which follows 'detail' describe the height, in pixels, of the image map that will be generated from the model and exported to Torque? If this is correct does it have to match the size of the image used in your decals or does this just set the size of the image that will be generated for Torque?

 

Yes, the BoneLink and detail# are just markers that tell the exporter where, when, and how to export objects. DTS was originally designed to work with 3DSMax, and was tuned to their workspace. I've never used it, but from the pictures I've seen, the skeleton exists separately from the model in the project workspace, and the root node was located under the base01 folder. To simulate this, I implemented the BoneLink object, which basically tells the exporter that when you get to this object, create the bone hierarchy from the main model.

 

The detail marker has nothing to do with textures/images. The detail marker represents the size of the model and how it gets displayed in game based on pixel height. The number at the end has to match the number at the end of your model (ie a detail marker named "detail64" would match up with a model named "Thom64"). If you are doing a single level of detail (LOD) model, this number can be any positive number, it should not matter. It's only if you're doing multiple levels of detail that the number becomes important.

 

For example, take the SphereLOD_BB example model from the file pack. It has 3 detail markers - 2, 64, and 128. When the model is close, and the model size on screen is larger than 128 pixels, the highest detail version of the model (128) is displayed. When the model size on screen is between 64-128 pixels, the middle detail version is used (64). When the object is far away, and takes up less than 64 pixels, the smallest detail version of the model is displayed on screen (2, which in this case is a billboard model, but ignore that part for now).

 

By using multiple LODs, you can speed up the engine, sometimes dramatically. If a model is far away on screen, there's really no need to render all of that detail, and you can increase render speed by having the engine draw a simpler version of the model.

 

3) Does 'BoneLink' have to be the top item in the 'base01' folder?

 

The BoneLink object needs to be located at the top level inside base01, but does not need to be the top item.

 

4) When creating models for DTS export should I have just one model/character per project or is it possible to have a project with many models setup for DTS export?

 

Each A:M project is for a single DTS model export. You can have multiple copies of that one model if you're doing multiple levels of detail (LOD), but you should not have one large project with different models in it.

 

5) Can you describe the difference between a standard mesh and a skinned mesh? Is it just that a standard mesh has no bones and a skinned mesh does?

 

That's basically it. Standard meshes are mainly meant for static objects (boxes, trees, etc) where as skinned meshes are for boned/animated characters.

 

6) I notice that there are no relationships in the Thom project. Should they be stripped out of models that are created in A:M? If this is so then how can actions be exported? I imagine this will require me to study the Torque documentation in order to understand how Torque handles bones.

 

I'm not sure what you mean by relationships. Do you mean complex bone rigs? If so, I'll answer that one below. If not though, I'm a bit confused, as the actions for the Thom project export correctly.

 

7) I have several actions that have an action object in them. Should I delete this object from the project and save it as a separate DTS model via another project?

 

Again, I'm not sure what you mean by action objects. Can you please describe what that is, and why you think it is/could be a problem?

 

8) There is no documentation regarding rigging. What are the requirements and are there compatibility problems with complex rigs such as TSM2 or the new squetch rig? I notice that after scaling and rotating my model that the TSM2 foot controls have not scaled and so my actions are no longer correct. The Thom example seems to use a very basic rig. A paragraph or two, in the documentation, about rigging requirements would be very useful to all AMXdtsPlus users.

 

I have not tested whether complex rigs work with AMXdtsPlus, but it's unlikely that they will be supported (they're not supported with AMXtex). It might be possible to work something out where the model can be designed with an advanced rig, and then the config file can be used to cull out all of the advanced rig bones. I will try to test one out when I get a chance, but I can't guarantee anything.

 

 

I'm sure that I will have more questions, particularly regarding the less documented areas.

 

Whenever you come up with more questions, let me know, that's what I'm here for.

 

For now, there is an important point that I'd like to make with regards to designing models for game export, which I cannot stress enough. Modelling for animation and modelling for games are two completely different beasts. When you're modelling for animation, you can afford to use as many objects (patches, textures, bones) as you want, since the end result is an animation of the model, and not the model itself. When you're building models for games though, you need to design them to use the fewest objects possible, since the model itself will be used in the game. Every additional patch, texture, and bone adds to the complexity of your model. The more complex a model is, the slower it will render in the game engine. Individually this might not be a problem, but when you think about the possibility of have 10's or 100's of models on screen at once, you might really begin to see the difference.

Share this post


Link to post
Share on other sites

Thanks for the quick reply, Chris! That helps to clarify quite alot of thing.

 

So, the way that I intend to approach the conversion of TWO models to Torque models is as follows:

 

1) Create a standard project with all the required hierarchy components setup for skinned model export. I will save this project as a template and use it as a starting point for all the characters. This just saves a little time every time I start a new game model. To begin a new project just open the template project, rename it and save it to a TWOGameModels folder.

 

2) Open the TWO model in this new project and save it to the TWOGameModels folder with 'dts' added to its name. This is to ensure that the original is not accidentally overwritten with all the changes that will be made.

 

3) Make any alterations to the model such as stripping splines, ensuring 5 point patches are all removed.

 

4) Scale the model to 1/100th of it's original size. This is because all the TWO models have been built to real-world scale within A:M world space while Torque uses a different ratio for unit length.

 

5) Rig the model with a simple skeleton and animate a range of actions suitable for game play. Save the actions and also save the model, with rig, as a template object. The template object is just to make it easy to bring this skeleton into other models and reuse their actions.

 

6) Put a bounding box around the model, test in all of the actions and modify the dimensions to enclose all of the actions.

 

7) In bones mode, rotate the model bone so that the model appears to be standing on it's head and facing me when viewed from Top View (key 5).

 

8) Copy the bounding box to a new object and name, 'bounds'. Ensure that this object sits below the model in the PWS. Delete the temporary bounding box from the main model

 

9) Ensure that the model is sitting at the top of the objects hierarchy in the PWS with the 'bounds' object just following it, but at the same level, if you know what I mean. Save project.

 

10) Right click on the model icon, in the PWS, and navigate to plugins/export/AMXdtsPlus and save models and action sequences.

 

11) Open the Torque viewer and load the DTS and DSQ files in order to check the quality of the model in Torque.

 

12) Note any problems and go back into A:M, making any neccessary changes to the default AMXdtsPlus properties for the model, and export again until it looks acceptable. Note these settings and save them in the template project.

 

Thats the plan anyway. ;-)

-----------------------------------------------------------------

Edit: Forgot the bounding box stage so I have edited the text above to include that now.

 

Don't worry about my action object question. The 'dump' file didn't throw up any errors concerning the action object that I had in my actions. I need to discover how Torque handles objects that the characters carry and use. Things like Tinman's axe. Is it possible to have Tinman aquire and use his axe in Torque or will the axe need to be a permanent part of the Tinman model?

 

Anyway, do you see any problems with this workflow?

 

Thanks for guidance, Chris! :) :)

Share this post


Link to post
Share on other sites

Paul,

 

Here's a response to your second list of questions. I just saw that you posted a new message, so I'll take a look at that as soon as I can. :)

 

I am still getting an error message when AMXdts creates a dts file but when opened the file in the Torque viewer the model doesn't show up.

 

The 'dump file' shows alot of 'Export Error' statements when it gets to the 'Adding sequence' sections.

 

I'm not sure what the problem is. If you want to send me your full project file, or attach it to a response here, I will take a look and see what I can find.

 

Can actions that were created an a full scale model in A:M be applied to the model when it is scaled down to .001 of it's original size? I can see how rotations would be unaffected but translations would remain at their A:M scale and so would be useless. I think that is what I am seeing in my actions.

 

I would highly recommend that all actions be set up on the model once you've created it at the proper size and orientation. However, do the actions work inside A:M after you've made these changes? If they work in A:M, but they don't work on export, please send/attach the project and I'll take a look.

 

This raises questions about whether any animation data could be transfered from the TWO movie to the TWO game. It looks like all game animation would have to be done afresh using the scaled down models. Thats okay, so long as we recognise this from the start. Having said that I would prefer it if some hidden magic where added to the exporter to automatically handle the donkey work like scaling, rotating and converting the models and actions from A:M space to Torque space. As one unit of measurement in Torque space represents 1 metre and 1 unit of space in A:M generally equals 1 centimetre it would make sense to me to apply some automatic conversion routine within AMXdts which divides all model coordinates by 100 if an option is selected in the exporter interface.

 

As before, I'm not sure if it will work. Trial and error may be your best bet to see if movie models/animations can be modified to work with the game models/animations. I do understand and can appreciate that it would be nice if a lot of the A:M-space to Torque-space work could be done automatically. Some of it may be possible, and is certainly something I could consider as additional features once the base feature set is complete. However, at the base of it, AMXdtsPlus is an exporter only, and it's function is to export ready-made objects from A:M.

 

Of course it is very possible, in fact very likely, that I have got this all wrong. Just my confusion. Nothing that a little conversation can't sort out. So am I way off course again?

 

I don't think you have it all wrong; not at all. Every question you've asked has been a valid one, and I appreciate it. If I don't know what the users of the plugin are thinking, there's not much I can do to improve it, right? :)

 

That said, I do have some advice for anyone learning to use AMXdtsPlus. When learning the exporter, I would definitely recommend starting small and working your way up. Looking over the models in the file pack would probably be a good start, and then maybe copying and modifying them. Don't try all of the features at once. Start with a static object, and get that to export. Mess around with the project setup, and see what types of DTS errors you get (the dump.dmp file is a great learning tool for this). Once you're comfortable with that, try out a model with bones, etc. I wouldn't even think about animation until you're comfortable with non-animated models. Much like learning A:M (or anything, for that matter), I think it may be overwhelming to go all out at first. If you take it slow, I think it will make it a lot easier down the road.

Share this post


Link to post
Share on other sites

Paul,

 

Wow... That's pretty much exactly how I would recommend you setup the workflow. Very solid, and it's keeps all of your models from the movie and game separate (but easily available as reference). The template project especially is a good idea, and should save lots of time when setting up similar models.

 

I only have a few, very minor, comments to make, which have nothing to do with your workflow. As before, I'll bold your step/question and respond afterwards.

 

3) Make any alterations to the model such as stripping splines, ensuring 5 point patches are all removed.

 

No changes here, but a few suggestions if you're considering multiple levels of detail. Depending on how detailed you want the "up close" version of the models to be, you might not want to strip too many splines to start. You could always have your high level detail model as close (in detail) to the movie model as possible, but strip out splines for the lower LODs.

 

On the flip side, if any of the models needs *more* detail, you could always try something like this -- Export using the PLY format (included with A:M), using multiple patches per poly. Then import that model back into A:M, and voila, you get lots more splines. This may still require cleanup, and it won't work well with complex bone setups, but if you're redesigning your bone structure, this shouldn't be a problem.

 

6) In bones mode, rotate the model bone so that the model appears to be standing on it's head and facing me when viewed from Top View (key 5).

 

Yes, exactly. For Torque models, positive Z is up, positive Y is forward, and positive X is to the right.

 

8) Right click on the model icon, in the PWS, and navigate to plugins/export/AMXdtsPlus and save models and action sequences.

 

This is absolutely correct, but there is a possible gotcha depending on how you export actions. I've seen this issue when reading about other Torque exporters, so I think it's an underlying issue with the Torque code. I'll continue to look into it in case it's not though.

 

When exporting animations, you might need to export them separately from the model -- ie, export the model to a .DTS file and then export the actions to a .DSQ file. You can then recombine them in the Torque ShowTool or in the engine. The issue that crops up is that sometimes when you export a model *and* animations to the same DTS file, some of the animations will be all out of whack (I believe it has to do with the default pose not being handled correctly by the animations). If you ever see this issue, please try to export your action to a separate DSQ file and see if it works that way.

 

Don't worry about my action object question. The 'dump' file didn't throw up any errors concerning the action object that I had in my actions. I need to discover how Torque handles objects that the characters carry and use. Things like Tinman's axe. Is it possible to have Tinman aquire and use his axe in Torque or will the axe need to be a permanent part of the Tinman model?

 

Ok, sounds good. If you find anything wrong with these action objects though, please let me know.

 

As for objects like the axe, you absolutely can keep the axe as a separate object from the character. In fact, this is where the config file comes into play. Real quick short version -- the config file used by the exporter is used (among other things) to cull unneeded bones, and to force the exporter to keep other bones. By default, the DTS format will cull out any bone that does not have vertices attached to it. (As a side note, this may be what allows complex rigs to work).

 

What you do is set up an empty bone on your model's hand, and name it something like "RightHandMount". Then make an entry in your config file under the "Always Export" section with that name. Export the model (make sure to look at the dump.dmp and confirm that the new entry was read from the config file). Then go to your axe model, and export that.

 

When you have both models, go into the ShowTool, load the axe and then TinMan, and use the "Mount Objects" function to mount your axe to the "RightHandMount" node on TinMan. You may need to read the docs on ShowTool to figure out how to get mounts to work, and it may require some other work (the mounted object will inherit the bone rotation/translation of your mount node), but this should be relatively easy to accomplish.

 

Anyway, do you see any problems with this workflow?

 

Again, this looks great. Thank you for sharing it, I would recommend it to everyone involved in the project.

Share this post


Link to post
Share on other sites

Well, Chris, after extensive trials I have not managed to get a single successful export. I tested withh the TSM2 rig and was eventually able to export the bones but no model and no sequences. I have built new, simple models and used the most basic of rigs, with no control bones, but I just can't get it to work. I can occassionally export the bones but getting the Torque Show Tool to display a whole sequence just isn't happening. It will play just a couple of frames from a one second sequence.

 

Even using your Thom project I am unable to export a model. I must be missing something. Can you try running that Thom project from A:M13 and see if you can export the DTS and DTQ files to a new folder? Maybe I should try all this again in A:M 12 as I have only tested A:M 13 so far.

 

Some new questions for you:

 

1) Are spaces allowed in bone names such as, 'thigh left', or must they use the underscore like this, 'thigh_left'?

 

2) Are frames per second important? If I export a sequence that was animated at 24 fps will Torque accept it? Please note that I have been trying both 24 fps and 30 fps but haven't noticed any change in the results.

 

3) If I export a model without any decals do I set 'details' to 0? I have tried eliminating it completely but AMXdtsPlus detects it and refuses to export.

 

I may not be able to get back to this for a little while so hopefully someone else will take up the challenge and show the way. I've given it my best but I'm completely stumped.

 

:blink:

Share this post


Link to post
Share on other sites

Answers are below...

 

I can occassionally export the bones but getting the Torque Show Tool to display a whole sequence just isn't happening. It will play just a couple of frames from a one second sequence.

 

This is normal. The unregistered version only exports the first 5 frames of an action. You need to register to get texture and full animation export.

 

Even using your Thom project I am unable to export a model. I must be missing something. Can you try running that Thom project from A:M13 and see if you can export the DTS and DTQ files to a new folder? Maybe I should try all this again in A:M 12 as I have only tested A:M 13 so far.

 

I just tried exporting the Thom project, as is, to a brand new folder with no config file. I got an error that the plugin could not find a config file (which was expected), but the model and animations exported just fine.

 

Some new questions for you:

 

1) Are spaces allowed in bone names such as, 'thigh left', or must they use the underscore like this, 'thigh_left'?

 

Spaces are allowed in names. The Thom model from the file pack uses spaces in the bone names.

 

2) Are frames per second important? If I export a sequence that was animated at 24 fps will Torque accept it? Please note that I have been trying both 24 fps and 30 fps but haven't noticed any change in the results.

 

While some of the code is in there to accept non-default frame rates, it's currently locked in at 30 FPS. This is one of the things I will be working on.

 

3) If I export a model without any decals do I set 'details' to 0? I have tried eliminating it completely but AMXdtsPlus detects it and refuses to export.

 

The detail markers are required, but have nothing to do with decals. I wrote a couple of paragraphs describing the detail markers in an earlier post in this thread. Please search above for it (it starts with "The detail marker has nothing to do with textures/images").

 

I may not be able to get back to this for a little while so hopefully someone else will take up the challenge and show the way. I've given it my best but I'm completely stumped.

 

If you continue to have trouble exporting, I'd be happy to take a look at one of your project files that you've set up.

Share this post


Link to post
Share on other sites
The detail markers are required, but have nothing to do with decals. I wrote a couple of paragraphs describing the detail markers in an earlier post in this thread. Please search above for it (it starts with "The detail marker has nothing to do with textures/images").

 

Oops! Sorry, Chris! I will go back and fiind that. That is probably where I have gone wrong. I didn't have a matching number on my model!

 

If you continue to have trouble exporting, I'd be happy to take a look at one of your project files that you've set up.

 

That would be great! If I don't have any luck this time I will post you a zip later today.

:)

Share this post


Link to post
Share on other sites

I thought these links to Torque documentation discussing the creation and export of 3ds max models to dts might shed some light. If you read through the tutorial it might take some of the mystery out of the naming conventions for the nodes and their purpose in the engine.

(You may need to be an owner of a tge liscense to access the pages,,, not sure.)

 

Node list

 

3ds tutorials

Share this post


Link to post
Share on other sites

Thanks, Duke, but you're probably right about needing to be a registered owner of Torque as I couldn't get past the title page.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...