[TUTORIAL] 3DSMax - Getting a simple ship in game


(Taiidan Republic Mod) #1

I feel like I’ve managed to get to grips with some of the example files now and I’m getting (a bit) confident at getting models into the game, so I thought why not try to share what I’ve learned? I’m not setting myself up as an expert, but hopefully this might help someone who is just starting out…

This tutorial describes how to replace the Kushan Scout with your new ship, by modifying the Kadeshi Swarmer example. This tutorial is aimed at a (relative) beginner.

Tools used in this tutorial:

  1. 3ds Max 2014 (or see here for the equivalent Blender tutorial)
  2. HODOR
  3. GIMP, for image processing. Could use photoshop or similar.

Other tutorials that build on what is covered here:
[TUTORIAL] Turrets
[TUTORIAL] Dock Paths and Latch Points
[TUTORIAL] Capital Ship Engines
[TUTORIAL] MAD Animations


[TUTORIAL] Blender - Getting a simple ship in game
Want to create my own mod =) (newbie), need help!
How do you make a ship texture
[TOOL] DAEnerys - DAE Ship Editor
[TUTORIAL] Turrets
[NEED HELP] 3DS Max DAE to HOD Error
[MOD] Star Wars: Remastered
[SOLVED] HODOR crashes on my .dae -- what am I missing?
[SOLVED] Help with getting first ship into game?
Beyond Confused (How do I get HODOR?)
Art Spam Facility
Modding tutorials Master Thread
[MOD] REARM V2 WIP thread
[TUTORIAL] Dock Paths and Latch Points
Modding tutorials Master Thread
(Taiidan Republic Mod) #2

+++ STEP 1 - IMPORT +++

Make a copy of all the files in the Kadeshi Swarmer example somewhere else on your hard drive. Import the .DAE file using File > Import. This is what you will see:

The most important things to look at first are “LOD0”, which is the visual model (what you will see in game) and “Collision mesh”, which is the physical model (this defines where missiles “hit” the ship, etc.). LOD = Level Of Detail, which is a hangover from older times and seems not to be used in HWR, so LOD1-3 are not needed for this example.

The second important things to look at are the white boxes (dummies). The dummies contain information like the positions of weapons, lights and engines.

The model also has a hierarchy, like a family tree, in which some items are linked to others. It is vital that this is correct, or the model will not work. Open a schematic view using Graph Editors > New Schematic View to take a look at the hierarchy of the objects. This is what you will see.

It looks pretty complicated, but that is partly because there are loads of bits and pieces that we don’t need. Delete LOD1-3, the hardpoint, the repair point, the salvage point. We won’t need any of those things for our Kushan Scout replacement. Now it should look like this:


(Taiidan Republic Mod) #3

+++ STEP 2 - TEST (optional) +++

We are going to replace the purple objects representing the visual model and the collision mesh (MULT and COL) with our own ship model.

But first if you want to you can test the example file by exporting the file as a DAE (name of your choice). Skip forward to step 4 to see how to create a HOD from the DAE file and to set up the HWR mod shortcut.

If you launch the game using your shortcut and build a scout, you should see your new Kushan Scout, which is actually a Swarmer!


(Taiidan Republic Mod) #4

+++ STEP 3 - MODELLING +++

Now you can add your own model to the scene, either by modelling it in 3ds Max or by importing a model you have made in some other 3d modelling software. My ship is a box, yours could be more interesting(!) In order to make sure that your model is facing the right way, you need to make sure that the blue axis of the pivot points forward. To change this, use the “Affect Pivot Only” option.

Hide the Swarmer collision mesh and the LOD0, and move your ship model on top of the root dummy. Create a clone of it and put it on top of the collision dummy (note that the pivot of your LOD0 model must lie on top of the JNT[P2Swarmer] dummy, likewise the pivot of your collision mesh must lie on top of the ROOT_COL dummy):

Move the weapon joints, the engine and the nav light to where you want them on your model (see above for my positions). Take care to only move the parent dummies, because the relative positions of the children are important.

