Hi. Thanks for the great mod GOF

.
I've just found this topic. I think it's possible to stop turning completly.
IN
AIShip.c,
void Ship_UpdateParameters(), before the line
fTRResult = Bring2Range(0.07, 0.95, 0.00001, 1.0, fTRResult); we have:
float fTRResult = fMaxSpeedY * fShipTurnRate * fTRFromSailState * fTRFromSpeed;
Result is a factor of:
-
fMaxSpeedY which depends on the Sea_TurnRateMagicNumber
-
fShipTurnRate which is the current turn rate with skills and perks
-
fTRFromSailState which depends on the sails damage
-
fTRFromSpeed which is the current ship speed with current wind speed
The lower these values the lower the result. If you change fTRFromSpeed to a 0 (zero) and comment out the line Bring2Range ... turning is disabled at all. So if you allow fTRFromSpeed to take values of 0 or close to 0, then result (turning speed) is close to 0.
I have tested it. Thanks to Jonathan Aldridge explanation about the Bring2Range function i understand that is the problem. That line is correcting result to a minimum value which makes turning always possible. Commenting it out and studying fTRFromSpeed values it's possible to prevent a stopped ship from turning, although i think a minimum value is always necessary to avoid ships completly halted.
NOTE: Where could i find a reference for the functions of this programming language?
EDIT: Ok, i have tested this change fTRResult = Bring2Range(0.00001, 0.95, 0.00001, 1.0, fTRResult); and results are quite acceptable. With lowered sails and speed 0, the turning rate is very very low. When sailing at a good speed and turning into the wind it's noticeable how the turning rate lowers when speed decreases. Still, i think i'm going to study the sea speed functions because something is wrong. When wind speed is high some ships can sail faster than wind, and some can sail directly into the wind with some speed.
About the sail hit points either the code is changed either we change all ships back to 100 Sp, because some values are 200, 250, 300 ,400 ...