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

Feature Request Shared XP Discussion

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
This is how shared XP is handled now
Code:
//Now handle the officers
    if(group == XP_GROUP_OFFIC)
    {
        float skillmult, tempmult;
        capt = GetCharacter(FindCaptainIndex(chref));                                                // Get the captain of the ship
        for(i=-1; i < GetPassengersQuantity(capt); i++)                                                // Start at -1 to include captain
        {
            if (i == -1)    cn = sti(capt.index);                                                    // Captain of the group
            else            cn = GetPassenger(capt, i);                                                // Passenger of this character
            if (cn < 0)                                                    continue;                    // Skip invalid characters
            chr = GetCharacter(cn);                                                                    // Reference to the character
            if (CheckAttribute(chr,"prisoned") && sti(chr.prisoned))    continue;                    // Filter prisoned characters
            if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Loop "+i+", Checking Officer "+GetMySimpleName(chr)+" with id "+chr.id);

            // Determine Skill Multiplier for this character
            skillmult = 0.0;
            if (cn == sti(chref.index))                                            skillmult = 1.0;    // The character who gained the XP gets 100%
            if (expName == "")                                                    skillmult = 1.0;    // All characters join in "general XP"
            if (expName == SKILL_FENCING)                                                            // Fencing is a personal skill and should be handled differently
            {
                if (skillmult < 0.5 && bAllies(chref) && IsOfficer(chr))    skillmult = 0.5;    // Character is in the player shore party
            }
            else                                                                                    // For any non-personal skills
            {
                tempmult = GetOfficerSkillFactor(chr, expName);                                        // This means some officers can get 200% XP!
                if (skillmult < tempmult) skillMult = tempmult;                                        // The officer who gains the XP will ALWAYS get it
            }
            if (IsMainCharacter(chr))                                                                // Special case for the player, because you cannot focus on all skills at the same time
            {
                skillmult = 0.5;                                                                    // Only 50% of all skills
                if (expName == SKILL_LEADERSHIP)                                skillmult = 1.0;    // But a captain MUST know how to lead a crew
                if (expName == SKILL_SAILING)                                    skillmult = 1.0;    // And navigate a ship
            }
            if (skillmult < 0.5 && SharedXP)                                    skillmult = 0.5;    // Sharing XP, so everybody gets at least 50%
            if(DEBUG_EXPERIENCE>1) Trace("XP LOG: skillmult = "+skillmult);

            // Add Experience
            if (skillmult > 0.0)                                                                    // If any XP is to be added to this character
            {
                if(AddXP(chr, expName, makeint(_exp*skillmult), XP_GROUP_PLAYER)) LevelUp = true;    // Add that XP and see if it resulted in a Level-Up
            }
        }
    }

Let's see if I can translate this for everyone:
This is only the part if it's called for Group Offic, which is used in most cases.
First it will see if this character has a captain. If it has a captain it will run trough all passengers of this captain.
So say your boatswain gets some XP it will detect you (the mainplayer) are the captain so it will now run this function for all of your passengers (and yourself).

The first lines are error prevention incase there are some weird characters or stuff.

Code:
if (cn == sti(chref.index))                                            skillmult = 1.0;    // The character who gained the XP gets 100%
            if (expName == "")                                                    skillmult = 1.0;    // All characters join in "general XP"
These lines tell us when the character is the "original" character who got the XP it will get everything. And if the XP is not for a certain skill it will also give all the XP to the character who is called now.

Code:
if (expName == SKILL_FENCING)                                                            // Fencing is a personal skill and should be handled differently
            {
                if (skillmult < 0.5 && bAllies(chref) && IsOfficer(chr))    skillmult = 0.5;    // Character is in the player shore party
            }
            else                                                                                    // For any non-personal skills
            {
                tempmult = GetOfficerSkillFactor(chr, expName);                                        // This means some officers can get 200% XP!
                if (skillmult < tempmult) skillMult = tempmult;                                        // The officer who gains the XP will ALWAYS get it
            }
