• 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!

Economy and Iron Man stormy start

FlayedOne

Sailor Apprentice
Storm Modder
Hello guys, long time no see.

First of all I wanted to say you did an amazing job with the mod! I especially love the Iron Man mode and the new map!

Nonetheless economy desperately needs a rework:

a) The colonies tab prices randomly fluctuate daily by such a huge factor, that it is totally unpredictable what prices the tab will show the next day.
b) The prices in the colonies tab are false. The store has different prices than the ones shown. Also the store's prices do not seem to change (or they do very slowly).
c) if you visit a store, the prices on the colonies tab will change to the correct ones, but only until midnight!
d) the import / export difference is so small, that with low commerce and without the perks you will lose money 8 out of 10 times (unless you write down the prices on a piece of paper every time you visit a new port).
e) there are sell / buy prices for contraband goods in the colonies tab, but unless I'm missing something you can't buy from smugglers.
f) it seems to be impossible to make profit from smuggling? The prices are too low! Perhaps the "buy" price should be the selling price?
g) this might be related to the fact that I was sailing in a tartane, but after I spent enough time trying to trade to get my sailing skill to 4 my commerce skill is still stuck on 1. And it's the commerce skill that I chose to have a faster development.

Is there someone currently working on the economy? Perhaps I could help?


Another thing is that Iron Man stormy start seems impossible on higher difficulty levels. On lower difficulty levels one can buy some weapons and hunt bandits in the jungle for the money, but on swashbuckler it seems impossible.

I found a solution, but it's pretty much and exploit :p - buy enough cheap stuff so you have only a few gold on hand, and speak to people until you get robbed. Once you do try to extort a gem from the thief. If you fail, sell one piece of the cheap stuff you bought before and repeat. If you succeed you just made some 500 gold worth of items.

Perhaps some way of making small money on land is needed? Or is it already there and I missed it?
 
:ahoymate! You have been out to sea a long time indeed.

You are playing the beta 3.2 from your comments. Major changes were made to the economy in Beta 3.2 but they were never play tested enough to get them working properly. We are now working on a Beta 3.3 WIP that reverts back to the beta 3 economy. You might want to give that one a try.

It can be found here and I like it a lot. http://www.piratesahoy.net/threads/simplified-build-14-beta-3-3-wip-code.23064/
 
Ahoy there! Good to see you in these waters again. Always happy to see an old salt returning to our port.
Also very happy to hear what we've managed to do over the past few years.

Hylie already answered your economy-related concerns, so I won't do it again.
The Beta 3.3 WIP file should set things back to normal and be more playable in that respect.
The new system is pretty cool. IF it would work right. Which, at the moment, clearly it doesn't. :facepalm

Another thing is that Iron Man stormy start seems impossible on higher difficulty levels. On lower difficulty levels one can buy some weapons and hunt bandits in the jungle for the money, but on swashbuckler it seems impossible.
That is the "Evil Stormy Start" mod. And it is deliberately as evil as possible.
Originally it was a separate toggle, but I included it in Iron Man Game Mode, because otherwise nobody would even notice that feature is there!
Anyway, if you think it necessary, I can always put a separate toggle on it so you can switch it off in Iron Man Game Mode.
 
:ahoymate! You have been out to sea a long time indeed.

You are playing the beta 3.2 from your comments. Major changes were made to the economy in Beta 3.2 but they were never play tested enough to get them working properly. We are now working on a Beta 3.3 WIP that reverts back to the beta 3 economy. You might want to give that one a try.

It can be found here and I like it a lot. http://www.piratesahoy.net/threads/simplified-build-14-beta-3-3-wip-code.23064/

Thanks, I restarted using 3.3 WIP. I dunno if the economy is better yet, but at least the prices in the colony tab seem correct.

Ahoy there! Good to see you in these waters again. Always happy to see an old salt returning to our port.
Also very happy to hear what we've managed to do over the past few years.

