GUIDE: Installing & Using 3DS Max Plugins:

Hello GD Modders!

We’ve been seeing some requests on the forums for more information on how to use the 3D Studio Max plugins that are included in the Steam Build of GD. As a result, I’ve decided to throw together this basic guide, which should hopefully resolve most or who knows, maybe even ALL of your questions regarding!

Tools Now support 3ds Max 2019 x64 version! (see attachment at end of post)

1: INSTALLATION
Copy over the following .dll files located in the grim dawn folder (\Steam\SteamApps\common\Grim Dawn) to your 3ds max installation folder (\3DS Max 2012 (x86)\3ds Max 2012):

grafik

Next, place the .dlo file relevant to your 3ds max installation into the \Plugins folder of your 3ds max directory (\3DS Max 2012 (x86)\3ds Max 2012\Plugins):

grafik

Once all files are in place, you should be able to access the exporter objects and the IL Shaders we use for GD.

2: SETTING MAX TO DISPLAY IL SHADERS:
By default, Max 2012 enables the “Nitrous” viewport, which is not compatible with Grim Dawn’s IL Shaders. To fix this, Max needs to be set to “Direct 3D” in the renderer settings. Under Customize > Preferences, click on the Viewport tab. Next, click on the “Choose Driver. . .” button and select the “Revert From Direct 3D. . .” button in the popup window. Finally, select “Direct3D” and press ok. You will need to restart Max for the changes to take effect. Once max is restarted, Open up the viewport tab in the preferences window again to confirm the settings took effect. If not, repeat the process again.

Once Direct3D is properly set, the ambient light needs to be changed from the default Black to a mid-tone gray. To do this, open up the Environments & Effects window (Default hotkey 8). Select the Ambient color and change it to gray.

Finally, the build directory of your Mod needs to be added to the Asset Manager in order for your textures to show up in the resource browser in Max. To do this, switch over to the AM and navigate to Tools > Options… In the “Additional Browse Directories” field, enter the path to the root folder of your Mod’s build location (not source) and be sure to leave the “” at the end of the path: “\Grim Dawn\Data\AMBuild\mods\YOURMOD”

3: ADDING AN EXPORT OBJECT & HITBOXES TO YOUR SCENE:
With the plugins installed, launch 3ds Max, click on the “Create” panel (1), then click on the “Helpers” button (2), you should see the “Export Object” button (3) visible:

grafik

With the Export Object button selected, click anywhere in the scene to add the object (location does not matter, though we usually place it at 0,0,0 or negative Z at some amount so it doesn’t overlap the game mesh):

Hitboxes are used in GD for calculating simple collision/transparency on static meshes, selection highlights on items and targeting on Mobs. In short, every object in the game should have a Hitbox. Generally speaking, Hitboxes should encompass the object in question, but the size can vary depending on the usage. For collision purposes, multiple Hitboxes can be used on a single asset.

