Author Topic: [Tut]Creating models  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

Offline Endymion

  • Member
  • *
  • Topic Author
  • Posts: 45
  • Country: aq
  • Karma: +1/-0
    • View Profile
    • Awards
  • Time Zone: ?
[Tut]Creating models
« on: 26 August 2018, 22:22:12 »
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
Spoiler for Links:
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.

Spoiler for Installation:
Place the script in your 3ds Max Scripts folder.
Launch Max, click MAXScripts and run MSH Tools script.

Right click on Utilites Panel, click Customize... In the popped up window choose MSH Tools in Category rollout.

Drag Export & Import MSH buttons onto Utilites Panel.

Spoiler for Description:
Partially salvaged from via wayback machine

Spoiler for Import:
Open Import MSH to import a mesh or animation to your scene.

Choose the file format in "Files of Type:" rollout.

Spoiler for Export:

Spoiler for I. Scenery decorations:

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.

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.

Double click and set your texture paths in baseTexture & bumpTexture fields accordingly. Via Import button you can import texture sets of existing meshes.

Once you've set up your texture, assign its number to a model in Meshes rollout by doubleclicking on it.


Use Box objects to create a hitbox for your mesh.

You'll need to Center Pivot to Object for your newly created Boxes.

Then place them at zero Absolute coordinates, otherwise they won't be exported properly. After that adjust your Boxes in accordance with the model.

Convert the Boxes to Editable Mesh and add them in Objects tab under Hit Boxes rollout.

Finally your mesh export is set.
Under General tab, click brouse and choose the name for your file.
CLick Export to export your model.

Spoiler for II. Pieces of equipment:
A) Weapons

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.

Align your model accordingly. Notice Anchor1 & Anchor2 attach points, the space between them defines trace effect's source (when characters swing a weapon).

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.

Now your model is ready to be exported. Note that equipment doesn't need hitboxes.


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.

Align your mesh accordingly. Add Skin modifier and required bones, tweak weights.

Once you've done, open Export MSH and add your mesh, textures (you're using a Skinned shader now). Export it.

Spoiler for III. Collision mesh & Ground points:

Collision mesh is used to create a pathable surface for a mesh.

Create a low poly copy of your mesh.

Add it in Objects tab under Collision Mesh rollout.

Double click on it to see pop up menu.

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.

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.

Another example of ground points placement

Now your mesh is ready for export.

Multiple Ground Points groups

Spoiler for IV. Portals, i.e. grid entrances:

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.

Z axis of the dummy should face a character as he enters the portal.

Add the portal plane and ChokePoint under Portals and Dummies rollouts respectively.

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.
Spoiler for V. Vertex Color:
Spoiler for VI. Attach Points:
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.

Spoiler for VII. Animation:
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)
There's no official documentation to be found anywhere, however evidently its set up is similar to 3ds plugin for GD.

Spoiler for Setting Up:
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.

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.

Spoiler for Description:

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.

Click on the elipsis to choose a shader.

After you've set textures' paths the material is ready to be applied to a model.

Use hitbox helpers found on Create panel/Helpers to create a hitbox for your mesh.

Export Object

Upon finishing up, place one Export Object somewhere on the scene.

Save your .max to your mod's source folder.
Open Art Manager and Auto-Create Asset for your model. Build your mod.

3) GD's max plugins ('09/'11/'12 x86 max)

Guide by one of the devs is found here.

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.
Spoiler for Hiden:
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.
« Last Edit: 15 September 2018, 21:46:02 by Endymion »