Hylie already answered your economy-related concerns, so I won't do it again.
The Beta 3.3 WIP file should set things back to normal and be more playable in that respect.
The new system is pretty cool. IF it would work right. Which, at the moment, clearly it doesn't. :facepalm

Let me ask again: is the economy overhaul someones mod, or can I help?

That is the "Evil Stormy Start" mod. And it is deliberately as evil as possible.
Originally it was a separate toggle, but I included it in Iron Man Game Mode, because otherwise nobody would even notice that feature is there!
Anyway, if you think it necessary, I can always put a separate toggle on it so you can switch it off in Iron Man Game Mode.

I honestly don't know. I think the Evil Stormy Start is doable on lower difficulty levels, and only seems impossible on higher ones. OTOH perhaps I'm approaching it wrong - one probably could set sail in the tartane and collect random floatsome for profit. Extorting local thiefs for gems is fun though. I encountered two bugs though:

1. Sailing on a tartane uses no resources - the crew doesn't eat food or rum and repairing doesn't cost planks and sailcloth. I suspect that's due to rounding issues?
2. When you try to steal from someone and get caught, but immediately retreat into some other location (store for example) and return to the former location, sometimes the soldiers will be fighting the townsfolk.
 
Last edited:
The economy in Beta 3.2 is the idea of Levis. He introduced it last fall/winter and then disappeared. In his absence we had to revert to the old economy.

If you want to work on it by all means go ahead as it does have some small potential to liven up the game, but give us lots of time to playtest this major change.
 
Let me ask again: is the economy overhaul someones mod, or can I help?
Indeed that was @Levis' work, but real life has been keeping him occupied. Perhaps he'll come back, but perhaps not.
If you are able to look into his mods and see if you can sort out the rough edges, that would be much appreciated!
Just use WinMerge on Beta 3.2 and the Beta 3.3 WIP file to see his changes.

I honestly don't know. I think the Evil Stormy Start is doable on lower difficulty levels, and only seems impossible on higher ones. OTOH perhaps I'm approaching it wrong - one probably could set sail in the tartane and collect random floatsome for profit.
I can see how it would become even more evil, then.
Several simple options I can think of:
1. Disable Evil Stormy Start on Swashbuckler Difficulty (so it reverts to normal Stormy Start)
2. Create separate toggle for Evil Stormy Start (I'd like to avoid this)
3. Rework the game so that it DOES become doable (AGH! This would be PLENTY rebalancing work. Not recommended....)

1. Sailing on a tartane uses no resources - the crew doesn't eat food or rum and repairing doesn't cost planks and sailcloth. I suspect that's due to rounding issues?
Actually, it is on purpose because the Tartane is used as Lifeboat when your ship sinks.
That is why they are exempt from a lot of mods, because otherwise you sink, survive then keep getting mutiny after mutiny because the tartane doesn't have enough room many supplies. :facepalm
This is also why Tartanes cannot capsize in storms.

2. When you try to steal from someone and get caught, but immediately retreat into some other location (store for example) and return to the former location, sometimes the soldiers will be fighting the townsfolk.
I've seen ALL sorts of insane things happen with the AI groups. Sometimes it becomes seriously hilarious. :rofl
 
Indeed that was @Levis' work, but real life has been keeping him occupied. Perhaps he'll come back, but perhaps not.
If you are able to look into his mods and see if you can sort out the rough edges, that would be much appreciated!
Just use WinMerge on Beta 3.2 and the Beta 3.3 WIP file to see his changes.

I took a look at the code, but I still have no idea what it is supposed to do :p
Perhaps I have to dig deeper;)