Hitboxes can be accessed in the same tab as the Exporter Object. Simply click the Hitbox button and click-drag in your scene to create Hitbox around your object. Once the Hitbox is created, you are free to rotate/scale the Hitbox using Max’s transform tools. Please note that if you rotate the Hitbox and then wish to scale, you must switch from “view” coordinates to “local” coordinates otherwise you will distort the Hitbox which can cause bad things to happen. Hitbox names can typically be left as default, though I usually recommend naming them in some logical fashion for organizational purposes (hitbox_OBJNAME_##). There are several special-case Hitboxes that require specific, case-sensitive names and serve a unique purpose:

BlockLOS - This is used on dungeon walls and any other large wall assets that should prevent players from targeting monsters on the other side of said asset. Any Hitbox named this way (duplicate names accepted) will prevent any targeting of any vector from the player to a mob that intersects the volume of the Hitbox.

Transparency - Used for objects that need to fade out, but shouldn’t block projectiles (skyshard) or generate pathing. Typically useful on trees and building roofs.

There is another more advanced form of collision - physics meshes, but I won’t go into them in this guide. I will probably break this section off and talk more in-depth about collision and hitboxes in a new guide a some point. Images will also be included, but unfortunately, I’m currently at the 10 image limit for this post.

4: CREATING .MSH & .TEX FILES FROM YOUR SOURCE FILES:
Once the export object is placed, the scene is ready to become engine-ready. Save the scene and switch over to the Asset Manager. Navigate to the folder where the Max file is saved, right click and select “Add Files.” Add the Max file and any other associated files (Diffuse, Normal, Glow textures, etc). With the Files now added to the AM, right-click first on the Max file and choose “Auto-Create Asset”. Choose “Mesh” for the main character model file or if the scene is not animated:

grafik

Now, repeat the process for any textures associated with the Max file, choosing “Texture”.

Next, you must select a format appropriate for your texture. Most Diffuse textures will be DXT1 unless they have an alpha. If they have an alpha, then DXT3 or DXT5 is used. Normal maps always use DXT5 for the spec map in their alpha channel.
Once all files are added to the AM, you can generate .msh and .tex files for your models and textures, respectively. To do this, select Action > Build from the menu in the AM.

5: ASSIGNING MATERIALS TO YOUR GAME MESH:
For texturing models in GD, we use special shaders that should now be present if your plugins were installed correctly. To access these shaders in Max, open up your material editor default hotkey “M” and make sure you are using the compact material editor:

grafik

Next, select an empty shader (1), click on the “Standard” button (2), select the “ILShader” (3) from the list located within the “Standard” tab and press ok:

You should now see your shader show up as a solid colored sphere in the slot you selected. Make sure the shader is selected, then click on the “. . .” button (1) next to the “Shader” field. Here you should see a list of shaders within the popup dialog (Resources\Shaders). Although the list is rather large, we primarily use two main shaders: “StandardSkinned” and “StandardStatic” (2):

StandardSkinned is used for all animated models and StandardStatic is used for everything that is not animated. Again, there are many variants of these shaders, such as ones that allow glows and scrolling, but those are not covered in the scope of this guide. Once you have selected your shader, you can assign your textures. With the shader still selected, click the “Base Texture” field, followed by the “. . .” button (1) that will show up. Navigate to the location of your Diffuse/Albedo texture (2) and press ok to apply it:

NOTE: textures that haven’t been added/built in the Asset manager will not show up in the texture list in Max! If a texture was added/built while the Max file was open, Max may need to be closed/reopened for the textures to show up.

Repeat the process for any normal/glow files (note that specular is saved as an alpha channel in the normal map). As a result, the spec field should be ignored for the standard shader. WARNING, shaders without an assigned normal map tend to crash when loaded in the editor, same with glow shaders with no glow map assigned!

If you followed all these steps correctly, theoretically you should be able to add your .msh and .tex files in a dbr file and load them up in the engine!

Template versions of the Male/Female PCs and sword for scale referenence/armor fitting:
www.grimdawn.com/guide/settings/GD_ModelTemplates01.zip

EDIT - Adding 2019 plugin files:
3dsmax_2019_64_073018.zip (2.6 MB)

2 Likes

Thanks for the great tutorial! Didnt knew that I must use Asset Manager for that (lol)

How do I import already existing GD model? Or this thing is not going to be available?

Some templates are needed for weights, names and etc. (I guess, maybe I am wrong here)… Otherwise I see no way using it.

How do I import already existing GD model? Or this thing is not going to be available?

Unfortunately, that feature does not exist. The max plugins are only used for creating game-ready max files, not importing pre-built, existing game assets (.msh files).

Ok. Just created a box-weapon.

But it is going to be VERY hard without templates for some things. Maybe you are able to throw some of them? I dont know how to be with armor for example…

Edit: Also, template for weapons is needed, because adjusting size and position is pain.

Edit2: There is a tool for importing .msh to 3d max (MSH Tools 1.0.0.6), originally designed for TQ. Must we use this old and unofficial one to make things right?

Edit3: Frostmourne so far… How do I attach PFX to it? Any advice?

Very Nice!

I’ve added link to the main post for downloading Template files you can use as a guide for scale reference. The Files include simplified versions of the male/female PC as well as an average 1-hander sword.

To add FX to a weapon, the weapon needs to have a .mif file (created in the viewer). From there, you can create attachment points and parent FX to the attachment points.

Thanks alot, Allminoxy! Mifs are working flawlessly!

By the way, saving .mif file from the Viewer application just creates a blank .mif file (If I choose already existing weapon and just hit save).

So thats it for weapons, I guess.

Questions left:

  1. Viewer is able to see only models that are in .arc files. Must I copy my arcs over everytime, or there is a way to select working folder?
  2. How to be with armor? (And monsters probably)
  3. How do I make normal preview in Max? I mean, after applying shader, my model becomes black. What and where to I must copy files needed?
  4. I have a problem with glowing.

First one is IG, second one - inventory. I selected standardglowstatic shader (specularColor 0,0,0; specularPower 0.5; outlineThickness 1)

Where is my mistake? It looks ok on the other map, so it is connected to adjustment and other layers. How do I make it look normal here?

Many, many thanks !

Glad to hear it! We usually just copy .mifs from existing weapons to avoid having to make all the attach points again (they’re basically just text files). You might not be aware, but melee weapons have two anchor attach points (Anchor1 and Anchor2) One goes at the base of the blade and one at the top. These are used for the game to calculate weapon trails when the PC attacks. If you don’t have them on your weapon, you will not have any weapon trails in-game.

There is currently no way to select the working folder, unfortunately.

Not really sure how to answer this question. Both are a pretty complex process and depending on how familiar you are with rigging/animating, incredibly difficult to try to explain over a forum discussion.

Ah, forgot to mention this in the guide. Default Ambient light in Max is pure black, this does not play well with the ILShaders. Open your Env settings in Max (default hotkey is 8) then change your ambient color to a mid-tone gray.

Sort of hard to see what’s going on in those two images. It appears the glow isn’t showing up in-game, but it does in the character view. Is that what you’re saying? If so, I honestly can’t think of a good reason for that to occur. . .it’s possible it might just be differences in in-game lighting vs the character sheet. One way to test would be to place the sword in the editor and set the time of day to night. If the sword glows, then it is working properly.

As for the shader parameters, you might want the specular color to be something other than black (we usually use white or a desaturated blue). Specular power describes the tightness of the specularity. We usually use between 8-15 for most items, 20-30 for very shiny objects.

You’re welcome, hope you find it helpful!

I am familiar with that. Still I dont know bone/vertex groups names to be able to rig something :stuck_out_tongue:

Since monsters are having too many skeletons in total (I guess), it will be nice to have atleast male/female ones for rigging (I doubt that you are going to share all of them). Will you be able to share these precious skeletons with us?

And usually I get this result with white specular (almost the same with desaturated blue):

Setting ambient does not help me. When I import model (obj) it looks textured, but it becomes black after applying a shader. (Assigned standard textures, because plugin cant see my ones as they are not included in standard .arc) Also I tried adding light.

Ah, I forgot Max’s “Nitrous” viewport is enabled by default. I will add steps to the guide for reverting to Direct 3D in a bit.

If your model is showing up as too shiny using those settings, I’d recommend reducing the white values of your texture’s spec map, as well as the intensity of the normal map itself. The engine is a bit fussy with these things and it can be difficult to find the right balance. Note, if you have not included a spec map in the normal map’s alpha channel, I believe the engine defaults to all white, which is way too intense.

Finally, we’ve updated the Templates zip to include the basic setup/hierarchy of the male/female PC rigs. If you are familiar with the rigging process, hopefully these should be enough to get you up and running on armor! Just one thing to be aware of, you need to import the bones as dummies (see image in zip folder).

Ok. Everything works now in max, still I am missing the function to add my textures to the ‘working folder’ to render it here :stuck_out_tongue: (same problem goes to Viewer and PSEditor).

I am quite new to Max (12…), but why it automaticly moves my helmet back to the bone attached after I save and reload the project? It is pretty hard to adjust height because of that.

And I am supposed to leave skeleton (and maybe template obj model) here right? Just in that case file size is over 1mb and I wanted to avoid that…

I have an issue with the scene 3dsmax, everytime I build the .max it makes a .msh with only 74 octets (less than 1ko) and item is not diplayed.
Can anyone help me ?
I don’t understand what’s wrong.
Also I can’t select the texture, they don’t show in the ressource folder, because it doesn’t allow to go search into the mod directory.
I think the scale and position is right because I used the sword model to test it.
Thanks
EDIT :Solved, I deleted the associed file.

We’ll have to look into the issue of the mod folders not showing up for the shaders in Max/Viewer, etc.

This is the nature of the skin modifier (in max 2012 anyway). I’d recommend getting all the proportions/positions/scale finalized before you attach a skin modifier to your armor. Once you’re done, it’s also a good idea to reset the xforms on any mesh before skinning it.

Skeleton definitely needs to be in the scene - visible, template is just for reference and entirely optional. As long as the template mesh doesn’t have any IL shaders applied to it, the asset will not be built in the AM. Still, if you do leave it in the scene, I’d recommend hiding it in a layer for organizational purposes once you’re done.

Okami, looks like you have the IL Shader in your scene but it is not applied to the actual mesh. Once you apply it to the mesh, you should be able to build the msh asset correctly!

Thank you it works now !
I can now make a katana in game.
I just need to figure out the texture issue (I just added a test texutre the one for the sword1h now I will try to add my own because I couldn’t load the mod folder to be selected when browsing for .tex file inside Autodesk Max).

Use classic ones in max, but replace ‘base texture’ in your .dbr file, do the same for normal map/glow. (they are blank by default and use ones that you specified in max, but you are able to force it to use different ones by entering alternate path)

Hum…I will have to check this when I come back home.
I believe I changed the base texture inside the dbr file, but the ingame texture looks strange.I am not sure.
Anyways it’s good to know we can do this for normal map and glow as I have also those textures ready.

About the .mif file that tells the attachment points, how do we generate it inside 3ds max ?
Or is there a template of a mif file we could use to test things ?
I am interested to do .pfx for this weapon :wink: !

You dont need to create attachments in max. For example, use existning mif of a weapon with pfx (I used 1 handed sword 17c). Save its .mif file by using Viewer (create all the directories before saving it [source\geareweapons…etc], otherwise it will not work). You can change all the mifs values later.

Work well for me thank you guys ! It’s a pleasure such actives dev ^^ (I think it).

Icreated Grim Dawn\source\items\gearweapons\swords1h directory then used viewer to export Sword1h_017C.mif.
But the exported mif file are empty.

Nvm, here is mine .mif contents:

AttachPoint
{
name = “Anchor2”
origin = (-0.062149, -0.003161, -0.165337)
xAxis = (0.023299, -0.999729, 0.000000)
yAxis = (0.999729, 0.023299, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
AttachPoint
{
name = “Anchor1”
origin = (-0.076048, 0.000901, -1.358806)
xAxis = (0.070657, -0.997501, 0.000000)
yAxis = (0.997501, 0.070657, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
AttachPoint
{
name = “BladePFX”
origin = (-0.008883, 0.008458, -0.095107)
xAxis = (-0.006913, -3.599976, 0.000000)
yAxis = (0.008398, -0.000058, -0.999965)
zAxis = (0.999941, -0.006913, 0.008398)
}
CreateEntity
{
attach = “BladePFX”
entity = “Records\FX\ItemFX\MagicalFX\Swordfrost01_FX.dbr”
}