The next part checks if the skill fencing is called. If this is the case it will check if the character is allies or is officer for the character and if so it will give 50% of the XP.
I find this quite weird because as far as I know bAllies checks if something is a passenger, so this function will always return true already. So just checking of isOfficer should be enough here. - I do think this is sort of right because if an officers is in the fight he should get some XP. but do mind now everytime some officer gets XP all other characters get 50% of it. Maybe this is a bit to much and this mult should be lowered a bit because the characters get XP off them selfs too.

The next part says if the skill isn't Fencing we should look at the skillcontributions and make the multiplier be based on this. This contribution is either 0, 1 or 2. Also remember this is called for all passengers. So if 1 character gets say commerce XP by a trade then all passengers (who contribute this skill) will receiver 200% of this XP. I think this is a bit to much. I do like the fact they get XP only for what the contributing but I would personally suggest to divide it by 2, so you will get 100% if you are fully contributing and you get 50% if you are half contributing.

Code:
if (IsMainCharacter(chr))                                                                // Special case for the player, because you cannot focus on all skills at the same time
            {
                skillmult = 0.5;                                                                    // Only 50% of all skills
                if (expName == SKILL_LEADERSHIP)                                skillmult = 1.0;    // But a captain MUST know how to lead a crew
                if (expName == SKILL_SAILING)                                    skillmult = 1.0;    // And navigate a ship
            }
Here it checks if the character who gets the XP is the maincharacter. And if this is the case all previous stuff is removed and he will only get 50% of the XP unless the skill is leadership or sailing.
I find this very weird, why should we treat the maincharacter different then other characters. Also do note there are a few cases this is bypassed. If the character is getting rewards from the governor, is doing gambling or is trading there is also XP given the the main character seperatly which wont have this divider on it. - I'd say it's better to remove this whole block of code and instead and add something in the block above where the empmult is calculated. You could check for the noncontribute flag for the officer. if this is true (which it is for the mainchar) the tempmult is always 0.5 or add something like a function: GetCaptainSkillMult this will return the multipliers for captains. We can easily check who is the captain because this will always happen at i = -1. So in this case we could just determine the multipliers differently. You could give captains always leadership and sailing bonus. But in this way it would also work for other ships etc and not only for the mainchar.

Code:
if (skillmult < 0.5 && SharedXP)                                    skillmult = 0.5;    // Sharing XP, so everybody gets at least 50%
Here the game checks if sharedXP is enabled, and if it is then it will give this person a 50% skill increase at least.
I think he lies the culprit, we don't want officers to get all skills right?

-----------------

These are my comment on the current SharedXP system. Please leave your comments too.
 
Last edited:
I find this quite weird because as far as I know bAllies checks if something is a passenger, so this function will always return true already. So just checking of isOfficer should be enough here. - I do think this is sort of right because if an officers is in the fight he should get some XP. but do mind now everytime some officer gets XP all other characters get 50% of it. Maybe this is a bit to much and this mult should be lowered a bit because the characters get XP off them selfs too.
I added that 'bAllies' check there purely as fail-safe, just in case ever it is possible for NPCs to have officers of their own.
But indeed I think right now it serves no purpose. Also doesn't do any harm though. :shrug

The "Fencing is always shared" logic was specifically at @Grey Roger's request, who insisted on that quite adamantly. :cheeky

The next part says if the skill isn't Fencing we should look at the skillcontributions and make the multiplier be based on this. This contribution is either 0, 1 or 2. Also remember this is called for all passengers. So if 1 character gets say commerce XP by a trade then all passengers (who contribute this skill) will receiver 200% of this XP. I think this is a bit to much. I do like the fact they get XP only for what the contributing but I would personally suggest to divide it by 2, so you will get 100% if you are fully contributing and you get 50% if you are half contributing.
The reason is so that officers contributing skills get MORE XP than the player does!
That is important, since otherwise the player would end up overtaking his officers in skill progression, making the officers useless after a while. :facepalm