I can see how it would become even more evil, then.
Several simple options I can think of:
1. Disable Evil Stormy Start on Swashbuckler Difficulty (so it reverts to normal Stormy Start)
2. Create separate toggle for Evil Stormy Start (I'd like to avoid this)
3. Rework the game so that it DOES become doable (AGH! This would be PLENTY rebalancing work. Not recommended....)

I would leave it as is. If someone starts Swashbuckler / Iron Man / Stormy Start than I suspect he welcomes the challenge and it is not like it cannot be done even without reloading. It's simply a lot of work and forces you to use exploits if you try to make money on land. Floatsome is the correct non-exploity answer though. If you can get enough money on land for a compass, just set out to some far away island and collect all the cargo / rafts / dismasted vessels along the way. One can easily make 5000-10000 during the trip from Cuba to Hispaniola this way.

Actually, it is on purpose because the Tartane is used as Lifeboat when your ship sinks.
That is why they are exempt from a lot of mods, because otherwise you sink, survive then keep getting mutiny after mutiny because the tartane doesn't have enough room many supplies. :facepalm
This is also why Tartanes cannot capsize in storms.

Well, it does make some sense, but the tartane has a cargo hold of 200 IIRC, so it's not that tiny and holds only a crew of 5. Wouldn't it be better to simply generate some random amount of food (like 1-6) and rum (0-3) when launching the tartane as lifeboat? Mutinies on life boats weren't exactly uncommon anyway - after all the captain lost the ship.

1. Also, I have more questions. What would you think about strong wind(25-30 knts) doing sail damage in Iron Man mode? Perhaps only when in the dead angle to represent the sails and lines being thrown around violently and decreased by the sailing skill.

It would force the player to be careful when sailing with strong winds, especially in small ships (small sail hps) and with an inexperienced captain, and being careful means less boredom.

2. Do I understand it correctly, that if you have for instance pirates chasing you and close enough to shoot at you in direct sail, you will not get 'Land Ho' message instead of getting close to the land? If so, that is a big problem, since you pretty much can't escape pirates by getting into the destination port.

3. Do you think the way the wind changes directions is realistic? In real life I've seen the wind stay the same for 2-3 days, but ingame the longest I've seen without changing direction was ~3 hours.

4. The books seem to have no effect on the skills (the ones with +1 to commerce in their description). Is it because of Iron Man? Also, the text of the 'boolean algebra' is freakishly hilarious! :D:D:D Kudos to the author!
 
Last edited:
1. Dunno if that could be done. I normally furl sails while tacking anyway so would probably never notice it.

2. That was changed because too many battles including quest battles were being terminated by the land ho call. It should be easy to enable that if wanted but I'm not sure where it is.

3. The wind is and always has been evil. There really isn't much we can do about it.

4. I've noticed that about the books also. That is another unfinished feature.
 
The books did contribute in the past, if I recall.
must have gotten broken.

Land Ho removes all ships around you.
So if you would be in a chase, it would be instantly over.

Sails take damage in storms.
To prevent those being boring, the is now the capsize mod.

For the lifeboat things, the reason is simplicity and not realism.
You need to get an actual chance if you survive after sinking.
 
This is where you get your lifeboat in PROGRAM\seadogs.c:
Code:
//ccc survival ->
void GameOverE()
{
   ref mc = GetMainCharacter();
   if(rand(100) + (sti(mc.skill.Sneak)*3) > DEATHRATE)   // BF mar05
   {   //ccc new survival section
// KK
     if (HasSubStr(mc.ship.type, "Tartane") == true || mc.ship.type == "Gunboat") {
       GameOverOrg("sea");
       DeleteSeaEnvironment();
       return;
     }
// <-- KK
     Event("DoInfoShower","sl","MainMenuLaunch",true);   //TIH - black out the screen to hide uglyjunk
     LAi_SetCurHPMax(mc);
     mc.ship.type = "Tartane1";
     Ship_CreateForCharacter(mc, mc.Ship.Type, "Lifeboat");   // ccc apr03 // KK
// KK -->
     SetCharacterGoods(mc, GOOD_BALLS, 0);
     SetCharacterGoods(mc, GOOD_GRAPES, 0);
     SetCharacterGoods(mc, GOOD_KNIPPELS, 0);
     AddCharacterGoods(mc, GOOD_WHEAT, 2);
     AddCharacterGoods(mc, GOOD_RUM, 2);
// <-- KK
     mc.lifeboatlaunch = true;   //TIH - better check for when they sank
     Sea_ReloadStart();
     PostEvent("DoInfoShower",100,"s","");   //TIH - clears black screen
     PlaySound("#ship_sinking");     //ccc mar20 // KK
     Log_SetStringToLog(TranslateString("","You manage to launch a boat in the last moment."));   //ccc mar20
     Log_SetStringToLog(TranslateString("","With a few mates you escape from disaster."));   //ccc mar20
   } else {   //ccc call original GameOver function
     GameOverOrg("sea");
     DeleteSeaEnvironment();
   }
}
I'd like to swap that "Tartane1" with "Tartane50" (Dinghy), but I seem to remember that caused trouble last time I tried. :facepalm
Anyway, you do get some supplies to hold you over.

This is where the "food consumption" is handled in PROGRAM\WorldMap\DailyCrewUpdate.c:
Code:
    bool CheckFood = FOOD_ON && CheckAttribute(pchar, "ship") && crewQ>0;
//     if(CheckFood) CheckFood = pchar.ship.type != "Tartane1" && pchar.ship.type != "Tartane2" && !CheckAttribute(pchar,"skipfood"); // both NK 04-11 to skip foodcheck // KK The crew doesn't eat when on tartane?

[...]

   //JA 1Dec06 reworked Food & Rum system -->
   //food
     int foodQ = GetSquadronGoods(pchar, GOOD_WHEAT);
     float foodRatio[4];
     int ft[4];
     ft[0]=0; ft[1] = 0; ft[2]=0; ft[3]=0;
     float foodused = 0;
     if(CheckFood) foodused = makefloat(crewQ) * FOOD_PER_CREW;
     float foodusedtemp = 0.0;
     if(CheckAttribute(pchar,"Crewstatus.foodused"))
     { //Add leftover food requirement from yesterday.
       if(CheckFood) { foodusedtemp = foodusedtemp + stf(pchar.Crewstatus.foodused); }
       pchar.Crewstatus.foodused = 0.0;
     }
     int foodrations = 1; //this is a divisor
     if(CheckAttribute(pchar,"Crewstatus.foodrations")) foodrations = sti(pchar.Crewstatus.foodrations);
     int food_daysleft = 999;
[...]
According to that, the crew should consume food when you have a tartane, because the line preventing that has been removed.
Are you sure you actually have crew? If not, then indeed there would be no consumption as per the code. But that makes sense.

As for wind direction changes, there are some relevant variables in PROGRAM\InternalSettings.h:
Code:
// ======================================
// WEATHER CONTROLS - JL
// ======================================

int     MAX_WBALLAST =           25;     // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
int     MAX_RBALLAST =           25;     // ^^DITTO for rain
int     MAX_FBALLAST =           25;     // ^^DITTO for fog
float   MAX_ABALLAST =           25.0;   // FLOAT - ^^DITTO for wind angle

int     MAX_WINDCHANGE =         5;     // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
int     MAX_FOGCHANGE =           5;     // INT - ^^DITTO for fog
int     MAX_RAINCHANGE =         5;     // INT - ^^DITTO for rain
#define MAX_ANGLECHANGE           1.0     // FLOAT - ^^DITTO for wind angle

#define FREE_FOG             1     // BOOL - Allow fog during daylight hours 0 - false 1 - true
And PROGRAM\NK.c:
Code:
// stljeffbb Jan 15 2012 -->
void InitOpenSeaMod()
{
   ref PChar = GetMainCharacter();
   if(iRealismMode>1 || OPEN_SEA_MOD)
   {
     DIRECTENCOUNTERCHANCE =                 25;     // chance in percent that an encounter fleet appears every hour
     DIRECTENCOUNTERDISTANCE =               2250;   // distance from player at which random ships appear
     ISLANDSWITCHDISTANCE =                 30000.0;// for islandcell mode only: distance from island at which transfer to neighbour island starts
     ENCOUNTERBREAK =                   3.0;   // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
     // so you can let the clock run faster (by increasing TIMESCALAR_SEA below), meaning longer voyagetimes, without getting too many encounters.

     TIMESCALAR_SEA =                   15;     // INT - how many seconds of gametime one second of realtime is at sea
     MAX_WBALLAST =                     10;     // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
     MAX_RBALLAST =                     10;     // ^^DITTO for rain
     MAX_FBALLAST =                     10;     // ^^DITTO for fog
     MAX_ABALLAST =                     10.0;   // FLOAT - ^^DITTO for wind angle

     MAX_WINDCHANGE =                    3;     // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
     MAX_FOGCHANGE =                      3;     // INT - ^^DITTO for fog
     MAX_RAINCHANGE =                    3;     // INT - ^^DITTO for rain

     COASTRAIDER_CHANCE =                  0.01;   // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates.
                                   // 0.0 : Stock PotC, no local ships at all
                                   // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
     NAVYRAIDER_CHANCE =                  2.0;    // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance
     MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER =       100.0;   // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
     MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION =   100.0;   // FLOAT - original value is 500
     RANGE_TO_ENEMY =                   3500;   // INT - in feet/yards/whatever unit the game uses.

     WDM_MAP_TO_SEA_SCALE =                 60;     // orig 19.607843 for this and next line
     WDM_MAP_TO_SEA_ENCOUNTERS_SCALE =           60;     // was 60 in build, 10.0 in stock. NK 05-04-30
   }
   else
   {
     DIRECTENCOUNTERCHANCE =                 50;     // chance in percent that an encounter fleet appears every hour
     DIRECTENCOUNTERDISTANCE =               1000;   // distance from player at which random ships appear
     ISLANDSWITCHDISTANCE =                 5000.0; // for islandcell mode only: distance from island at which transfer to neighbour island starts
     ENCOUNTERBREAK =                   1.0;   // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
     // so you can let the clock run faster (by increasing TIMESCALAR_SEA below), meaning longer voyagetimes, without getting too many encounters.

     TIMESCALAR_SEA =                    5;     // INT - how many seconds of gametime one second of realtime is at sea
     MAX_WBALLAST =                     25;     // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
     MAX_RBALLAST =                     25;     // ^^DITTO for rain
     MAX_FBALLAST =                     25;     // ^^DITTO for fog
     MAX_ABALLAST =                     25.0;   // FLOAT - ^^DITTO for wind angle

     MAX_WINDCHANGE =                   5;     // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
     MAX_FOGCHANGE =                     5;     // INT - ^^DITTO for fog
     MAX_RAINCHANGE =                   5;     // INT - ^^DITTO for rain

     COASTRAIDER_CHANCE =                  0.2;   // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates.
                                   // 0.0 : Stock PotC, no local ships at all
                                   // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
     NAVYRAIDER_CHANCE =                  0.4;    // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance
     MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER =       500.0;   // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
     MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION =   500.0;   // FLOAT - original value is 500
     RANGE_TO_ENEMY =                   3000;   // INT - in feet/yards/whatever unit the game uses.

     WDM_MAP_TO_SEA_SCALE =               19.607843;   // orig 19.607843 for this and next line
     WDM_MAP_TO_SEA_ENCOUNTERS_SCALE =         19.607843;   // was 60 in build, 10.0 in stock. NK 05-04-30
   }
}
// stljeffbb Jan 15 2012 <--
That MAX_ANGLECHANGE is in radians per hour, so that is a maximum of 57 degrees.
However, that is not supposed to actually happen regularly. If you want, you can set that to 0.5 and see if that makes any difference.

It would be cool if the weather system could be rewritten to take into account the trade winds and land/sea breezes and the like.
Though I suppose that will have to wait for inclusion in Hearts of Oak as it is too complicated to try on PotC.

I took a look at the code, but I still have no idea what it is supposed to do :p
Perhaps I have to dig deeper;)
Have a look through @Levis' forum threads for an explanation of what the code is supposed to do.
It is nearly correct, I think. But not quite. Quite fancy code too; I don't quite understand all of it just yet. :shock
 
