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

Fixed Divide the Plunder Mode

I'm playing in "Realistic" mode, "Adventurer" difficulty. More to the point, I'm playing the "Assassin" storyline which hands you a super-xebec pretty well at the start, with a crew of 213. I suspect that by the time they're 400+ days into most other storylines, most players probably have something bigger with a larger crew who will indeed get upset if they haven't been paid by then. Having said that, I kept "Tales of a Sea Hawk" going for a long time under Beta 3.1 without paying the crew, and that would have been with a flushdeck frigate with about double the xebec's crew. Has the code for crew morale been changed in Beta 3.3?
 
the problem with the crew still asking for payment is the salery request we added for onshore things indeed. That should be an easy fix. Do you know where we added that pieter?

The moraldrop should be in daily update, i can take a look at it later.

What would be good numbers?
I can imagine a year without sharing the plunder would be the max if you had max morale at the start. After a year they should have a mutiny, does that sound right or should it be shorter? and how much should the difficulty affetc it?
 
the problem with the crew still asking for payment is the salery request we added for onshore things indeed. That should be an easy fix. Do you know where we added that pieter?
Can't remember where that was. I don't remember that issue ever being confirmed.

The moraldrop should be in daily update, i can take a look at it later.
It is indeed. :yes

What would be good numbers?
I can imagine a year without sharing the plunder would be the max if you had max morale at the start. After a year they should have a mutiny, does that sound right or should it be shorter? and how much should the difficulty affetc it?
The numbers are already defined. Normal expedition length is 180 days and after that the morale should start dropping.
 
There also seems to be a factor based on average crew share. Would I be right in guessing that you're safe until 180 days, after which morale drops at a rate based on crew share value?

My "problem" is that I have a crew of 213 and a current stash of about 12 million gold, so even after a year and a half, crew share value is pretty high. So long as I keep raking it in, crew share value stays high and they stay happy. The danger with trying to fix this is that a larger ship whose crew share value never gets that high may start to become unhappy on day 181 and go straight to mutiny on day 182, especially if it's part of a fleet of big ships as some people like to use. (I'm one of them after I've completed the main quest in "Tales of a Sea Hawk".)

The real problem, if you can call it that, is that I can make that kind of profit with such a small ship. With high Melee skill, a good sword and gold armour for myself and all the officers in my immediate company, I can capture pretty well anything afloat. The new improved "Landing Party" ability allows me to raid any town which doesn't have a fort, such as the pirate settlement at Nevis, simultaneously boosting both my cash total and my rating with any government from whom I have a Letter of Marque. The occasional town raid and the occasional galleon stuffed with valuable cargo keep the money flooding in, so as long as crew share value (and winning battles) has any effect on morale, I can probably keep going indefinitely without paying the crew a penny.

But I'll bet I couldn't keep going that long with the frigate which is my normal ship in "Tales of a Sea Hawk", let alone the Sovereign of the Seas...
 
could you post you .log files grey roger?
it seems the moral drops are documented in the logs so we can see how much the morale drops for you then and maybe make a better calculation.
 
AH! Definitely an error there. In PROGRAM\WorldMap\DailyCrewUpdate.c this line:
Code:
csr = csr * (2 * NormalExpLength / explength) - 1.0;     // 90 days=100, 120 days=50, 150 days=20
Should be this:
Code:
csr = csr * (2 * NormalExpLength / explength - 1.0);     // 90 days=100, 120 days=50, 150 days=20
Otherwise it doesn't do what it claims to do at all!

With the current code, morale would go UP after the 90th day, instead of DOWN as intended.
On day 180, you'd be back where you started, but it would still take forever to drop off properly.
In fact, it steadies out around 42% of normal morale instead.

With the corrected line, morale starts dropping fast after day 90 and by day 180 you will be having a mutiny on your hand.
This may sound tough, but remember that this IS how it was always intended to work.
And this only kicks in AFTER day 90. So you just have to make a good amount of money before that, then share the loot and everybody will be happy.

Now I'll be curious to find out what impact this will have on gameplay. And whether any other weird things are hidden in the morale code.
(Here's to hoping there isn't!!!)
 
Last edited:
it seems the important calculations happen here:
here the csr is determined
Code:
csr = GetCrewShareRatio(pchar);
            float NormalExpLength = NORMAL_EXP_LENGTH * EXP_LENGTH_START_FRAC;        // 180 * 0.5
            if (explength > NormalExpLength)
            {
                csr = csr * (2 * NormalExpLength / explength) - 1.0;        // 90 days=100, 120 days=50, 150 days=20
            }

Then the norm_moral is determined which is sort of the morale of your crew just basic.
It seems csr is getting lower with the longer your journey. with a 90 day journey it seems to be 2-1/100 while with a 150 journey its 2-1/20
so its somewhere between 2 and 1. CSR_SCALE is defined in the internal settings to be 45
Code:
if(csr > 1) csr = 2-(1/csr);
if(articles) { norm_morale = (100 - (CSR_SCALE*2))/2 + csr * CSR_SCALE; }
        else { norm_morale = norm_morale * SALARY_SCALE; }

so that would make norm_morale = (100 - (45*2))/2 + 1.99 * 45 = 5 + 89.55 = 94.55 with a 90 day journey
or norm_morale = (100 - (45*2))/2 + 1.95 * 45 = 5 + 87.75 = 92.75 with a 90 day journey