Here it checks if the character who gets the XP is the maincharacter. And if this is the case all previous stuff is removed and he will only get 50% of the XP unless the skill is leadership or sailing.
I find this very weird, why should we treat the maincharacter different then other characters. Also do note there are a few cases this is bypassed. If the character is getting rewards from the governor, is doing gambling or is trading there is also XP given the the main character seperatly which wont have this divider on it. - I'd say it's better to remove this whole block of code and instead and add something in the block above where the empmult is calculated. You could check for the noncontribute flag for the officer. if this is true (which it is for the mainchar) the tempmult is always 0.5 or add something like a function: GetCaptainSkillMult this will return the multipliers for captains. We can easily check who is the captain because this will always happen at i = -1. So in this case we could just determine the multipliers differently. You could give captains always leadership and sailing bonus. But in this way it would also work for other ships etc and not only for the mainchar.
That is intentional. The player is a captain and the most important skills for a captain are Sailing and Leadership since those control the maximum Tier of ship they can command.
So while for any other skill, I'd want the officers to become better than the player, for those two skills it makes sense if the player is equally good/better than the officers.
 
That is intentional. The player is a captain and the most important skills for a captain are Sailing and Leadership since those control the maximum Tier of ship they can command.
So while for any other skill, I'd want the officers to become better than the player, for those two skills it makes sense if the player is equally good/better than the officers.

I don't say its bad perse but it should apply to all captains. Say you have an other ship the officer there should probably gain sailing and leadership quicker then the other officers too. and also on enemy ships
 
I don't say its bad perse but it should apply to all captains.
Other captains don't have officers (or are you talking about player companions?). Plus they have their captain type skill contribution, which should be fine.
 
Other captains don't have officers (or are you talking about player companions?). Plus they have their captain type skill contribution, which should be fine.
not yet, but why prevent it with this. the whole idea of the rewrite of the leveling system was to make sure it was as generic as possible and could be applied to everything.
I still want to add officers to enemy ships in the future. Also companion ships do support officers.
 
not yet, but why prevent it with this.
I'm not saying we should prevent it. But until we do have it (which we probably shouldn't do right now since it adds extra complexity and therefore risk), I think it makes sense to treat the player differently.
Eventually though it would make sense to have it and hopefully then we could indeed treat all captains, including the player, exactly the same.
 
@Pieter Boelen

I'll drop the feedback you requested in the other thread here:

Before I disabled shared XP, I noticed the following (which is also why I disabled it): my character went into the maltese crypt for the first time with his officers having varied levels of fencing. My character came out having advanced from a around a 5 starting to a 6 in fencing I think, and all his officers were now either 6 or 5 in fencing as well (some went from 5 to 6, some from 3 to 5).

The main factor I think is that skills require increasing amounts of xp to go up an additionak level (I think it is a multiple of the previous skill level xp required?).

The consequence is shared XP will always generate skill compression among officers, if they go up in everything. If I need X skill xp to go up from 7 to 8 in something, but it only takes some fraction of X to go from 6 to 7, and some smaller fraction to go from 5 to 6, then a shared xp rate of around 50% or something, or even lower, will (given enough time) still compress all my officer skills to be at most 1 single level behind mine, even if they start much lower, because of the multiplicative growth in xp requirements.

Now, that is either good or bad depending on whether you want all your officers to be a team of generally competent officers with skills that all tend to be very high, or whether you want a team of specialists. I prefer specilists, so the ideal solution for me was to turn off shared xp. But if you like training up your entire team, maybe the current system works for you.

In other words, I think it is the multiplicative nature of increasing skill xp requirements at each level that generates the skill compression in shared xp, not as much the specific sharing percentage. But I wouldn't change the general skill xp growth requirements (they seem calibrated great for satisfying progression), so I'm not sure I'd ever like the shared zp system. It just might not be for players with my preferences, so I'll probably turn it off anyway.
 
The one thing I personally still find dodgy is to share 50% XP within your shore party even without Shared XP.
Does anyone feel the same on that? Or is that just me who finds that odd....?

As soon as any and all skills gets shared with all officers, eventually all your officers would become samey-samey Supermen.
Doesn't seem very awesome to me either. So I wonder... what kind of sharing could there be that wouldn't have this effect?
Is that even possible or is sharing just, in general, no desired if you want your officers to remain specialized?