Thanks for the code.

I made an unrelated discovery that I believe should resolve (at least mostly) the wierdness associated with Closest Point!
This function from AIShip seems to be the culprit:

Code:
float RS_CalcSpeedScalar(float fClosestPoint, float fBestPoint, string rigtype, float fOffWind, float fWindPower)
{
    float    fRBWMax = sqrt(sqrt(sqrt(fClosestPoint))) +0.02; //Max speedscalar running before the wind, as ratio of max speed. Constant.
    float    fBeam = 1 / (20 * sqrt(fClosestPoint ^ 3)) +0.3; //Max speedscalar on a beam reach. Derived from fClosestPoint for now. Constant.
    float    fTackSpeed = 1 / (sqrt(fClosestPoint) * 4); //minimum speed on a tack, i.e. speed at fOffWind = closestpoint - RS_CP_OFFSET. Constant.

    //begin speedscalar calcs
    float fTempSpeedZ = 1.0; // PRS3 and below
    //reorganized we only do one b2r calc.
    if (fOffWind > fBestPoint) {
        fTempSpeedZ = Bring2Range(1.0, fRBWMax, fBestPoint, 1.0, fOffWind); //scale speedscalar between best point of sail and running before the wind
    } else {
        if (fOffWind > 0.5) {
            fTempSpeedZ = Bring2Range(fBeam, 1.0, 0.5, fBestPoint, fOffWind); //scale speedscalar between beam reach and best point of sail
        } else {
            if (fOffWind > fClosestPoint + RS_CP_OFFSET) {
                fTempSpeedZ = Bring2Range(fTackSpeed, fBeam, fClosestPoint + RS_CP_OFFSET, 0.5, fOffWind); //fixed by Hook
            } else {
                if (fOffWind > fClosestPoint - RS_CP_OFFSET) {
                    fTempSpeedZ = Bring2Range(0.0, fTackSpeed, fClosestPoint - RS_CP_OFFSET, fClosestPoint + RS_CP_OFFSET, fOffWind); //ramp quickly from 0 to min speed with wind
                } else {
                    if (fClosestPoint > 0.2)
                        fTempSpeedZ = Bring2Range(RS_BACKWIND, 0.0, 0.0, fClosestPoint - RS_CP_OFFSET, fOffWind); //allow backwards travel
                    else
                        fTempSpeedZ = 0.0; //if not square rigged, can't be pushed back
                }
            }
        }
    }
 
    if (fTempSpeedZ > 1.0) //FlayedOne
    {
        fTempSpeedZ = 1.0
    }
    //end speedscalar calcs

    //begin calcs for fudge to offset EXE's speed scaling.
    float    fDivisor = RS_GetRigTypeDivisor(rigtype, fOffWind); // PRS3 yipes big typo 04-09-12
    //end fudge calcs

    //calc wind modifier based on ship weight--big ships can ride out storms and carry more canvas in them
    float fWindMod = fWindPower;
    /*if(fWindPower >= 1.0)
    {
        fWindMod -= (1 - fWindPower / sqrt(sqrt(arCharShip.Weight)) * 10);
        if(fWindMod < 0.25) fWindMod = 0.25;
    }*/

    //fudge deceleration -- seems to be not needed, but I'm not sure. So right now the implementation is commented out.
    //float fPreDecel = fTempScalar * fTempSpeedZ * fWindMod / fDivisor;
//    Log_SetStringToLog("PreD: " + arCharShip.MaxSpeedZ);
//    Log_SetStringToLog("Brk1: " + stf(rShip.InertiaBrakingZ));
//    rShip.InertiaBrakingZ = 0.75
//    Log_SetStringToLog("Brk2: " + stf(rShip.InertiaBrakingZ));
//    Log_SetStringToLog("AccBot: " + stf(rShip.InertiaAccelerationZ));
//    Log_SetStringToLog("SpdRt: " + fMaxSpeedZ);
    /*if(fPreDecel < arCharShip.MaxSpeedZ - stf(rShip.InertiaBrakingZ) && arCharShip.MaxSpeedZ - stf(rShip.InertiaBrakingZ) > 0 && arCharShip.MaxSpeedZ > 1.5) arCharShip.MaxSpeedZ = arCharShip.MaxSpeedZ - stf(rShip.InertiaBrakingZ);
    else*/
    return (RS_SCALAR* fTempSpeedZ * fWindMod / fDivisor);

}
Have a look at fRBWMax, fBeam and fTackSpeed calculated for different closest points:

Code:
fRBWMax(0.1) = 0,7698
fBeam(0.1) = 1,8812
fTackSpeed(0,1) = 0,7905

fRBWMax(0.15) = 0,9888
fBeam(0.15) = 1,1607
fTackSpeed(0,15) = 0,6455

fRBWMax(0.2) = 1,0176
fBeam(0.2) = 0,8590
fTackSpeed(0,2) = 0,5590

fRBWMax(0.25) = 0,86
fBeam(0.25) = 0,7
fTackSpeed(0,25) = 0,5

No wonder anything with the closest point lower than 0.17 had an unnaturally high speed.

I uploaded a quick fix for the issue with the simplest approach - if (fTempSpeedZ>1) fTempSpeedZ = 1. I playtested it for the last hour with a bermuda sloop with stays and it seems to behave correctly with regards to speed. In the file I deleted the if (closest point<0.15) closest point=0.15 condition to boot - the sloop has closest point <0.15.

In case you wondered - here's how the final speed is calculated:
Code:
arCharShip.MaxSpeedZ = fMaxSpeedZ * RS_CalcSpeedScalar(fClosestPoint, fBestPoint, rigtype, fOffWind, fWindPower) * fK * fSpeedPerk;

where:
- fSpeedPerk is 1.15 if the char has the ability affecting sailing speed, 1.0 otherwise
- fMaxSpeedZ is the max speed of the ship
- fK is a float which represents how loaded is the ship

