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

Behaviour of Surrendered Captains

Indeed directly linking ship tier to her Captain level is something we very much want to do.
In fact, I'm hoping @Levis' work this weekend will help us forward in that direction. :woot
 
I think it is already done from what Levis said and the code he found?

Tier 5 if I understand correctly, would have (8-5) * 7= 21, and then slight randomization, and then a rank bonus for th epirate captain, so he should probably have faced a mid to high 20s level pirate captain.

If he is a beginning player, yes, he would be cut down by that level of captian, and should be.

Honestly, I'd say the only real use of mandatory duals is preventing exactly what he describes: a player stumbles upon a giant fight much above their level, and tries to steal a prize from the AI.

But better to make duals nonmandatory, and block the player stealing prize ships from the AI. Its not realistic, if some random bost tried to sneak up and claim a warships prize! Even if he was part of the battle, the rules of prize law would dictate that all ships within sight of a prize ship share in the prize, the player shouldn't get it all.

I'd almost treat this report as a feature request: block the player from seizing ships that the AI's firepower forced to surrender :) (onky problem is it seems hard to implement while not annoying the player when the ai steals his prize by firing the last shot...so probably leave this to roleplaying)
 
One thing though, he mentions he was on landlubber difficulty. Currently that doesn't (as far as I can see) give a reduction to ai captain level, wheras it does give a reduction for random enemies like bandits. So he might have been shocked that he got no difficulty decrease.

I did implement a difficulty modifier to ai captains for my experiment 2, so it would help with that.
 
I'm right here, you don't have to refer as "he" to me. It's only confusing. ;)

Also, could you kindly explain your formula for the level of enemy captains? Level 20 for a Tier 5 seems a bit over the top for me.

And what means "much above my level"? I was sailing in a Tier 6 ship with Level 12 or something like that and my skills allowed me to sail a Tier 5-Ship, just like the Brits. Was 3 Tier 6 (4 with me) against two Tier 5 and did a lot of the fighting. I also improved my gear at a weapons-merchant.
So if we would had shooted them with cannons, it would have been an easy win. They were already retreating.

So yes, I was quite annoyed that a captain from a ship just one Tier higher than mine was able to murder me like nothing on Landlubber. If it was against a Tier 1-captain then yes, I shouldn't be surprised. But only Tier 5?

Then the primary issue would be that your Leadership- and Sailing-Skills level up way too fast, so your character-level can't keep up with the availability of larger ships and their highlevel-captains, which also means that boardings are just too risky as a way to replace your current ship with a bigger one. And since you can just buy them (Provided you have the option set for offering all ships in shipyards), where is the point in boarding anymore?

At that point, where I reach Level 20, I'll possibly command a ship higher than Tier 5.

Which leads me to a feature-request: Let your character-level decide what Tiers he can use, not Leadership or Sailing.
 
Last edited:
It's a lot cheaper than buying a new ship, for a start. There's also the free cargo which means it's worth capturing ships even if you then plan to sell them rather than keep them.

Basically, don't board ships until you're suitably skilled and equipped. Then you can take on the enemy captains. I'm quite happy with the current system and routinely board enemy ships, whether to take something better as my own ship or just to sell off the prize ship and cargo. But if enemy captain ability isn't dependent on your chosen difficulty level then that's perhaps something which could be fixed - it should be easier on "Landlubber" than on "Swashbuckler"!
 
Here's the link to my experiment with captain level affected by difficulty level, if anyone want to try it (you can just winmerge that part if you don't like the consistent bandits or non magical luck): Mod Release - Experiment 2: consistent bandits, apply difficulty to AI captain skill, and non-magical luck | PiratesAhoy!

GAZ Vodnik: I didn't mean anything by saying "He", sorry about that. :)

Here is the formula currently in use for captain generation for most purposes (Levis is working on unifying everything to this sort of function):

First step:
int rank = (8-shipclass)*7;

So plugging in 5, we get 21.

Then some randomization happens, which on average returns a rank equal to 95% of that:

rank = rank*0.8 + 0.3*rand(rank);

So we end up at 20. Now, we account for some types of captains being better at combat, like navy vs weak merchants:

rank += GetOfficTypeRankBonus(SCaptain.quest.officertype);

We have to look at the officer types file for that, and there we find for pirates: OfficerTypes.(type).rankbonus = 8;

So we are now at level 28.

