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

WIP Use Generic Captain and Ship Generation Functions

I think if it is a small chance, then captains occasionally being too good isn't a big deal at all, but it shouldn't be too regular.
I was thinking more along the line of: NOT having that is probably easier than to do have it. ;)
 
Oh, I'm fine not having it--I don't think it is needed or even beneficial. Plus, anything to get this feature in the game soon. :)

I really like the idea of enemy levels not being based on player level, and instead being based entirely on the strength of the enemy ship.
 
Last edited:
This is a planned feature but I'm waiting with it untill another public release has been done because this will require a lot of testing. In the meantime I'm trying to tidy up functions already etc so it will be easier to implement. Still in the end I will have to rework the whole encounter generation in potc ... which is going to be quite a pain XD.
 
Still in the end I will have to rework the whole encounter generation in potc
Why? The only thing that's needed is to initialize the captains using the same shared routines, similar to what I did already for the Quest Captains.
The only real difficulty is to pass the captains through Levelling until they can command the ship they've been assigned to.
Everything else should be quite straightforward, really.
 
Why? The only thing that's needed is to initialize the captains using the same shared routines, similar to what I did already for the Quest Captains.
The only real difficulty is to pass the captains through Levelling until they can command the ship they've been assigned to.
Everything else should be quite straightforward, really.
at the moment ships generated in direct sail are generated by a completly different function then ships generated by the world map encounters, and ships which are round the island coasts are generated by something else again.
I would at least need to dive in those 3 functions and see how it works ...
 
at the moment ships generated in direct sail are generated by a completly different function then ships generated by the world map encounters, and ships which are round the island coasts are generated by something else again.
I've had to dive into those several times last year to fix stuff related to Levelling, so I know how they work.
If you can sort out some sort of "level up until fit to command assigned ship" logic, the rest is quite doable and if I could find the time, I could even set that up myself.
After all, I've done it before with the Quest Captains already and that worked out fine in the end.
 
I've had to dive into those several times last year to fix stuff related to Levelling, so I know how they work.
If you can sort out some sort of "level up until fit to command assigned ship" logic, the rest is quite doable and if I could find the time, I could even set that up myself.
After all, I've done it before with the Quest Captains already and that worked out fine in the end.
ok... then probably it shouldn't be such a problem.
Still I wait with it untill after the public release I think.
 
Levis, just curious, but didn't you have a non-leveled version where enemy boarders depend on enemy ship class in your post here?

"Please test this to see if it's good enough already.
I think we still need to work on the ratio of boarders etc. I haven't touched that yet. I've only changed the levels now to be depended of the shipclass again.
Mod Release - Levis' Stuff [Nov 27] | PiratesAhoy! "

from: Fix in Progress - Level of boarding enemies | Page 2 | PiratesAhoy!

Just wondering the connection between that system and what is being considered now.

I really LOVE the idea of enemy boarders depending on the enemy ship and not the player level, I hate things depending on player level. :)
 
The enemy boarder level depends on the enemy Captain.
Once he's linked to his own ship, that should do the trick. :cheeky
 
I see! So only one link in the chain left, to remove the dependency on player level from captains. Awesome, can't wait! :)
 
@Levis @Pieter Boelen

Sorry to ask, but could I ask for guidance?

In the interim while the current system is in place, I want to (just for my own enjoyment in the meantime, not for any reason related to the mod) make the game think I am level 30 always for all ship captains that are currently tied to the player level.

Could you point me to which functions to change to make:
Direct sail/worldmap/coastraider ships all think I am level 30 when their captains (and hence their boarders) generate, always?

I think I should just be able to plug a "30" into the formula where it looks up player level for those specific functions, but I haven't had luck yet searching on my own for where to do this. :(

I know this isn't a good solution, but I just want it for my own enjoyment in the meantime. I like challange, but hate leveled worlds and want to feel like I'm catching up, and my guy is level 18 now, so I'm ready for some challange, and can focus on smaller ships at first. ;)

EDIT: The only thing I could find on my own is some commented out code in Sea.c using sti(rPlayer.rank) to get the player level, but it was all commented out and searching for that term didn't lead anywhere else.
 
Last edited:
easiest way, just enable cheatmode and level yourself up to level 30
 
Hi Levis,

It would be easiest, but I don't want to be level 30, I want to have to earn it, and I want the captains to be tougher than I am. Also, then the captains would level up with me when I leveled up, so it wouldn't be static either.

Basically, I want a big fixed challenge for now, above my level, that I can eventually catch up to. :)

Can you point me the right direction of the sort of file and function I am looking for? I spent a while looking without luck. No rush though, I understand if you are busy right now :)
 
Last edited:
@Pieter Boelen when looking at the code I got the feeling this should already happen.
The rank of the captain is determined by this function:
Code:
int GetCaptainRank(ref SCaptain)
{
    int shipclass = GetCharacterShipClass(SCaptain);
    //Class 8 ship should have a rank 1 captain. A class 1 ship should have something round a rank 40 captain.
    int rank = (8-shipclass)*7;
    rank = rank*0.8 + 0.3*rand(rank);
    rank += GetOfficTypeRankBonus(SCaptain.quest.officertype);
    if(rank < 1) rank = 1;
    return rank;
}

So unless the shipclass can't be determined I think the captain should already be based on the shipclass.
 
I see nothing there to ensure the captain has the Sailing and Leadership skill to command his own ship?

But indeed, it does look to be tied to ship tier.
Where is that function called from?
 
Question (just curious): from looking at that code, does difficulty level not raise the captain level as a small multiplier or something? Or is that handled elsewhere in the code, where the difficulty level takes a second pass to make them tougher?
 
Question (just curious): from looking at that code, does difficulty level not raise the captain level as a small multiplier or something? Or is that handled elsewhere in the code, where the difficulty level takes a second pass to make them tougher?
As far as I know the ship class is determined by the difficulty already so the captain is sort of done by that also.


I see nothing there to ensure the captain has the Sailing and Leadership skill to command his own ship?
Indeed that doesn't seem to be in place. I could write a function after the init of the captain wich levels his sailing and leadership to be right.

But indeed, it does look to be tied to ship tier.
Where is that function called from?
It's called from:
Fantom_AddFantomCharacter
Which I believe is used for encounters etc.
And it's called from:
SetCoastTraffic
which is used to make coast traffic
 
Ship tier in encounters is not affected by difficulty. :no

And probably shouldn't be--I wouldn't want to play on a higher difficulty if it meant the sea became less varied and diverse in terms of ship sizes and types. :) There should be the same ships, just better captains.

Perhaps a modest (0.9 + ((difficultylevel - 1) / 10)) modifier to scale up captain level?

So a swashbuckler captain would be 20% higher level than normal, and the lowest difficulty level would get a 10% reduction to make it easier.

Thanks for looking this up Levis. Really nice to know the ships are already not leveled in direct sail and coastal raider encounters! Fun! :)
 
Back
Top