So the csr doesn't make that much of a difference here it seems

so I think to make the lenght of the day weight in more we should look at this line:
Code:
csr = 2-(1/csr)
cause this curve is wrong I think. the curve for the csr is slight bend as stated by this: 90 days=100, 120 days=50, 150 days=20
the csr starts to drop after the normalexplenght is exceeded (90 days in this case) and then goes down from 100 to a lower number.
I think the csr in the last code block should also go from 2 to 0 instead of 1.9 so it actually makes a difference. so that would mean it should be something like this:
Code:
csr = 2-((100-csr)/50)
altough that might be to linear so you could make it:
Code:
csr = 2-((10-sqrt(csr))/5)
to have a nicer curve.
Could someone change this in DailyCrewUpdate and see if it works out better?
in the document you can find this row
Code:
//trace("DailyCrewUpdate: old morale = " + pchar.Ship.Crew.Morale + ", norm_morale = " + norm_morale + ", moralemod = " + moralemod + ", moralech = " + moralech + ", new morale = " + morale);
remove the // in front to get some good data to the log files.
 
AH! Definitely an error there. In PROGRAM\WorldMap\DailyCrewUpdate.c this line:
Code:
csr = csr * (2 * NormalExpLength / explength) - 1.0;     // 90 days=100, 120 days=50, 150 days=20
Should be this:
Code:
csr = csr * (2 * NormalExpLength / explength - 1.0);     // 90 days=100, 120 days=50, 150 days=20
Otherwise it doesn't do what it claims to do at all!

@Pieter Boelen what is the difference?
 
Last edited by a moderator:
The position of the bracket. I checked the calculation using Excel and found that the old code didn't match with what the comment says it should be doing.
Moving the bracket fixes it so that it does match.
 
ah, could you upload a file with that fixed?
Maybe want to change my formula too but see for yourself :).
I'm still trying to get potc running again. for now I have done 2 clean installs already but still the new version isn't working ....
 
Attached is to be extracted to PROGRAM\WorldMap .

Also, I quoted the code snippet above wrong. Corrected now. They actually DID show as being identical. :facepalm

Maybe want to change my formula too but see for yourself :).
For starters, we should probably see what this change does. All that does is to make things work the way it was always intended.
If that doesn't seem right for gameplay, perhaps it should be tweaked further.

I don't know why, but all that morale code seems to have been thought out reasonably well.
But when I went into fixing it last year, I found that the code and the comments didn't in the way they worked.
Was like that for regular salary mode as well. The comments made sense, but the code turned out to do something else.
The effect was that all the morale features basically served very little purpose. :facepalm

I'm still trying to get potc running again. for now I have done 2 clean installs already but still the new version isn't working ....
What isn't working? Install should be as simple as it gets. Just put the two files together and off you go. :confused:
 

Attachments

  • DailyCrewUpdate.zip
    7.9 KB · Views: 85
The effect was that all the morale features basically served very little purpose. :facepalm

What isn't working? Install should be as simple as it gets. Just put the two files together and off you go. :confused:

I know, but as soon as I try to start a game it loads for a while and then gives me a CTD ... but I noticed my laptop suddenly has a intel graphics card while it used to have an ATI card before :p, so I'm going to look into that now.
 
That might explain it. Intel GFX card would crash the game as soon as the sea is loaded.
Unless you install the "Intel Fix" or get a normal GFX card again.
 
My above change should make the code work as intended now. So I'll consider this fixed for now.
Looking forward to feedback once the next modpack version is released. :doff

In the meantime, might be interesting for @Grey Roger to install my fix in his current install to see what effect it has.
If it works as intended, morale will start dropping straight after installing it. Just like it should!
 
My above change should make the code work as intended now. So I'll consider this fixed for now.
Looking forward to feedback once the next modpack version is released. :doff

In the meantime, might be interesting for @@Grey Roger to install my fix in his current install to see what effect it has.
If it works as intended, morale will start dropping straight after installing it. Just like it should!

Will that take effect at once or does it need a new game?
At once. :yes
 
You'll be pleased to hear that my crew are now thoroughly miserable. :rumgone I don't know whether this is an intended result of the code plus how long I've been at sea, but the crew share is now negative!

So now I need to find a loanshark. Is there one in the new expanded Havana? Because if there is, I haven't found it. If the time limit for dividing the plunder is now to be rigidly enforced, it might be a good idea to put loansharks in all towns so we can actually divide the plunder. ;) Otherwise I'm going to have to put the old version of the file back, head to Port Royale where I know there's a loanshark, then reinstate the new version of the file and finally actually pay the crew!
 
When I checked the formula using Excel, indeed I saw that if you wait with paying for too long, the CSR can indeed become negative.
Of course in regular play, you would have divided the plunder long before that would ever happen or you would have had a mutiny on your hand already.

The time limit isn't rigidly enforced now. But after 90 days out at sea, the crew will start becoming grumpy no matter how much money you amass.
If you don't like that number, it can be modified in PROGRAM\InternalSettings.h with the NORMAL_EXP_LENGTH and EXP_LENGTH_START_FRAC #defines.

If there isn't a loanshark in Havana, there should be. I though all towns DID have one added by now.
@Bartolomeu o Portugues: Can you confirm on this one?
 
Back
Top