Well, you may have picked one of the ferry lines where I didn't write comments in. The DEF for the link between Hirtshals and Seyðisfjörður is as follows:

Code: Select all

```
SiiNunit
{
ferry_connection : conn.hirtshals.seydisfjord{
price: 3230
time: 2730
distance: 1777
# NODE POSITIONS ######## x*256 , 0, z*256
connection_positions[0]: ( -2272404, 0, -10723390)
connection_positions[1]: ( -9405763, 0, -17735767)
connection_positions[2]: (-12587853, 0, -22374825)
# NODE ROTATIONS ######## -sin(jaw), 0.0, -cos(jaw)
connection_directions[0]: (-0.860000, 0.0, -0.500000)
connection_directions[1]: (-0.707000, 0.0, -0.707000)
connection_directions[2]: (-0.860000, 0.0, -0.500000)
}
}
```

Now here you can see what math is behind it all. Do note that each pair of position and direction correspond to one intermediate point on the ferry (the start and end point are automatically determined in the game) and will be added to the ferry route in this order. Also, note that the direction is an angle conversion from degrees to co-ordinates on the unit circle.

**Mathematics intermission:** the co-ordinates (-0.707000, 0.0, -0.707000) corresponds to a 45° angle, since the X and Z co-ordinates are the same. The value may look familiar, because it's actually -½√2. One property of co-ordinates on a unit circle is that if you try to calculate the distance from the center of the circle (0,0) to any point on the unit circle, the distance is always exactly 1, and because of Pythagoras theorem, this has to mean that √(x² + z²) = 1. In this example:
√( (-½√2)² + (-½√2)² ) = √( 2 * (-½√2)² ) = √( 2 * ¼ * 2 ) = √1 = 1

*Isn't mathematics beautiful?*
To do the same for the route in the other direction, simply flip the signs on the directions and reverse the order of both the positions and directions.