• 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 Skills: System Rewrite for Performance

@Pieter Boelen if you have some time left could you try to see if the reset functions are called in the case you described. It should work. Maybe something isn't deleted right or so....
 
Also:

- Use officer-type effective skill for NPC captains or have them equal to the player and contributing ALL skills?
Seems fairer to have them contribute everything and have their officer type used only to determine what skills to prioritize on level-up.
Alternatively, perhaps apply the captain-type dependent contributions to the PLAYER as well?
That way even a maxed out player would STILL require officers to assist. Probably the most realistic, but may be controversial....

@Pieter Boelen if you have some time left could you try to see if the reset functions are called in the case you described. It should work. Maybe something isn't deleted right or so....
It just occurred that the Fleet Mali probably didn't work because I was on Arcade Game Mode.... :facepalm

However:
- Loaded that savegame I posted above
- Switch to Realistic Game Mode
- Give myself the QAR through console
- Game crashes

Most likely reason is that GetShipMinClassForCharacter calls GetPartySkill twice and therefore the game gets into an infinite loop.
Still have to think of a proper solution to that one! :shock
 
The simplest solution for the Fleet Mali is to group them together with the item bonuses.
That would make them personal so that extra officers cannot help.
Actually makes some sense because as Commander, should you not be having leadership yourself?
That also simplifies this when assigning companion officers.
Otherwise I'm not sure what would happen.
 
About the character interface. Why not show the fleet mali there also. If there is a decrease it shows your own skill level in red (and it shows the reduced level). I believe I should even be able to add a tooltip to this or something like that to explain it.
Could you explain how fleetmali works agian?
 
About the character interface. Why not show the fleet mali there also. If there is a decrease it shows your own skill level in red (and it shows the reduced level). I believe I should even be able to add a tooltip to this or something like that to explain it.
Since I have to rewrite that code anyway to prevent the game crashing in Realistic Game Mode(!), I will move it to the personal skills.
So then it'll just be incorporated in the second row of skill numbers under F2>Character.
I thought about changing the colour and adding a tool tip as well, but am not sure it is worth the effort.
If you'd like to expand on it once I've sorted out the basics, you're welcome to do so. I'll just focus on getting it functional at all.... :wp

Could you explain how fleetmali works agian?
If your ship is "too large" for your skills, your skills are reduced as a penalty.
Similarly, if you have a fleet before your skill allows, your skill are reduced by one as well.
 
Since I have to rewrite that code anyway to prevent the game crashing in Realistic Game Mode(!), I will move it to the personal skills.
So then it'll just be incorporated in the second row of skill numbers under F2>Character.
I thought about changing the colour and adding a tool tip as well, but am not sure it is worth the effort.
If you'd like to expand on it once I've sorted out the basics, you're welcome to do so. I'll just focus on getting it functional at all.... :wp

If your ship is "too large" for your skills, your skills are reduced as a penalty.
Similarly, if you have a fleet before your skill allows, your skill are reduced by one as well.
Okay, seems you have got this one down. I might look at it later indeed to make it more obvious :) lets first get it to work completly
 
Having it in personal skills does mean that none of your officers can help you to prevent this. But they do add their skills again later, so I think effectively it makes little difference.
But still, it is probably a bit different than it used to be. :shrug
 
Having it in personal skills does mean that none of your officers can help you to prevent this. But they do add their skills again later, so I think effectively it makes little difference.
But still, it is probably a bit different than it used to be. :shrug
You check the effective skill right?
It does seem fair to me to check the effective skill if its high enough.
 
You check the effective skill right?
It does seem fair to me to check the effective skill if its high enough.
I am placing the Fleet Mali check BEFORE the effective skill calculation so it is will always be applied to the FULL leadership and sailing skills.
This check will only affect captains who should contribute ALL their skills anyway.

If you also have any comments on the list I posted above, I would welcome it.... :wp
Fix in Progress - Stuttery Performance in 3D Sailing Mode due to Skill Checks | Page 16 | PiratesAhoy!
 
