[TUTORIAL] Dock Paths and Latch Points


(Taiidan Republic Mod) #1

This tutorial considers how to rig dock paths and latch points for a carrier. It is based on the Turanic Raider example ship. We will be replacing the Taiidan Carrier with the Turanic Raider carrier. See also [TUTORIAL] Getting a simple ship in game and [TUTORIAL] Turrets.

Tools used in this tutorial:

  1. 3ds Max 2014 (some other versions work, Blender is also a possibility)
  2. HODOR

[TUTORIAL] 3DSMax - Getting a simple ship in game
Modding tutorials Master Thread
[MOD] [WIP] UniBrick Mod (Name not final)
(Taiidan Republic Mod) #2

+++ STEP 1 - EXAMINING THE EXAMPLE SHIP +++

To start with, we will have a look at the dock paths already in the example file. Import the example ship DAE file of the Turanic Raider Carrier (tur_p1mothership) and open up the hierarchy. There are three dock paths specified (one “in” and two “out”). Let’s look at them. The first thing to note is the “HOLD_DOCK” dummy. It is located at the origin of the ship and all dock paths sit underneath it.

Firstly we have the root dummy of the first dock path, called “Dock[In]…” that dummy is also located at the origin - moving it introduces some weird relative positioning effects that are difficult to manage, so always put it on the origin unless you know what you are doing. The dock path itself is made of a series of “SEG” (segment) dummies as follows:

As shown above, the position and direction of the dummies determines the dock path. The name of the root dummy “DOCK[In]_Fam[Fighter, Corvette, Utility]” tells the game that this is a dock path for inbound fighters, corvettes and utility ships to follow. The ships will start at SEG0 and move through each segment until they reach the last one. They will then “disappear” into the hold (although by this stage they will already be inside the mesh). The name of each segment has several parameters that tell the ships how to behave. @EvilleJedi has listed some of these here based on the old tools, although the names of some parameters have changed…

Here are the HODOR formats for the above parameters:

DOCK[A]_Fam[B]_Flags[Exit Latch Anim Ajar]_Link[C]_MAD[D]

A = name of dock path
B = families of ships that use the path
C = name of linked path(s)
D = an integer, to link the animation?

SEG[X]_Tol[Y]_Spd[Z]_Flags[UseRot Unfocus Check Close Player Queue Clip ClearRes]

X = integer, from 0 to n, the number of the segment
Y = tolerance, the distance from the segment that the ship must pass
Z = speed of the ship as it passes the segment

If you are animating the dock path (a door or arm) you will need the Anim flag on the DOCK node. Use the Ajar flag if you want the door or arm to stay “open” while the ship is docked (e.g. the Kadeshi Fuel Pod arms). Do not use the Ajar flag if you want the door or arm to close (e.g. the mothership door). If using more than one dock path animation, you will need the MAD[] tag. For more information on the MAD tag, see the following thread:

Secondly, there are two “out” dock paths, for ships leaving the carrier. They are called “DOCK[Out]…” and “DOCK[Out1]…” You will notice that both can be used by fighters, corvettes and utility ships, so why two? Both dock paths can be used simultaneously, so having two dock paths means that the carrier can launch its strike craft twice as quickly, which has an impact on how effective it is in combat (for example when launching fighters after hypserspacing in).


(Taiidan Republic Mod) #3

+++ STEP 2 - CREATING FRIGATE DOCK PATHS +++

To create a new dock path we new to create a series of dummies as children of the “HOLD_DOCK” dummy. We are going to create an “in” path for frigates (for when frigates are retired into the carrier) and an “out” path for when the carrier builds new frigates. Create the dummies as shown in the image below (scene explorer view):

The names “InFrig” and “OutFrig” can be whatever you like. The paramters Tol and Spd define the tolerance (by how far are ships allowed to miss the point) and the speed of the ships. For an “in” path, the speeds and tolerances should generally decrease as the ships approach the hanger bay. For “out” paths the speeds should increase as the ships leave the hangar bay. I am using the “UseRot” parameter because I want the frigates to have the same orientations as the dummies. I am using a clip plane because the space where the frigates will spawn may not be large enough to hold all frigate types, so they would stick out through the engines, which would look bad.

Notice the “Link[…]” parameter, which is included in both paths. This parameter means that only one of the paths can be used at any one time, preventing inbound and outbound frigates from crashing into each other.

Once you have all the dummies created and in the correct hierarchy, place them in the dock paths you would like to set up:

InFrig:

OutFrig

Although the direction of my dock path changes (between vertical and horizontal, all the dummies are orientated in the same direction and the “UseRot” parameter is used, so the frigate will remain in the same orientation, but will move vertically.

Note: SEG[0] of the “in” path must be a certain distance from the ship in order to work, otherwise docking ships cannot reach the first segment of the dock path. It seems that trial and error is the only way to find the minimum distance…

EDIT: a few extra points to note:

  1. you can link to more than 1 our dock path. With this ship the is a case for linking all the in and out paths, since everything is using the same bay.

  2. resource collectors will be able to dock using the above path, but not if they are carrying any salvage. For this to work another family, “Resource”, needs to be added in the “Fam” tag.


Docking path questions
(Taiidan Republic Mod) #4

+++ STEP 3 - CREATING RESOURCE COLLECTOR LATCH POINTS +++

The latch points for resource collectors work in a similar way to dock paths - they also need to appear as children of the “HOLD_DOCK” dummy. Here are the dummies that I have used. The “Link[…]” parameter is vital here, because the game needs to know which “out” path to use once the resource collector has latched. I have only used one latch point, but multiple points can be used - just keep the names different and make sure the links are correct. EDIT: I have found that the previous statement is incorrect - the Latch paths need to be not linked. Based on the hgn_carrier example, I have set all the speeds to zero, which leads to slightly jerky movement, but it stops the collectors from running into each other and getting stuck…

Here is my arrangement of latch paths. I have selected an arbitrary point on the top of the ship, because there aren’t any obvious resource drop-off points on the Turanic Raider Carrier.

Note that the final SEG of the Latch In path is in the same location as SEG[0] of the Latch Out path, otherwise the collector will “jump” as it starts to exit.


[QUESTION] Ships overlapping when latched?
(Taiidan Republic Mod) #5

+++ STEP 4 - ADDING HARDPOINTS +++

Not really a dock paths step, but necessary… Finally, in order to replace the Taiidan Carrier without changing ships scripts, we need to add two hardpoints. Create the following dummies for the engine and resource drop-off hardpoints:

Position the engine dummies as follows:

Position the resource drop-off dummies somewhere near your latch point. Here are mine:


(Taiidan Republic Mod) #6

+++ STEP 5 - TEST +++

Export the HOD file to C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Data\ship\tai_carrier\tai_carrier.HOD (see here for details on HODOR and command line arguments for the game) and start the game…


(doci7) #7

Thanks for making this tutorial! It appears incredibly thorough, although at the moment I’ve only just glanced… my personal modding problems are way more remedial, so I’m just going to go ahead and ask:

[quote=“Dom2, post:6, topic:480853”]
Export the HOD file to C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Data\ship\tai_carrier\tai_carrier.HOD and start the game…
[/quote]Is that REALLY all it takes? Are there no override commands involved… you just mimic the folder hierarchy in the .big file and the game will automatically override the .big with whatever other files are in your folders? It’s these “simple no-brainer” questions that are keeping me from doing ANYTHING to Remastered.

Also, have you perchance used RODOH at all? I would love an extremely super-remedial step-by-step example tutorial on that which assumes absolutely zero knowledge of anything. Because here’s what I’ve learned about how to use RODOH so far:

  • I read what it does. So then I scroll down in search of how to actually use it
  • There’s an example prefaced by being inside a file called “Scan_Path.hodor”. But I don’t know how to open a file like that because it’s a command line program. So I figure the basics are probably all explained in the HODOR tool description.
  • Finding the HODOR thread I discover what it does. So I scroll down farther to figure out how to actually use it
  • I kinda muddle through an initial listing of features such as the containing of symbols like shader-blah-blah-backslash, STR contains symbols, pause, do=COMMAND, and other things that are probably awesome and super-helpful to people who have a clue
  • I arrive at the CONVERT heading and think I might finally be home-free. But there’s still no actual explanation of how to call up these kinds of commands in command prompt with what I would consider any kind of relevant context. Surely I couldn’t just open command prompt and type "-do=convert’ and expect it to have any idea what I’m talking about. Yes, there’s a more complete list of coding lines down a bit from there, but where and how do I get command prompt to understand that I’m trying to use this HODOR.exe that it’s supposed to compile (or run or whatever smart people call whatever it’s supposed to do)? There’s the HODOREST with the super-easy-helpful GUI, but it doesn’t appear to have RODOH functionality, so I am stuck trying to understand how to work these hacker-black-magic type applications.

I do wish to say that I mean no insult to the devs by summarizing their tool descriptions this way… I am extremely grateful that they have given us such tools and for pretty much everything they do. I simply am not sure that they can comprehend my level of ignorance in these matters.

Sorry that this is barely attached to the subject matter… in fact it probably isn’t attached to it at all anymore. But as a tutorial guy, I just hoped you could help me get past this level of modding proficiency:


(Taiidan Republic Mod) #8

No, that is not all it takes - See step 4 of [TUTORIAL] 3DSMax - Getting a simple ship in game for guidance on how to convert DAE > HOD using HODOR and command line arguments for launching the game. This tutorial sort of assumes that knowledge, maybe I’ll make that clearer…

I’ve not used RODOH, so I’m afraid I can’t help you there, but I know there are others here who can.


(REARM V2) #9

Soo, I presume you haven’t used HODOR yet? Files with .hodor are text files, scripts, with file paths in them etc. RODOH is used the same way as HODOR, it’s really the same thing. I used it once, I don’t need it, but I wanted to see what it does.
Send me a PM, we’ll figure it out.


(Sastrei) #10

Great start so far! You may want to use the Scene Explorer instead of schematic view for the hierarchy. It will show the full name that way.


(doci7) #11

Gosh, it must’ve been my defeatist attitude that caused me to completely not notice that pretty much everything I needed to know about how modding works now was in that STEP 4 post! That and the fact that at the time I was reading that tutorial I had no way of making a .DAE to convert anyway. I’ll see what I can do now… thanks for pointing me in the right direction!

@Pouk, I will definitely consult you if this ‘new information’ turns out to still not be lay-man enough for me. And LOL, no, I haven’t used HODOR yet. It’s all hacker-black-magic to me (or at least it was; hopefully not anymore!)


(Taiidan Republic Mod) #12

That is infinitely better. You have made a valuable contribution to my modding efforts!


(Xercodo) #13

Can I get the list of all flags I can use as they would be seen on the node name? @EvilleJedi did a great job of explaining what each one did but not how to use them when you;re doing this stuff manually :disappointed_relieved:


(Taiidan Republic Mod) #14

Here we are, all the ones I know of (there may be more):

DOCK[A]_Fam[B]_Flags[Exit Latch Anim Ajar]_Link[C]_MAD[D]

A = name of dock path
B = families of ships that use the path
C = name of linked path(s)
D = an integer, to link the animation?

SEG[X]_Tol[Y]_Spd[Z]_Flags[UseRot Unfocus Check Close Player Queue Clip ClearRes]

X = integer, from 0 to n, the number of the segment
Y = tolerance, the distance from the segment that the ship must pass
Z = speed of the ship as it passes the segment

Clearly you would not put all these in the same point in reality, but they are given in this format as an example!

No idea what “Ajar” does. Seems to be related to an animation like a door opening or a docking gantry extending.


(Xercodo) #15

Ahh interesting. Thanks. I would have guessed “Check Rotation” might have been “CheckRot”. And yeah I think Ajar would link to an anim while “anim” itself would indicate that it’s a dock path that should trigger animations on the ship docking/undocking?

O wait that should be a SEG flag huh? hmmm

Edit: no wait the anim on the ship that’s undocking would be something set up and defined on the ship itself…


(Taiidan Republic Mod) #16

Correct (I think) - any animation flags in the dock paths refer to the parent ship which is being docked with, not the ships docking.

I have made a few changes to the tutorial posts above in light of comments, listed here:

  1. linked to HODOR instructions in response to @Kragle’s post
  2. hierarchy views now use scene explorer - thanks to @sastrei for pointing this out
  3. listed all parameters in HODOR format as requested by @Xercodo
  4. made a couple of changes to the latch paths - noticed collectors were getting stuck due to an early ClearRes

(Xercodo) #17

Halp, at first they were working, but now none of my collectors will move once they hit the first point of…well any path, proper docking or a latch path. They undock fine though…

This is what my paths look like in the dae


(REARM V2) #18

Are you sure they hit it though? Because ships and formations will get stuck before they hit the first point, because they can’t reach the first point, if that point is inside the carrier’s collision sphere. Might that be your case? Is your first entry point far enough?


(Xercodo) #19

Yes, I know this because they worked before, I haven’t changed them significantly besides their flag and tolerances and speeds.

I can try moving them though


(Sastrei) #20

Tolerance zero seems like a bad idea…