For a tier 5 pirate ship, that is very reasonable. Did you have professional fencer perk and decent melee skill? Maybe try a sword with high blocking rate? Once you have those you should be able to beat him even at level 12 or so. I still think it would be nice to make duals optional though.

Anyway, if you use my experiment, it would then do a final step of changing level for the difficulty level:

rank += (4*(GetDifficulty() - 2)); //TY added difficulty effect

That would have dropped landlubber captain by 4 levels. But that is not part of the main mod at the moment, I'm just trying to get feedback on it as an experiment.

At any rate, if you do decide to use my experiment, I'd love feedback on how the difficulty modifier feels, and whether you think it should be more or less dramatic.
 
Also, GAZ Vodnik, what sword were you using, what was your melee skill, and what fencing perks did you have? Knowing those, we can probably offer some advice so you can win even tough fights. :)
 
Last edited:
Took a stab at implementing @Homo eructus proposal for duals to only occur if the enemy captain has a very low reputation


Was looking into this. It is from the cabinfight_dialog.c, which I think is the right place. Anyway, we have:

Code:
//MAXIMUS: [if enemy captain is stronger than player, you'll fight with him] -->
   if(makeint(sti(PChar.skill.Leadership)+sti(PChar.skill.Fencing)+sti(PChar.skill.Grappling))>=makeint(sti(NPChar.skill.Leadership)+sti(NPChar.skill.Fencing)+sti(NPChar.skill.Grappling)))
   {
/*     if(CheckAttribute(boarding_enemy,"fight") && sti(boarding_enemy.fight)==1) bDeathFight = true;// if captain was created as fantom, but not by CreateTwinCharacter
     else
     {*/
       if(IsCharacterPerkOn(PChar, "SwordplayProfessional") && IsCharacterPerkOn(PChar, "IronWill")) bDeathFight = false;
       else
       {
         if(IsCharacterPerkOn(NPChar, "SwordplayProfessional") && IsCharacterPerkOn(NPChar, "IronWill")) bDeathFight = true;
         else bDeathFight = false;
       }
//     }//MAXIMUS: eliminated, because we can make a proper officer from any fantom
   }
   else { bDeathFight = true; }
   if(IsUsedAlliesModel(NPChar)) { bDeathFight = true; }//MAXIMUS: ally's twin will always be agressive [twin officers looks strange, not so?]
//MAXIMUS: [if enemy captain is stronger than player, you'll fight with him] <--

If I am reading that right, it adds the player's leadership, fencing, grappling, and compares that to the AI. If the AI wins, he always fights. If the player wins, no fight if the enemy doesn't have iron will and swordplay professional, or if the player has both.

And the captain always fights if the player already has an ally (officer?) that matches the captain's model.

Proposal:

1) Get rid of the check for same model as an ally, that is not a good reason to force a deathfight. Let the player make his own decisions about having a same model around.

2) I'm not even sure how an AI captain would magically know the player's skills, and I agree with Homo Erectus that attacking in this way seems dishonorable. So instead of the skills check, the AI captain only attacks if he is dishonorable and a professional fencer, and only at a 50% chance.

So the new code looks like:
Code:
if(frnd() < 0.5)
   {
         if(IsCharacterPerkOn(NPChar, "SwordplayProfessional") && GetCharacterReputation(NPChar) < REPUTATION_RASCAL) bDeathFight = true;
         else bDeathFight = false;
   }
   else { bDeathFight = false; }



Does that code look right?

@Homo eructus , is this what you had in mind? 50% chance of dishonorable captains attacking if they are professional fencers? Should capture many of the pirates and other disreputable sorts...

Obviously, we would want to look at also implementing Grey Roger's great dialogue trees later, but as a first step towards getting this in line with what was discussed, I think this works pretty good? Should improve the current system until someone has time to do a much more extensive rewrite. Duals will remain, but be suitably rare (and somewhat predictable, bloody pirates that might be hanged may choose to fight to the death, but others will usually accept their fate)

File attached.
 
Get rid of the check for same model as an ally, that is not a good reason to force a deathfight. Let the player make his own decisions about having a same model around.
That is part of @Maximus' efforts to avoid having duplicate character models as much as possible.
I always thought that bit at least was quite clever....

Obviously, we would want to look at also implementing Grey Roger's great dialogue trees later, but as a first step towards getting this in line with what was discussed, I think this works pretty good? Should improve the current system until someone has time to do a much more extensive rewrite.
Does seem to make at least a bit more sense. As a quick fix, that sounds al-right to me. :doff