- "Fleet Mali" do not appear to work (got my Leadership 2 character a Tier 3 ship, but the Party Skill value in the Passengers interface still indicated 2 and isn't reduced)
- Party Skill has to be reset when you get a new ship in any way, because this may affect the "Fleet Mali"
You could do this in the same manner as the officertype. Just store the shiptype and num of ships in the skill. When this doesn't corespond anymore it needs to be reset.
- Does "Remove from Post" work? That one DELETES the "officertype" attribute!
Hmmm....need to look into that. It should put the officertype to a RandomNPC type.
- Does Auto Skill System OFF adding skill points also update everything correctly?
Yes
- ResetPartySkill uses FindCaptainIndex; does that work properly for NPCs or will that do weird things?
I hope it works right because I use it too for perks and such. I haven't seen anything weird when using it.
- We have to check all calls to GetPartySkill to check if those should not be replaced with GetEffectiveSkill or CalcCharacterSkill (depends on whether it is personal or not)
you can do that right?
 
You could do this in the same manner as the officertype. Just store the shiptype and num of ships in the skill. When this doesn't corespond anymore it needs to be reset.
I may do that. First need to get that Change Officer Role to actually WORK though.
It was sort-of half working for now....

Hmmm....need to look into that. It should put the officertype to a RandomNPC type.
A random NPC type that is NOT an actual officer type and therefore does NOT contribute anything?
Maybe just override and set to CIVILIAN?

Actually, I don't know why anyone would do this, but whatever....

I hope it works right because I use it too for perks and such. I haven't seen anything weird when using it.
Looking at that code, I don't remember seeing anything to specifically support NPCs.
Would you care to have a quick look? I think for NPCs, it should just return the character itself.

you can do that right?
I could, though I'd prefer if someone else could. Once everything else is operational, I'll post a request for that on the forum.
 
I had to put the Fleet Mali in the GetEffectiveSkillByValue function rather than the CalcSkillModifier one.
Reason being that I needed a reliable level below that to actually base it on; otherwise the game gets into an infinite loop and crashes.
This means that you do NOT get to see the effect of this in the F2>Character Interface, but ONLY under Passengers.
But at least it actually works and doesn't blow up the game.... :wp
 
Working through this further, that is actually NOT good enough. Your personal skill gets dragged down to 1, but then your skill isn't used because an officer's one is.
So you can be leadership 1 with a leadership 10 officer and you'll still get a party skill of 10 when sailing around a Tier 1 ship.
That's not right! Therefore I'm adding yet another "skill level" behind the scenes for "ship skills".

Also @Levis, I'm not sure if your clever "officer type change detector" is going to be enough now anymore.
It can be made to work from the Passengers Interface, but only because that one contains calls to the functions that trigger that check.
Dialog may be a different story. And the extra "Ship Skills" level doesn't simplify this either. :facepalm

EDIT:
Hmm, maybe it does work. Haven't yet been able to break it anyway.
This stuff is terribly complicated to think through and I'm tired after today.... :oops:
 
Last edited:
Another large update to the skills. See attached. Especially for @Levis' attention to look at the code, but should also be more playable still than yesterday's version.
This should auto-update skill contributions in most appropriate cases and also fixes the CTD on Realistic Game Mode that I caused yesterday.

It could be that skill numbers now don't always update when and how they should.
So during future testing, that will need to be checked.
 

Attachments

  • b14_b4b_SkillUpdatesV2.zip
    1.5 MB · Views: 95
These posts now moved to their

- We have to check all calls to GetPartySkill to check if those should not be replaced with GetShipSkill or CalcCharacterSkill (depends on whether it is personal or not)
DONE! In general, your officers help you out in interfaces (buy/sell prices, etc.) and at sea.
Most quests check your personal skills instead. Personal should also be used for everything involving fighting and Divide the Plunder mode.
Luck is a personal skill in most instances, but there are some exceptions, mainly dealing with boarding and escape chances at sea.

There are of course some exceptions to the above rule, but I did my best to choose the appropriate functions as good as I could.
Still, I'd welcome other people having a look through the code for those two functions with the next update to check if they agree.

From my side at least, this should be good, done and ready for testing! :cheers

EDIT: All relevant posts have now been split from their original spot here:
Fixed - Stuttery Performance in 3D Sailing Mode due to Skill Checks | PiratesAhoy!
 
The new system is now included in here: Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!

ALL the background systems to determine which skills contribute and which ones don't has been completely redone to improve performance.
However, it is very difficult to catch all instances, so I expected that not always the "secondary" skills under F2>Character
or the ones shown for the player under F2>Passengers will be updated correctly.
So please keep a VERY CRITICAL eye on this and let me know any examples you find where this isn't yet right so that those can be fixed as well. :woot
 
@Pieter Boelen when leveling up shouldn't the effective skill for the whole party be recalculated?
For example when one of your officers levels up in sailing and he is contributing this to you, your effective level should raise too. So when an character is bAllies() it should call for the party recalc right?

btw in the last version I changed it so during setup of the character the skills aren't recalculated everytime, and only after a character is completly set up it will recalc all skills. hope you don't mind.
 
@Pieter Boelen when leveling up shouldn't the effective skill for the whole party be recalculated?
It should already be doing that, no?
On a level-up, this function should be called:
Code:
// Reset effective skills
// Called on gaining a skill point in AddXPtoSkill AND when GetEffectiveSkill detects officer type has been changed
void ResetEffectiveSkill(ref character, string skillName)
{
   DeleteAttribute(character, "skill." + skillName + ".effective");
   ResetPartySkill(character, skillName);
}
That one then continues to reset the party AND the ship skills.

Actually, not specifically on levelling up, but on reaching another skill level.
That isn't necessarily in line with a level-up; not when I use the Cheatmode for it in any case.
 
Oh nevermind I was sleeping when I typed that I guess XD.
 
Back
Top