Also, my question on Player Skills vs. Officer Skills still remains: If I did it properly, then officers should gain their appropriate skills faster than the player should.
So if you get a Level 1 Quartermaster at the start of the game, he should gain Commerce skill faster than the player does.
 
Edited my first post a bit. I missed this part:
Code:
if (skillmult < 0.5 && SharedXP)                                    skillmult = 0.5;    // Sharing XP, so everybody gets at least 50%

I think this line is causing the most problems because it will make sure with sharedXP enabled an officer will level in all skills.
 
No problem there. That is what it is intended to do. ;)

If anyone has any idea for how it should work instead, I'll certainly be curious to hear it.
 
Pieter: speaking of the non shared xp system:

I like fencing xp shared with shore party regardless of shared xp perk or not. Otherwise, you have to hold yourself back and feed your officers kills for practice, which is boring given their AI can be somewhat wonky. They should learn from watching the player in the shore party.

Does fencing XP currently share among the shore party without shared xp perk? I think it should be if not currently done.

I think that other XP is NOT generally shared in the shore party without the perk, if the officer does not have the relevant skill. When I tested talking to people in a town repeatedly, in my shore party my boatswain got leadership skill xp, my quatermaster did not, when I sold things, my quatermaster got the direct commerce xp, my boatswain did not share in it.

That is good in my opinion. Shore par with relevant skills should learn from watching the player, without relevant skills for their job, their attention can be elsewhere (again, if the player chooses not to use shared xp perk),

And yes, my quatermaster advanced much, much faster in commerce when selling things, even though his is several levels above the player, his rate of commerce skill gain shows that he goes up in percentage progress to next level 3 times as fast as the player.

Personally, I think players who want specilized officers should disable the perk. It goes against their playstyle. The question is whether people who like generalists like the perk.
 
I would sugest something like this:

If shared XP IS NOT active
because of the way potc is build etc we don't know 100% sure if this character actually gained the XP or if it was the action of someone else so:
The character who gained the XP according to the game should get 100%
Any passenger which is contributing to this skill should get 50% or 100% depending on theire contribution level of the XP
Captains will get 100% for sailing and leadership
Optional: Fencing XP is shared to everyone in the shore party for 50%

If shared XP IS active
because of the way potc is build etc we don't know 100% sure if this character actually gained the XP or if it was the action of someone else so:
The character who gained the XP according to the game should get 100%
Any passenger which is contributing to this skill should get 50% or 100% depending on theire contribution level of the XP
Captains will get 100% of all skills xp
Fencing XP is shared, so everyone on your shore party will receive 100% of the XP gained by Fencing
 
I like fencing xp shared with shore party regardless of shared xp perk or not. Otherwise, you have to hold yourself back and feed your officers kills for practice, which is boring given their AI can be somewhat wonky. They should learn from watching the player in the shore party.
Let's keep that then.

Does fencing XP currently share among the shore party without shared xp perk? I think it should be if not currently done.
Yes, it does. You've got @Grey Roger's insistence to thank for that. ;)

I think that other XP is NOT generally shared in the shore party without the perk, if the officer does not have the relevant skill. When I tested talking to people in a town repeatedly, in my shore party my boatswain got leadership skill xp, my quatermaster did not, when I sold things, my quatermaster got the direct commerce xp, my boatswain did not share in it.
For any non-Fencing skill, "shore party of not" should not matter. If your Quartermaster had been left on the ship, he should still have gotten the Commerce XP.

And yes, my quatermaster advanced much, much faster in commerce when selling things, even though his is several levels above the player, his rate of commerce skill gain shows that he goes up in percentage progress to next level 3 times as fast as the player.
Then the "2 multiplier" for officers opposed to "1" for the player seems to be doing its job. Good! :onya

Personally, I think players who want specilized officers should disable the perk. It goes against their playstyle. The question is whether people who like generalists like the perk.
@Grey Roger, any thoughts?