Duals will remain, but be suitably rare (and somewhat predictable, bloody pirates that might be hanged may choose to fight to the death, but others will usually accept their fate)
Not predictable at all. At the moment, assignment of reputation is basically 100% random.
 
On the duplicate character, it does seem clever indeed, but won't the player end up doing things other than hiring most captured captains anyway? And isn't killing your officer's identical twin as weird as ransoming him?
 
I can reupload with that part uncommented and working again if you like. I might also temporarily change the reputation check to a check on whether the captain is a pirate in the meantime, to introduce predictability? Or maybe leave it as rep and wait until rep gets sorted out later? Let me know what you prefer and I'll make the changes.
 
At the moment, I have no major preferences.
I'm just giving you some background reasons, hoping that you can come to the best option yourself. ;)
 
Let me take the coward's way out and ask @Homo eructus : Given the "dishonorable captains only attack" idea was yours, what do you think?

Should we leave attacking as reputation check for dishonorable, even if reputation is currently assigned randomly? Or pending future changes, should we change it to be a Pirate captain thing? It is currently set at 50% if they are below rascal and have professional fencer.

Any opinion on the duplicate character models always attack thing? Rely on players to just change outfit for the officer if they hire them, or force the player to kill them?
 
For Companion Mutinies, it uses a check on both player and companion reputation:
Code:
           if(player_rep > REPUTATION_NEUTRAL && compan_rep < REPUTATION_NEUTRAL)
             moralemod = moralemod - (player_rep - compan_rep);
           if(player_rep < REPUTATION_NEUTRAL && compan_rep > REPUTATION_NEUTRAL)
             moralemod = moralemod - (compan_rep - player_rep);
Maybe something similar would work here?

The idea is that a good player and good NPC won't fight and neither will both who are bad.
They only would if they're on opposite ends of the reputation spectrum.
 
That makes a great deal of sense, I'll plan on adding it.

Combined with the 50% random check and the requirement the AI have professional fencer, it should eliminate much of what was bothersome to people about the old system.
 
@Pieter Boelen can you look at what I wrote and see if it does what I think it does?

What I am trying to do is: Duals only happen if ai captain has swordplay professional perk. If they do, then:

Pirates have a 50% chance of attacking (they don't want to be hanged)

Other captains have a 20% chance if they have opposite to player reputation. (to keep it suitably rare)

Did I write it correctly for that?

Code:
//TY Changed to check on AI reputation, skills, and piracy, and random chance, to engage in dishonorable act of attacking after surrender.

    if(IsCharacterPerkOn(NPChar, "SwordplayProfessional")
    {
        if(frnd() < 0.2)
        {
            if(GetCharacterReputation(PChar) > REPUTATION_NEUTRAL && GetCharacterReputation(NPChar) < REPUTATION_NEUTRAL)
            {bDeathFight = true;}
            if(GetCharacterReputation(PChar) < REPUTATION_NEUTRAL && GetCharacterReputation(NPChar) > REPUTATION_NEUTRAL)
            {bDeathFight = true;}
            else { bDeathFight = false; }
        }
        if(NPChar.nation=PIRATE)
        {
            if(frnd() < 0.5)
            {
                bDeathFight = true;
            }
            else bDeathFight = false;
        }
        else { bDeathFight = false; }
    }
    else { bDeathFight = false; }

I brought back the always attack if duplicate model to one of the player officers. Either way works for me, will comment out again if someone has a strong preference. Do people just change outfits for duplicate officers, or is it immersion breaking and better to kill them?

Aside from the code doing what I hope it does, does this general system make sense to everyone?

@Armada since you started this whole debate, what do you think?
 
Last edited:
Character attributes are saved as a string, but PIRATE refers to in integer #define (it is actually the number 3).
So use sti(NPChar.nation) to convert that stored string to an integer too.

Also, if 'bDeathFight' is already defined as false above, in your code you only need to mention the conditions that make it true instead.
Makes it a bit shorter. :doff

And I see an if-if-else construction.
Be aware that the 'else' there will override a 'true' on the first of unless you nest it between brackets.
Though if you remove it as per my suggestion above, that should take care of that.
 
Last edited:
I think I understand, I will correct the code accordingly and repost tomorrow, as well as incorporate any changes anyone suggests in the meantime. :)
 
Back
Top