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

High Priority Change way shared XP works

If you don't have Shared XP, sharing should only be within your shore party.
With Shared XP, it goes for the other officers too.

Even though I did write the code on that myself, I'm not sold on it either and I did it like that mainly because @Grey Roger was insisting.
As far as I'm concerned, I'd be OK with absolutely no sharing of fencing until you get the perk and after that sharing only within the shore party.

Easy enough to change in Leveling.c, but I don't want to keep changing it back and forth obviously because different people want different things. :facepalm
 
Of course Pieter, that makes sense. Lots of different preferences.

I ended up clearing shared XP perk from my character, and then disabling it by setting it to not show up in realistic mode.

I think I just prefer the more differentiated, specialized officers, rather than letting everyone become good at everything, so it just isn't the right perk for my preferences. But disabling it makes things perfect for me (on further thought I like fencing shared in shore party actually, just not outside it, and I don't want my surgeon learning navigation at all).

I think I just prefer more specilized officers, so disabling the perk is the rigt solution for me , and others who enjoy it can still keep having fun as well. :)
 
Last edited:
The game I'm at right now is with shared xp and man...It get's pretty crazy when you have a lot of officers and they just keep leveling up and getting points very often. Now almost all of them have a 10 in 7o% of the attributes.

I don't like that at all, I like the idea that Tingyun mentioned, more specialized officers. I don't want a navigator that is better than me at everything.
 
Hi Eskhol,

In that case, here's the console lines you can run to remove shared XP from your character:

DeleteAttribute(PChar,"perks.list.SharedExperience");

PChar.perks.freepoints = 2;

Then in perks_init you can set shared XP to be disabled in realism mode

Yep, it really is more fun having officers specilized, all the officers being generalists makes the world feel less rich.

But I understand other people have different preferences. :)
 
Indeed I personally also don't see the point of each of your officers becoming good at everything and turning hero same as you.
I much prefer them to maintain some measure of uniqueness and not just in their name and outfit.
 
Eskhol,

Makes sense! For your next campaign you'll still have to disable the perk in the perks file, otherwise your first mate officers will often have the perk themselves.
 
This is the relevant code from PROGRAM\Characters\Levelling.c:
Code:
//=====================================================
//  Adding XP functions
//=====================================================

//This function is always called. it determins who should get the XP etc
bool AddXP(ref chref, string expName, int _exp, string group)
{
   ref chr, capt;
   int cn,i;
   bool LevelUp = false;
   //First catch some weird cases which shouldn't happen in the first place. let log if they do happen.
   if(!CheckAttribute(chref,"index")) { if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: Character "+GetMySimpleName(chref)+" has no index"); return false;}
   if(sti(chref.index)<0) { if(DEBUG_EXPERIENCE>0){ Trace("XP ERROR: Character "+GetMySimpleName(chref)+" has index smaller than 0")}; return false; }
   if(_exp < 0)
   {
     _exp = -(_exp);
     if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: NEGATIVE XP CALL");
   }
   if(_exp == 0)
   {
     if(DEBUG_EXPERIENCE>0) Trace("XP ERROR: ZERO XP CALL");
     return false;
   }
   
   if(DEBUG_EXPERIENCE>0) Trace("XP LOG: Called AddXP for "+GetMySimpleName(chref)+" with skill: "+expName+" and xp: "+_exp+" and group: "+group);

   //If we are only doing the player we can return here (for performance reasons)
   if(group == XP_GROUP_PLAYER)
   {
     //Add a difficulty multiplier
     float diffmult = 1.0-((GetDifficulty()-1.0) / 6.0); //Let's make it a bit less dependent on difficulty
     int xp = makeint(makefloat(_exp)*GetXPmult(expName));
     if(AddXPtoChar(chref, expName, makeint(diffmult*xp))) LevelUp = true;
     return LevelUp;
   }

   //Check for shared experience
   bool SharedXP = GetOfficersPerkUsing(chref,"SharedExperience");
   if(DEBUG_EXPERIENCE>1) { if(SharedXP) Trace("XP LOG: SharedXP is active"); }
   
   //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
       }
     }
   }
   
   //Now handle the companions
   if(group == XP_GROUP_PARTY)
   {
     capt = GetCharacter(FindCommanderIndex(chref));                         // Get the commander of the fleet
     for (i = 0; i <= GetCompanionQuantity(capt); i++) {
       cn = GetCompanionIndex(capt, i);
       if (cn < 0) continue;
       chr = GetCharacter(cn);                                   // Reference to the character
       if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Loop "+i+", Checking Companion "+GetMySimpleName(chr)+" with id "+chr.id);
       if(AddXP(chr, expName, _exp, XP_GROUP_OFFIC)) LevelUp = true;               // Add the XP to the companion and maybe his officers
     }
   }

   //returns true if there is a levelup somewhere
   return LevelUp;
}
 
Interesting! Can I ask a question Pieter?

If I wanted (for my personal use, not for anyone else) to make the rate of XP and skill increases slow down to 50% of their present value, would changing the following line in the following way to add a 0.5 multiplier work?

float diffmult = 0.5*(1.0-((GetDifficulty()-1.0) / 6.0));

Would that change both skill gain and level gain xp?

Would it work for both the player and officers?
 
Thanks Pieter, I'm going to try that, I like the idea of epic, long campaigns. :)

(changing the 6 to a 12 would make xp go faster actually, the formula is a 1 - x/6, there are just too many parenthesis signs to see that clearly)
 
At the top of the leveling document there are two defines:
Code:
#define SKILL_EXPERIENCE_MULTIPLIER    0.8            // FLOAT - Must be a float higher than 0.0 - default is 1.0 - the rate at which the characters gain skill experience: For a 30% increase set to 1.3
#define EXPERIENCE_MULTIPLIER    0.8                // FLOAT - Must be a float higher than 0.0 - default is 1.0 - the rate at which the characters gain experience: For a 30% increase set to 1.3

use those
 
Can anyone provide some feedback on how quickly officers now gain XP compared to the player?
If it works as intended, then your officers should gain XP faster in their appropriate skills than the player does.
This to ensure the player won't be contributing all the skills and to therefore give the officers their proper use.
But does that actually work out like that?
 
Back
Top