I think if it cannot be made to be in any way useful for people who want specialized officers, then I imagine the mod should get a proper toggle on it.
Where would such a toggle go? Realism Mode? Top of InternalSettings.h? Something else?

I would sugest something like this:
Is that not pretty much what it does right now?

As far as I can tell, the ONLY "criticism" against the current system is that @Tingyun prefers the behaviour without Shared XP being active.
Other than that, I dare say it behaves itself the way it is meant to.
 
What I have found is that different skills seem to go up at different rates. Given that I often get into sea battles and therefore fire at ships and my ship is fired upon, what strikes me is that "Repair" goes up pretty quickly but "Accuracy" doesn't, and "Gunnery" hardly goes up at all. Even my gunner hasn't achieved Accuracy 10 by the time my quartermaster (!) has reached Repair 10. (I'm not sure why the quartermaster is gaining "Repair" that quickly - other officers, apart from the carpenter, don't. The carpenter is presumably the one who's supposed to be getting it.)

50% shared "Fencing" is perhaps a bit much. If I remember correctly from earlier versions, shore party officers gained some share of your XP if you didn't have the "Shared XP" perk and a larger share if they did, and that's what would probably work best for "Fencing" now. Maybe drop it to 30% without the perk, rising back to 50% when you get the perk.

By definition, yes, if XP are being shared then eventually everyone will get 10 in everything. You'd probably need to be playing a very long time to achieve that. I didn't manage it by the end of my "Tales of a Sea Hawk" campaign and I'd actively been trying to get everyone maxed out - whenever an officer reached 10 in his relevant skills, I'd shift him to a different post so he could start earning XP in another skill or two. And that campaign didn't end when the story did - there were several more side quests plus some general rampaging fun with the Sovereign of the Seas. (It took ages to get anyone up to 10 in "Cannons"!)

As for disabling the "Shared Experience" perk - unnecessary. If you don't want it, don't take it. ;) There are plenty of other perks to buy and you'll probably never get them all. If you do want a toggle to disable it then I'd prefer the toggle be separate. I don't like the idea of grouping a whole bunch under realism or difficulty because then you can't pick and choose - you either get the whole package or nothing. Better to have them separate so players can set up the game the way they want it.
 
Responding to Levis's proposal:

I don't think shared xp perk should affect captain rate of gaining skill xp, or shore party sharing of fencing xp.

At that point shared xp becomes trading 2 perk points for a faster rate of advancement. Everyone will always do that, and do it quick. If that is desirable, just balance the base skill gain to be that. And if we think captains are best modeled as being faster at sailing and leadership, why lose that when going to shared xp, which everyone will always do anyway?

I'd think fencing xp shared at 50% to shore party always. No reason to penalize a player who prefers specilized officers in their ability to train up their fighters! ;)