Next, unhide the Swarmer LOD0 and apply its material to your ship. Do this by opening the compact material editor (Rendering > Material Editor > Compact Material Editor). Use the dropper on the Swarmer to get the material, and then apply it to your model. It will look a bit funny, but don’t worry we can sort that out later:

Now rename your models “MULT[P2Swarmer]_LOD[0]_TAGS[DoScar]” and “COL[Root]” and delete the Swarmer models. Now link your models with the dummies JNT[P2Swarmer] and ROOT_COL as follows (click on the chain and then click and drag from your model to the parent dummy):


EDIT: Since I wrote this tutorial, HWRM has changed and the game will no longer run with missing markers. So the following step needs to be applied:


(Taiidan Republic Mod) #5

+++ STEP 4 - EXPORT +++

Now we can export the model and try it out in the game!

First select on your ship model and your collision model, and use Utilities > Reset XForm on them:

Alternatively, you can convert everything to editable poly or similar (right click on each mesh, convert to > editable poly), but you will lose all the previous modifiers…

Export your scene as a DAE file, ensuring that you use “Centimeters” and uncheck the “Single Matrix” option:

If you didn’t do step 2, you now need to create a script for HODOR, which will control the transfer from DAE to HOD (which is the file used by the game). Paste the following into a text editor and save it as a “.hodor” file:

## TUTORIAL
= -$HWRM_BASE=C:\Program Files (x86)\Steam\steamapps
= -$SHIP_NAME=Kad_Swarmer
= -$SHADER_MAP=$[HWRM_BASE]\common\Homeworld\GBXTools\HODOR\SHADERS.MAP
= -$SHADE_OPT_LOADDAE=Force8888
= -$HOD_SAVE_OPTS=ForceScars FilterScars=thruster,bay
= -$CONVERT_IN=pathtoyourdaefile
= -$CONVERT_OUT=C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Data\ship\kus_scout\kus_scout.HOD
= -do=convert
= -action=null

The script tells HODOR to take your DAE file and create a HOD file in the appropriate area for the Kushan Scout within the HWR directories. Note: Force8888 produces a HOD file quickly, but it will be a big HOD file. When you are ready to produce your final HOD, change this parameter to ForceMAP, which will compress the texture files and produce a HOD with a more manageable file size

Next open a command window where HODOR is installed (if you subscribed to the example, you should have HODOR now) and type the following:

HODOR.exe -script=pathtoyourhodorscript

In order to run the game and see your modded scout, you will need to run the game with a command line option. To do this create a shortcut to HomeworldRM.exe and add the -overrideBigFile tag to the end. Mine looks like this:

"C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Bin\Release\HomeworldRM.exe" -overrideBigFile -dlccampaign HW2Campaign.big -campaign Ascension -moviepath DataHW2Campaign -mod compatibility.big

If you launch the game using your shortcut and build a scout, you should see your new Kushan Scout!

Coming next, texturing…


[TUTORIAL] Dock Paths and Latch Points
[TUTORIAL] Capital Ship Engines
(Taiidan Republic Mod) #6

+++ STEP 5 - TEXTURING +++

Basics texturing:

You may have noticed that the model now has a seemingly random distribution of colours and shapes across it, which look vaguely familiar. Thats because we have smeared the images that make up the texture (or paint scheme) of the Swarmer all over our model. To make things look a bit more sensible, we could do some UV mapping.

First, convert your model to an editable poly (right click on it, Convert To > Editable Poly). Select all the polygons that are not the engine and set the material ID to “1”. For the engine polygons, set the material ID to “2”:

Now add a “Mesh Select” modifier, select a polygon and add a “UVW Map” modifier. Expand the UV Map (+) and select the “gizmo”. As you move, rotate and scale the gizmo, you will notice that the image on your select face (or faces) changes. Manipulate it until you are happy and then move on to another face, by adding another mesh select and another UVW Map. I’ve started by using part of the existing Swarmer texture to make the front of my box ship look a bit cooler:

Of course eventually you will want to make your own textures. The easiest way to do this is to open the TGA files and in the GIMP have a play. I have found that the best thing to do after editing the TGA files is to use the “overwrite” option, rather than save as, because “overwrite” will keep the original settings and ensure compatability with HODOR.

Each texture file has a specific role, but each one covers the same area. For my box ship I have edited the “Kad_Swarmer_TEAM.TGA” and “Kad_Swarmer_STRP.TGA” files. In these two files, any white area becomes the team color or the stripe color selected by the player. It can help to import all the TGA files into GIMP on top of each other to make sure that everything lines up properly. Here’s my TEAM image overlaid on the DIFF image:

I also edited the STRP TGA file to add some stripes over the TEAM color. STRP will always be painted on top of TEAM. Here is the final result after DAE export and HODOR processing (Taiidan colors, yellow=team, red=stripe):


(Taiidan Republic Mod) #7

+++ STEP 6 - BADGE +++

The Kadeshi Swarmer example ship does not have a badge, so to add a badge we will need to do a bit of work. First, we will need to create a third material, which is identical to material 1. To do this using the slate material editor, shift click and drag material 1 and rename as “MAT[Kad_SwarmerBadge]_SHD[badge]”, assigning it to ID 3 as follows:

This material will display in exactly the same way as material 1, but the SHD[badge] in the name tells HODOR that a badge is going there.

Next, you will need a polygon or some polygons that form an approximate square where you want the badge to display. Add a “mesh select” modifier and use it to set the badge polygon(s) to material ID 3. Next, use a UVW Map as in step 5, but to the badge polygon(s) apply a second UVW Map and select channel 2:

Manipulate the gizmo of the second UVW Map to fill the square badge area. Note that you will not see anythimg while you are mapping, because there is no texture assigned to channel 2 - HODOR just knows it needs to put a badge there. Export the dae, convert to HOD and here is the result. I have put my badge in a slightly foolish place, so it isn’t very visible, but you get the idea:


[QUESTION] texturing team / stripe / badges
(Over Savior) #8

Uh… Hello Dom2. I checked some tutorials here, but still have some questions. I’m helping one team in 3d modelling and texturing. Can u please cotact me in Discord? Here’s my nickname: ArsenyZvonar#3933
Thx


(Taiidan Republic Mod) #9

It is better to ask your questions here because then others can benefit from the responses. Also you are more likely to get a quick answer on these forums - I don’t hang around on discord much…


(Over Savior) #10

It’d probably take a lot of time, but ok)
So we’re going to add some units on Gundam MOD. I grabbed one 3d model from UCGO, cleared it from little details. I just cant finally understand what I have to do now. Can I use this model in game without that badges? Now I just have to start making UV map or what? Because I seen that there’re some special things on model like collision box etc.


(Taiidan Republic Mod) #11
  1. you will need at least one material and a UV map. For that, just use Google to find 3dsmax or blender tutorials. If you get really stuck you can ask for help here.

  2. once you have a material and UV map, you need to rig your ship as above. The material needs to be called MAT[Kad_Swarmer]_SHD[ship]. A badge is not necessary. As a minimum, you need:

  • A main ship model
  • A collision mesh (can be a copy of your main ship model, but without a material)
  • The joints for the ship’s weapons as above

Follow the hierarchies in the tutorial to recreate the kadeshi swarmer for your first ship. When you get that working, you can move on to more complicated ships.

EDIT: have you downloaded the example ship? In the first place the easiest thing to do is use the example kad swarmer and just swap the model for your own model.


(Over Savior) #12

Ok, yet I understood :stuck_out_tongue:
But also this ship is Carrier and have no weapons.


(Taiidan Republic Mod) #13

Yes, but for your first ship, reproduce the Kadeshi Swarmer. Then you can move on to something else…

O n e
s t e p
a t
a
t i m e