In this thread I'll try to do a quick write-up on how to create a mesh for Titan Quest using 3ds Max.
1) MSH tools by tokloo v1.0.8.3
yadisk (https://yadi.sk/d/cTRMyDNBy5Y8q) / googledrive (https://drive.google.com/open?id=1Oqo8ozf7NaH2BcgwDwaVxUJIUWl-eCn0)
MSH tools is a macroscript for importing & exporting .msh and .anm files. At the moment it's the only tool that allows you to import meshes and animations from the game formats as it is, which gives you crucial points of reference.
Place the script in your 3ds Max Scripts folder.
Launch Max, click MAXScripts and run MSH Tools script.
(https://i.imgur.com/8kWefji.jpg)
Right click on Utilites Panel, click Customize... In the popped up window choose MSH Tools in Category rollout.
(https://i.imgur.com/p1geWWL.jpg)
Drag Export & Import MSH buttons onto Utilites Panel.
(https://i.imgur.com/K53KylU.jpg)
Partially salvaged from tq.net via wayback machine (https://web.archive.org/web/20170809200112/http://www.titanquest.net/tq-forum/threads/54913-Creating-models)
Open Import MSH to import a mesh or animation to your scene.
(https://i.imgur.com/7TV9fOX.jpg)
Choose the file format in "Files of Type:" rollout.
(https://i.imgur.com/qgEnhAn.jpg)
(https://i.imgur.com/yOvsJxw.jpg)
(https://i.imgur.com/WjjVxZv.jpg)
Mesh
Before exporting a model, make sure it's converted to Editable mesh and has texture coordinates.
Open Export MSH and add your model under Objects tab, Meshes rollout.
(https://i.imgur.com/OzRWh9Z.jpg)
Choose a shader in Textures tab below. Click Add button, you'll see the default list of shaders.
Usually you'll be using StandardStatic - for unanimated objects, and StandardSkinned - for everything that has bones and Skin modifier.
You can set any shader existing in the game and edit their properties manually.
(https://i.imgur.com/M5wtXzI.jpg)
Double click and set your texture paths in baseTexture & bumpTexture fields accordingly. Via Import button you can import texture sets of existing meshes.
(https://i.imgur.com/Eip0OwM.jpg)
Once you've set up your texture, assign its number to a model in Meshes rollout by doubleclicking on it.
(https://i.imgur.com/fNm7GwT.jpg)
Hitbox
Use Box objects to create a hitbox for your mesh.
(https://i.imgur.com/8UPCk8u.jpg)
You'll need to Center Pivot to Object for your newly created Boxes.
(https://i.imgur.com/WiXfneL.jpg)
Then place them at zero Absolute coordinates, otherwise they won't be exported properly. After that adjust your Boxes in accordance with the model.
(https://i.imgur.com/8k8ueoa.jpg)
Convert the Boxes to Editable Mesh and add them in Objects tab under Hit Boxes rollout.
(https://i.imgur.com/xyBHrY2.jpg)
Finally your mesh export is set.
Under General tab, click brouse and choose the name for your file.
CLick Export to export your model.
(https://i.imgur.com/cGi8ESG.jpg)
(https://i.imgur.com/FdIJPpE.jpg)
A) Weapons
(https://i.imgur.com/wBR5Mty.jpg)
When working with equipment you'll be better off importing some similar mesh from the game and using it as a template.
Import a dummy weapon.
(https://i.imgur.com/i9GPJug.jpg)
Align your model accordingly. Notice Anchor1 & Anchor2 attach points, the space between them defines trace effect's source (when characters swing a weapon).
(https://i.imgur.com/VRCUcd6.jpg)
Add your mesh & assign textures in Export MSH. Weapons are unanimated models, use a static shader.
Add the attach points under Objects tab, Dummies rollout. You can select every objects in the scene (Ctrl+A) and click Add Selected button, it'll only add Dummies.
(https://i.imgur.com/E6HW0HL.jpg)
Now your model is ready to be exported. Note that equipment doesn't need hitboxes.
(https://i.imgur.com/ksJnWrr.jpg)
B)Armor
To adjust your armor properly you'll need the player character mesh imported(Creatures\pc\female\femalepc01.msh; Creatures\pc\male\malepc02.msh).
Just like with weapons, you can use a dummy armor mesh.
(https://i.imgur.com/audDLbx.jpg)
Align your mesh accordingly. Add Skin modifier and required bones, tweak weights.
(https://i.imgur.com/VjoKmVQ.jpg)
Once you've done, open Export MSH and add your mesh, textures (you're using a Skinned shader now). Export it.
(https://i.imgur.com/JDQrGvm.jpg)
Collision mesh is used to create a pathable surface for a mesh.
(https://i.imgur.com/Uz64UNV.jpg)
Create a low poly copy of your mesh.
(https://i.imgur.com/zgtE4xc.jpg)
Add it in Objects tab under Collision Mesh rollout.
(https://i.imgur.com/XG833wP.jpg)
Double click on it to see pop up menu.
(https://i.imgur.com/W7qc4bR.jpg)
Click Show button, it'll autoselect the mesh. Select pathable faces for your collision mesh. The unselected parts will serve as a hitbox (on a side note: You don't need to create a hitbox if a model already has a collision mesh). Click Set button.
(https://i.imgur.com/UfSlpVk.jpg)
Ground Points are used to attach the pathable part of a mesh to terrain, which is necessary in order for characters to be able to walk up on to the mesh from terrain and vice versa.
Use Cross Point Helpers to create ground points. Attach each ground point to vertices of the pathable part of your collision mesh in the counter-clockwise order. Click Edit button under Ground tab to see the list of ground points.
(https://i.imgur.com/GjbsfPe.jpg)
Another example of ground points placement (https://imgur.com/a/Hrf46A6)
Now your mesh is ready for export.
(https://i.imgur.com/wyuZjSW.jpg)
Multiple Ground Points groups
TBW
(https://i.imgur.com/mN7nTFi.jpg)
Use a Plane object to create a portal plane. Convert it to Editable Mesh before exporting.
In order for portals to work properly, entrance & exit meshes need to have an attach point called "ChokePoint" with carefully adjusted coordinates. Use a Dummy object to create ChokePoint and place it at the bottom center of the portal plane.
(https://i.imgur.com/mtclQuQ.jpg)
Z axis of the dummy should face a character as he enters the portal.
(https://i.imgur.com/6EHO18O.jpg)
Add the portal plane and ChokePoint under Portals and Dummies rollouts respectively.
(https://i.imgur.com/Pruu1BO.jpg)
It's worth noting that outer grid entrances (the ones being placed on a terrain region as opposed to a grid) usually have a collision mesh to smooth pathing transition.
(https://i.imgur.com/Jweu7QR.jpg)
TBW
Using dummies you can attach a .dbr to your mesh, be it an effect entity, light source, or a piece of equipment.
Double click on an attach point in Dummies roll out to fill in an entity's records path. To attach it to a specific bone, set the bone's name in Parent field.
(https://i.imgur.com/EeBsEvE.jpg)
(https://i.imgur.com/Cjlr1kB.jpg)
Couple of notes about animation:
Animation only works with bones.
First frame of an animation has to be the default T-pose, in order for the script to capture beginning of the animation correctly.
When exporting, animations only require bones, you don't need to set up the model/hitboxes/dummies. In most cases you'll need to have Export all bones box checked.
2)TQ's 3ds max plugin (x86 max)
Official guide is found in the game directory under ...Titan Quest Anniversary Edition\Toolset\guide\content_art_3dsmax.md.html, item 3.1 Models
In order for Max to be able to see the game's contents, proceed to C:\Users\*User*\Documents\My Games\Titan Quest - Immortal Throne\ and open Tools.ini. Set core Titan Quest directory (If you have mods with custom assets you'll be using add their paths too) path in additionalbuilddirs field.
(https://i.imgur.com/BRdL98C.jpg)
Copy over .dlls found in Titan Quest core directory to 3ds Max installation folder. Copy MaxPlugins.dlo to your 3ds max plugins folder.
For the game shaders to work properly you'll need to set Direct3D in renderer settings. Launch Max, in Preferences Settings (Customize->Preferences on Utility Panel) open Viewports.
Click Choose Driver, then Revert from Direct 3D. Select Direct3D and press OK. Restart 3ds Max.
(https://i.imgur.com/AWccmj3.jpg)
Materials
To export a model you'll need to assign it a one of the game's shaders.
Open Material Editor (M), set it in Compact Mode. Click Standard button and select "Shader" material.
(https://i.imgur.com/B9Nc3lO.jpg)
Click on the elipsis to choose a shader.
(https://i.imgur.com/VtG9iht.jpg)
After you've set textures' paths the material is ready to be applied to a model.
(https://i.imgur.com/4q9Hhkl.jpg)
Hitboxes
Use hitbox helpers found on Create panel/Helpers to create a hitbox for your mesh.
(https://i.imgur.com/y8BOo8w.jpg)
Export Object
(https://i.imgur.com/kXsCkYk.jpg)
Upon finishing up, place one Export Object somewhere on the scene.
(https://i.imgur.com/yHDrWFz.jpg)
Save your .max to your mod's source folder.
Open Art Manager and Auto-Create Asset for your model. Build your mod.
(https://i.imgur.com/U3FH9r0.jpg)
(https://i.imgur.com/ToUqdtH.jpg)
3) GD's max plugins ('09/'11/'12 x86 max)
Guide by one of the devs is found here (https://forums.crateentertainment.com/t/guide-installing-using-3ds-max-plugins/32849).
GD and TQ meshes differ by the fourth byte in their files. 02 for GD; 0a and 0b for TQ. 0a type allows only one texture per mesh so you'll never really need that.
Once you've built your models in Asset Manager convert them via any hex editor and they're good to go for TQ.
(https://i.imgur.com/50nlCTc.jpg)
Although I have to add GD uses more advanced technology, some of the mesh data will essentially be a dead weight when used in TQ. No idea whether it affects the game performance in any way.
Note - Checking links on own risk, all uploaded on site with name "fast-files". - efko
This is the original text of the tutorials, that I published on www.titanquest.net in 2016.
MSH Tools v1.0.8.3 (http://www.fast-files.com/getfile.aspx?file=184852) (19 Jun 2016)
MSH Tools v1.0.8 (http://www.fast-files.com/getfile.aspx?file=115502) (15 Jun 2016)
MSH Tools v1.0.6 (http://www.fast-files.com/getfile.aspx?file=97138) (12 Aug 2015)
MSH Tools v1.0.5 (http://www.fast-files.com/getfile.aspx?file=86752) (23 Feb 2015)
MSH Tools v1.0.4 (http://www.fast-files.com/getfile.aspx?file=86500) (18 Feb 2015)
MSH Tools v1.0.3 (http://www.fast-files.com/getfile.aspx?file=86284) (14 Feb 2015)
MSH Tools v1.0.2 (http://www.fast-files.com/getfile.aspx?file=80650) (26 Oct 2014)
MSH Tools v1.0.1 (http://www.fast-files.com/getfile.aspx?file=80518) (23 Oct 2014)
MSH Tools v1.0.0 (http://www.fast-files.com/getfile.aspx?file=80053) (13 Oct 2014)
MSH Tools is the macroscript for the 3dmax to import and export TQ's files of models(.msh) and animations(.anm).
It was created by 3d max 9.0 (Errors may be on low versions)
This script also can work with files of Grim Dawn, but errors may be.
Excuse me for spelling and report about serious mistakes to me, please.
I'll try to tell about all functions of my script by examples.
It still has many errors.
Installation
- 1. Download and move the script into the ...\ui\macroscripts directory.
- 2. Then on the Utilities panel, click MAXScripts -> Run Script... and run this script.
- 3. Click the Customize menu and choose Customize User Interface.
- a) to add a button to a toolbar
- 1. Click the Toolbars tab.
- 2. Choose MSH Tools in the Category drop-down list.
- 3. Drag Import MSH and Export MSH from the list to some toolbar.
(https://i.postimg.cc/NfyH9Sf1/1.png)
- b) to add a command to a menu
- 1. Click the Menus tab.
- 2. Choose MSH Tools in the Category drop-down list.
- 3. Drag Import MSH and Export MSH from the list to the right list.
(https://i.postimg.cc/4NrhzPmj/2.png)
For example, add to the File menu on the Utilities panel.
Import MSH
(https://i.postimg.cc/kgKRwSSG/3.png)
- 1. Click the Open button.
- 2. Choose necessary a file type in the File Types drop-down list.
- 3. Open the file.
- 4. Select necessary for import to the 3dmax scene (if you will select import an animation, then all checkboxes will be disabled).
- 5. Click the Import button.
Export MSH - Tutorials
Weapons
(https://i.postimg.cc/3NkdG07K/4.png)
Import some original weapon to the scene.
(https://i.postimg.cc/TwYyRH45/5.png)
Then import your mesh.
To export it correctly your mesh should be Editable_mesh geometry class and has texture coordinates.
Texture coordinates must be in the first map channel.
Also it's necessary that each vertex of your mesh has one normal.
(https://i.postimg.cc/TPxLsPj9/6.png)
Align your mesh and set correct scale.
Now you can delete old mesh.
There is the trace of the weapon between "Anchor1" and "Anchor2" attach points .
There is "Anchor1" on the tip of the sword and "Anchor2" on the sword handle.
The others attach points define position temporary effects.
Preparations is finished, now open the Export MSH macros.
(https://i.postimg.cc/pdBhMtqt/7.png)
In the first rollout add your mesh.
(https://i.postimg.cc/k412DF01/8.png)
Then choose Dummies (They are Attach Points) in the first drop-down list and add all here.
(https://i.postimg.cc/KjC4Dcvt/9.png)
Below in the Texture rollout add your texture.
You can click the Add button to choose a template to create new texture.
(https://i.postimg.cc/L8KnqsWp/12.png)
There is the empty template and three often used shader templates there.
But you click the Import button to import the texture list from another file.
There are many shaders and their properties. It's for another article.
(https://i.postimg.cc/DfNWT6dm/10.png)
Double click on "baseTexture" and "bumpTexture" in the texture list and set the path to your textures.
(https://i.postimg.cc/8zRsLS8r/14.png)
Now return to the first rollout and choose Meshes in the drop-down list, then double click on the name of your mesh and set the number of the texture more zero.
It's important because if some mesh has the texture number equal zero then the model will not be displayed.
(https://i.postimg.cc/28B18W2G/11.png)
In the last rollout click the Brouse button to select the name of the file to be saved.
.mif is really mythical file format. I didn't find any original file, but in some article it is written that this file include attach points and other text data, which you will set later.
Therefore you can write here what you want or pass it or click button below to import the path to one from the original file.
Textdata include the skeleton geometry and cannot be changed by this macros, therefore it should be imported from the original file, if it's necessary.
But now pass this edit box because the textdata of weapon files include only attach points.
Click on the Export button.
(https://i.postimg.cc/nr9hr8Yr/13.png)
Now can test the model.
Effects
(https://i.postimg.cc/mrgg2hhj/1.png)
To create an effect choose Dummies in the drop-down list of first rollout and double click on some point of the list.
(https://i.postimg.cc/nzsVB54Q/3.png)
There is a parent bone in the Parent edit box, if it exists.
Export attach points already have their parent bone and the list of effects from the export file.
(https://i.postimg.cc/0yxNFVsL/2.png)
Click the Add button and then double click on the added point of the list.
Write path to some .dbr file in the showed dialog.
One attach point may contain several effects.
You can look effects in Editor.
For example
(https://i.postimg.cc/MG3KcxQS/5.png)
I have created new dummy and moved it at the sword pommel.
(https://i.postimg.cc/bwTvh1Yd/4.png)
Then I have added two effects:
records\effects\projectiles\343_arrowfrost_flight_fx.dbr
records\Lights\staticlights\10mlight_stat_blue.dbr
(https://i.postimg.cc/TYnwtZZV/6.png)
It looks so
(https://i.postimg.cc/nz6Fkk2S/7.png)
or with my own effect.
The .dbr file can have not only effects but also something other.
Vertex Color
Also the .msh format lets you set vertex color.
(https://i.postimg.cc/fRGQKtNH/1.png)
After import you may open the VertexPaint modifier to see vertex color
(https://i.postimg.cc/3JWMQCrS/9.png)
and alpha channel.
Now about export.
Open the VertexPaint modifier.
(https://i.postimg.cc/wjsS7qmD/10.png)
Leave the closed lock not to get confused later.
(https://i.postimg.cc/FK05nrFh/2.png)
After you painted vertexes in the VertexPaint modifier, open Export MSH.
You must use texture shaders with "vertexcolors" words that vertex color will be displayed.
In this case I use standardvertexcolorstatic.ssh.
(https://i.postimg.cc/0NRhSTYF/11.png)
Don't forget to check the Vertex Color checkbox.
(https://i.postimg.cc/5yNh08Bt/5.png)
So it looks in Editor.
(https://i.postimg.cc/QtsL22V1/3.png)
To paint the alpha channel create new channel.
(https://i.postimg.cc/G3X0fSRT/4.png)
Choose alpha in the shown dialog.
(https://i.postimg.cc/7hspTb9n/8.png)
Each channel must have own modifier.
(https://i.postimg.cc/vBzRb06j/7.png)
Export the mesh.
(https://i.postimg.cc/gk7CzXnY/6.png)
See in Editor.
Armors
At first, import the model of your hero.
(https://i.postimg.cc/tT6DpJZM/1.png)
We need it to try on our armor, but first of all we need its bones.
(https://i.postimg.cc/BbcgPzC5/2.png)
When your armor is completed add the skin modifier.
(https://i.postimg.cc/05pZ46q6/3.png)
Then add bones that must have vertices of the armor and set their weights.
All is ready for export. Here do all in same way as in the first tutorial.
(https://i.postimg.cc/5NbpWxxs/4.png)
But shader must have word "Skinned".
It's necessary because the mesh won't displayed if the mesh has the skin modifier and the shader don't support the skinned meshes.
And on the contrary it's impossible to use the shaders support the skinned meshes with the mesh has not the skin modifier.
In this case it's StandardSkinned.ssh
It's all. Click on the Export button.
(https://i.postimg.cc/J4xx190M/5.png)
Decorations
Choose some mesh, open the script and..
(https://i.postimg.cc/J7SgFX3Z/1.png)
..do just as in the first tutorial.
(https://i.postimg.cc/FKFnSVm5/2.png)
To create an impassable area choose Hit Boxes in the drop-down list and add some mesh.
It may be the object directly but only its border box are exported.
(https://i.postimg.cc/tCPfGgDf/3.png)
Or create a box yourself. Don't forget to convert to Editable Mesh.
(https://i.postimg.cc/RCWyGdtv/4.png)
Platforms
(https://i.postimg.cc/J75d4Fj7/1.png)
If you create some building then you may need impassable and passable areas of any form.
(https://i.postimg.cc/wjZwGYY2/2.png)
Create a low poly mesh.
(https://i.postimg.cc/3xdL1JVW/4.png)
In the first rollout choose Collision Mesh in the drop-down list and add this mesh.
(https://i.postimg.cc/Pr63186B/5.png)
Double click it in the listbox to show its options.
If you added the imported mesh in the list, you can click the Show button to see its passable faces.
(https://i.postimg.cc/m2ZpcSSY/3.png)
Select your low poly mesh, open the Modify Panel, Faces Sub-Object level and select faces that will be passable, then click the Set button.
You can export.
(https://i.postimg.cc/yYNn68Vn/6.png)
Ground points
Many buildings link with the map. For this purpose there are the Ground points.
(https://i.postimg.cc/yNrJ8T4f/1.png)
(https://i.postimg.cc/43MdgNVq/2.png)
But sometimes it's necessary, that there was some area is between the mesh and the map plane. Especially if the mesh has not right borders.
(https://i.postimg.cc/j2yCv0W9/3.png)
This area (1) is simple mesh that is imposed on the collision mesh (2) and links the basic mesh and the ground points (3).
It's logical to begin from the collision mesh.
(https://i.postimg.cc/kgJDNH71/4.png)
To exclude cracks between the mesh and the ground area detach some faces from the collision mesh for it. Then edit this plane, if it's necessary.
(https://i.postimg.cc/05S69mtf/5.png)
Add this mesh in the Meshes listbox as other meshes then in the Ground rollout set the number of this mesh in the list.
Also create a new texture for this mesh and in the shader property write TileBlendingStatic.ssh
Now transparent texture vertices will have a map texture. It's not necessary to create a new texture file for this purpose, a small transparent part can be created in the basic texture as it was done by creators.
The ground mesh is not obligatory. Let's come back directly to the ground points.
(https://i.postimg.cc/SN7JM4bY/8.png)
Click the Edit button in the Ground rollout.
It's recommended to place ground points on vertices of the ground mesh or the collision mesh.
To create new ground points select some mesh and go to the Modify Panel, Vertices Sub-Object, then select some vertex and click the Add button in the earlier shown window.
Ground points should be located in a counter-clockwise direction and not more than in 2-units steps between each other.
For ease of sorting, a click of the ground point in the list selects this point.
The Add button adds the ground point to the current item of the list.
Also there are the Up and Down buttons for this purpose.
(https://i.postimg.cc/MK8nHTN8/7.png)
(another bridge is on this picture)
And remember that ground points must be normal(perpendicular) to the map plane.
For ease, there is the Show Axis Tripod button in the Ground rollout, a click of it shows axises of all points on the scene. The Z axis is the normal.
(https://i.postimg.cc/q7gRSCh2/6.png)
Sometimes it's necessary to create several not connected with one another groups of the ground points.
Ground points are sorted by colour therefore create a new point and set another colour to add a new group. To show the new group reset the Edit window.
(https://i.postimg.cc/3JBxwZ2g/n.png)
Portals
Create any plane, don't forget to convert to Editable Mesh. It will be the portal directly.
(https://i.postimg.cc/bN0yx1tL/1.png)
Faces of plane should look at the hero, which will enter to it.
(https://i.postimg.cc/Wpkb4BpB/2.png)
Add this mesh in the Portals list.
(https://i.postimg.cc/Dw22BmQh/3.png)
Now create a dummy with name "ChokePoint", that is necessary to set orientation of portal. In other words, it's connection dot of two portals.
The Z axis of the dummy should be directed as portal faces. The dummy usually is on the plane of portal in center of bottom side.
(https://i.postimg.cc/VLPs0Kdd/4.png)
Add the dummy in the Dummies list and export.
(https://i.postimg.cc/cCws5n5x/5.png)
The portal is ready for use.