If balanced for my preferences (which I'm not sure it should be), shared xp should just enable officers in the shore party to gain skills in non contributing skills. So you can choose a few officers to make genralists, maybe the ones you are training to be future captains underneath you. It shouldn't affect skill gain in any other way, just remove the contributing skill requirement from the shore party only.

EDIT: grey roger, disabling the perk is so that officer hires don't drag it into the party. I think disabled at ironman is best, with a toggle in internal settings to do it earlier manually.
 
What I have found is that different skills seem to go up at different rates. Given that I often get into sea battles and therefore fire at ships and my ship is fired upon, what strikes me is that "Repair" goes up pretty quickly but "Accuracy" doesn't, and "Gunnery" hardly goes up at all. Even my gunner hasn't achieved Accuracy 10 by the time my quartermaster (!) has reached Repair 10. (I'm not sure why the quartermaster is gaining "Repair" that quickly - other officers, apart from the carpenter, don't. The carpenter is presumably the one who's supposed to be getting it.)
There are some balancing multipliers per skill that could be tweaked for that.
They're in Levelling.c; @Levis can probably find the relevant section in no time at all.

Is the Quartermaster gaining Repair equally fast or faster than the Carpenter?
I don't think that should be the case? o_O

50% shared "Fencing" is perhaps a bit much. If I remember correctly from earlier versions, shore party officers gained some share of your XP if you didn't have the "Shared XP" perk and a larger share if they did, and that's what would probably work best for "Fencing" now. Maybe drop it to 30% without the perk, rising back to 50% when you get the perk.
In that case, try:
Code:
  if (expName == SKILL_FENCING)  // Fencing is a personal skill and should be handled differently
  {
  if (skillmult < 0.3 && bAllies(chref) && IsOfficer(chr))  skillmult = 0.3;  // Character is in the player shore party
  }

By definition, yes, if XP are being shared then eventually everyone will get 10 in everything. You'd probably need to be playing a very long time to achieve that. I didn't manage it by the end of my "Tales of a Sea Hawk" campaign and I'd actively been trying to get everyone maxed out - whenever an officer reached 10 in his relevant skills, I'd shift him to a different post so he could start earning XP in another skill or two. And that campaign didn't end when the story did - there were several more side quests plus some general rampaging fun with the Sovereign of the Seas. (It took ages to get anyone up to 10 in "Cannons"!)
Good feedback, thanks! :cheers
 
That kind of information is good for me to know. There is a function in leveling to balance the different XP gains.
Code:
float GetXPmult(string Skillname)
{
    float expMult = 1;
    switch (Skillname)
    {
        case "Leadership":    expMult =  2.5 ; break;
        case "Fencing":        expMult =  1.75; break;
        case "Sailing":        expMult =  0.8 ; break;
        case "Accuracy":    expMult =  1.25; break;
        case "Cannons":        expMult =  0.4 ; break;
        case "Repair":        expMult = 50   ; break;
        case "Defence":        expMult =  1.5 ; break;
        case "Sneak":        expMult =  1.5 ; break;
        case "Grappling":    expMult =  3   ; break;
        case "Commerce":     expMult =  0.50; break;
    }
    return expMult*EXPERIENCE_MULTIPLIER;
}

These are the values we generated when I was working on leveling. After hearing your story I guess cannons should be raised a bit and maybe repair should be lowered a bit?

Also maybe another idea:
Share X percentage of melee always with your shory party but when SharedXP is enabled also share melee skills with passengers which are on your ship? Or maybe also for theire contributing skills.
So Melee will always been seen as a contributing skills and the other skills are shared if they contribute to it but if you have sharedXP enabled also people on your ship will gain in these skills?
 
If balanced for my preferences (which I'm not sure it should be), shared xp should just enable officers in the shore party to gain skills in non contributing skills. So you can choose a few officers to make genralists, maybe the ones you are training to be future captains underneath you. It shouldn't affect skill gain in any other way, just remove the contributing skill requirement from the shore party only.
For the shore party only, eh? That does somewhat match with things @Grey Roger has said in the past.

@Grey Roger: Would you think it makes sense to have Shared XP affect only the shore party?
Or would you prefer to have it affect all passengers on the ship instead, as is currently the case?

Share X percentage of melee always with your shory party but when SharedXP is enabled also share melee skills with passengers which are on your ship? Or maybe also for theire contributing skills.
So Melee will always been seen as a contributing skills and the other skills are shared if they contribute to it but if you have sharedXP enabled also people on your ship will gain in these skills?
Doesn't it already do that? Fencing will be shared 50% with ALL officers with Shared XP, just like all other skills.
 
For the shore party only, eh? That does somewhat match with things @Grey Roger has said in the past.

@Grey Roger: Would you think it makes sense to have Shared XP affect only the shore party?
Or would you prefer to have it affect all passengers on the ship instead, as is currently the case?

So what about a combination?
So if you don't have shared XP your shore party will only get the XP they contribute and passenger on the ship won't get anything.
With sharedXP enabled shoreparty will get XP in all skills and people on the ship will get X percentage of skills they contribute?
 
That could work. I would actually play with shared xp under Levis's proposed system. :)

EDIT: but I think passangers on ship not in shore party shouldn't get fencing xp. Some people are noncombatents, I'd rather they didn't all become supermen in combat. Only those who risk their lives and practice in combat should share in fencing xp.
 
Back
Top