• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Working on ships_init.c

Doober

Buccaneer
Storm Modder
Does anyone know what this code is for?

refShip.RigType = "Gat"

I am trying to understand the rigging code better, but this doesn't seem to go with any ship unless is overrides the "Fri" rigtype for frigates. Anyone have any ideas on this?
 
The RigType is used for setting the ClosestPoint and BestPoint values.
ClosestPoint is the closest angle the ship can sail into the wind (in radians, I suspect).
BestPoint is the point of the wind where the ship makes the best speed (also in radians, I think).

There's also some code in place to auto-aim lower on Xebecs to prevent shooting over them,
which is triggered by the RigType "Xebec".

Then there's some additional code for RigType hidden in SEA_AI\AIShip.c:
Code:
// NK realistic sailing -->
float RS_GetRigTypeDivisor(string sDet, float fOffWind)
{
float fDivisor = 1.0;
switch(sDet)
{
case "Fsc": return(RS_GetRigTypeDivisor("Gat", fOffWind) + RS_GetRigTypeDivisor("Slo", fOffWind))/2; break; // NK new div for JMV's fast sch.
case "shn": return RS_GetRigTypeDivisor("bri", fOffWind); break; //return(RS_GetRigTypeDivisor("Gat", fOffWind) + RS_GetRigTypeDivisor("Slo", fOffWind))/2; break; // NK new div for AM shnyava
case "btn": return(RS_GetRigTypeDivisor("bri", fOffWind) + RS_GetRigTypeDivisor("Slo", fOffWind))/2; break; // NK new div for AM brigantine
case "Xeb":
if(fOffWind > 0.01) { fDivisor = sqrt(sqrt(sqrt(sqrt((fOffWind * 0.9) ^ 3)))) * 0.9785; }
else { fDivisor = 0.25; }
break;

case "Tar":
if(fOffWind > 0.01) { fDivisor = sqrt(sqrt(sqrt(sqrt((fOffWind * 0.9) ^ 3)))) * 0.9785; }
else { fDivisor = 0.25; }
break;

case "Sch":
if(fOffWind > 0.01) { fDivisor = sqrt(sqrt(sqrt(sqrt((fOffWind * 0.9) ^ 3)))) * 0.9785; }
else { fDivisor = 0.25; }
break;

case "Lug":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.38; }
break;

case "Gal":
if(fOffWind > 0.01) { fDivisor = 0.7467 * fOffWind ^ 3 - 1.9657*fOffWind ^ 2 + 1.839*fOffWind + 0.3803; }
else { fDivisor = 0.38; }
break;

case "Gat":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.38; }
break;

case "Cor":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.39; }
break;

case "Car":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.39; }
break;

case "Bar":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.39; }
break;

case "Yac":
if(fOffWind > 0.01) { fDivisor = 1.2433*fOffWind ^ 3 - 2.7092*fOffWind ^ 2 + 2.0879*fOffWind + 0.3779; }
else { fDivisor = 0.39; }
break;

//default:  // scheffnow - bfd
if(fOffWind > 0.01) { fDivisor = 0.7467 * fOffWind ^ 3 - 1.9657*fOffWind ^ 2 + 1.839*fOffWind + 0.3803; }
else { fDivisor = 0.38; }
}
return fDivisor;
}
That looks a bit too complicated for me to understand. :razz
 
Yes, my understanding is that unless a ship specifically has a rigtype designated, it will look at the shiptype and use that determine rigging. The only thing is that with a "Fri" rigtype and a "gat" rigtype, I'm not sure which one the frigate is looking towards and also why there would be the distinction between the two. The only thing I can think of is that the light frigate (called a corvfrig) is pulling the "fri" designation while all other frigates are pulling the "gat" designation. If this is the case, it doesn't make much sense that a regular frigate could sail closer to the wind than a light frigate.

Just my musings, if anyone has any thoughts on it, I would love to know.

The other question I had was that the ships seem to carry heavier guns in the game than what they did in real life. If the other modders are interested, I can do the research on the ships and correct that, the only thing is that people might think that the ships are a tad under gunned as very few ships ever carried 32 lb guns and even 24 lb guns were rare. Frigates generally carried 12 lb cannons. Even if a ship did carry the big heavy guns, they usually only carried a few of them with the rest being lower caliber. Any opinions on adjusting the guns?
 
I have moved this thread to the Build Alpha & Brainstorming forum so that everybody can pitch in.
Personally I don't have much knowledge on rigging or historical cannon affairs,
but I'm hoping somebody else can give you some useful feedback. :onya
 
If the other modders are interested, I can do the research on the ships and correct that,...
That would be great, mate!

And you´re right, most common guns on frigates until the end of the 18th century were indeed 9 or 12 pounders. Here´s an list of english ships and their armarment, hope this helps :)

http://en.wikipedia.org/wiki/List_of_frigate_classes_of_the_Royal_Navy

Btw, the first real 24 pounder frigates (not razees) were the swedish Bellona class frigates in the 1790s, followed by the french Forte-class and the english Endymion.
 
Back
Top