1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

High Priority Change way shared XP works

Discussion in 'Build Testing List' started by jsv, Dec 22, 2015.

  1. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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
     
    Tingyun likes this.
  2. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    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: Aug 28, 2016
    Eskhol likes this.
  3. Eskhol

    Eskhol Sailor Apprentice

    Joined:
    Aug 22, 2016
    Messages:
    79
    Gender:
    Male
    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.
     
    Tingyun likes this.
  4. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    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. :)
     
    Eskhol likes this.
  5. Eskhol

    Eskhol Sailor Apprentice

    Joined:
    Aug 22, 2016
    Messages:
    79
    Gender:
    Male
    Thank you! :) Anyways I'll just keep it that way for this one. Next one I will just not get the perk.
     
    Tingyun likes this.
  6. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     
    Tingyun likes this.
  7. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    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.
     
    Eskhol likes this.
  8. Eskhol

    Eskhol Sailor Apprentice

    Joined:
    Aug 22, 2016
    Messages:
    79
    Gender:
    Male
    Tingyun,

    Oh, that's true. Then I'll add it before starting it :)
     
    Tingyun likes this.
  9. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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;
    }
    
     
    Tingyun likes this.
  10. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    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?
     
  11. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Think so yes. Changing that 6.0 to 12.0 might do the trick too.
     
    Tingyun likes this.
  12. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    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)
     
  13. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    3 then. :cheeky
     
    Tingyun likes this.
  14. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Haha, indeed! I'll do that instead. :)
     
  15. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Pieter, just dropping in a note of thanks, worked perfectly on both player and companion, skills and leveling xp.
     
    Pieter Boelen likes this.
  16. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    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
     
    Tingyun and Pieter Boelen like this.
  17. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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?
     
  18. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)

Share This Page