What surprised me is that Sailing skill seems to have no effect.
 

Attachments

  • AIShip.c
    215 KB · Views: 114
Last edited:
I don't understand. A higher sailing skill does affect speed, both in max speed and especially turning speed. I have not tried this new file yet.
 
I don't understand. A higher sailing skill does affect speed, both in max speed and especially turning speed. I have not tried this new file yet.

I can see the skill affecting turning speed in the code, but I can't see where it would affect the max speed.
That doesn't mean it doesn't - I may simply not be able to see it.

Are you sure it does?
 
Well, if max speed is not affected by sailing skill, then I have been wrong for years. I tend to improve faster than my officers and if they don't have the speed increase perk I sail away from them even though I give myself the slowest ship.
 
What can I say? I was sure it affects the speed as well.

Since everyone thinks it does we could add the effect anyway - for instance 1.1 multiplier at skill level of 10? 1.2 seems a bit too much for me... or is it? It would make buying items with +sailing really worthwhile.
 
Hmm. Those perks seem overpowered where they are now. I go for the chronometer, sextant, and enhanced compass ASAP so I can see my ship on the map. Those items combined with the officers not using the stuff I give them gives me a big edge, as in they often need a ship 1.5-2 knots faster than mine just to keep up.
 
Pretty sure there are 1 or 2 abilities that are supposed to affect sailing speed.
 
Well, what does the sailing skill do if it does not affect speed? Does it only affect turning?
 
I think the sailing skill affects speed as well. Time-consuming to figure it out in the code though.
 
Back
Top