• 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 Leveling: Sudden Huge Amounts of XP Gained

andyandy

Sailor Apprentice
I've been trying out the brave black flag. as i follow on the tutorial and do the fencing training, i keep getting enormous XP gains (in the order of 10000). Wonder if this is intended or just some code not removed?
 
That's a bit peculiar. You do get excessive amounts of XP on low character levels.
Perhaps the jump-start to rank 5 in Brave Black Flag has caused some extra unforeseen strange effects?
Was it like that in Beta 3.4 as well?
 
after 3 fencing it jumps start me to lvl 15. even on shared experience party characters. Would u like to try it out?
 
I won't have time soon. And first I need to know if this happened in Beta 3.4 as well.
Perhaps other people can check this too if they start a Brave Black Flag game.
 
Just tried this in my own game on default settings, but cannot confirm it.

Are there any settings that you changed by any chance?
 
If anyone plays Brave Black Flag, please try the tutorial and see if this can be replicated!
 
An oddity. I got a cobblestone very early and just had to try it out. It dropped a town guard and while I was hacking away at him with a dull blade I got lots of XP and went from level 4 to level 7. I do not recall that happening before. At level 8 now.
 
Bizarre. I moved this to a thread that sounds like it may be related.

But when I tried to test this, I didn't manage to replicate it. :facepalm
 
Pieter - I confirmed this is indeed a bug in 3.5 and I attached a save game from beta 3.4 where the problem also occurs. Like you, I could not not reproduce the bug at first (i.e. in the tutorial) but was later able to reproduce it on my ship. If you train on the ship from the attached savegame, you should be able to see it. Once it starts, you gain massive XP from a strike in training. I also observed crewmembers gaining massive XP and levels as well when the strike me. I tried to reproduce it in beta 3.2 and could not.
 

Attachments

  • savegame.zip
    677.8 KB · Views: 242
yes, that is a beta 3.4 save. I agree it sounds related to the other jump in XP bug for crew members. Although I could not reproduce the bug in 3.2, I do remember crew members sometimes gaining XP and levels super fast in that version. This might be an older bug with crew XP in general.
 
I also suspect it might be an older bug. I recall finding some really weird effects in the code before.
One time for crew morale, an ) was in the wrong spot, resulting in the code not at all doing what the original programmer thought it did.
And there was something with the pistols enemy characters use at some point, resulting in enemies getting too good weapons.
Can't remember the specifics of that one though. Anyway, that means there could be more such issues out there.
 
Hmmm....doesn't seem that weird when I look at the code.
Say a level 5 character does this on rank 2 (double your rank).
according to the code this will govern the XP FOR EACH HIT
Code:
dmg*((1.0 + re*0.5)/(1.0 + ra*0.5)) * sqrt(re);

re = enemie rank = 10;
ra = your rank = 5;
dmg = damage you do (lets say) = 15;

15*((1.0 + 10*0.5)/(1.0 + 5*0.5)) * sqrt(10)

15 * 6/3.5 * sqrt(10)

= 81

The character has 200 XP or more so that means you will probably give him at least 10 hits.
Which means you get a total of 810 XP for melee for this ....
On rank 1 this will be about half because the second part of the formula will be 1 cause both ranks are equal. But it's still a lot.

This is what is happening with guards also, cause theire level is so much higher it will increase your XP very quickly....
 
Oh and to make it even better. If a experience of less then 1000 is added this will be multiplied by 3 again by the funtions. So that makes it even more.
 
Oh and this also makes sure its multiplied even more
Code:
skillExp = skillExp * (11 - sti(_refCharacter.skill.(expName)));

Especially on low melee levels, Say 4 this will multiply the gained XP with 7.
So that makes the 810 we got a bit more already. It's now:

810 * 3 * 7 = 17010
 
And seeing you need only 50.000 to continue to the next level I can see why this could happen.
Especially if you need to restart it once or twice (or do that on purpose).
 
I sugest something more in the line of this:

Code:
pow2(1.4,(re/1.5)/ra)*sqrt(re)*dmg/1.5);

See attached image to see what kind of effect it has.
You need to look at old XP and new XP multiplied
 

Attachments

  • XPTable.png
    XPTable.png
    23.4 KB · Views: 220
Last edited:
It does indeed seem to me that the whole XP calculating system is perhaps a bit overly complex.
The idea is that your actions in the early game carry more weight so that starting out doing trading will make you good at that quite quickly.
But the other skills will increase much slower afterwards.
 
As you see in the table there is still a drop in the XP you get. This is mostly due to the fact that the higher level you are the less it get multiplied.
Personally I would have done it differently by scaling up the required XP but guess this works too.
I will implement this and then we just have to see how it works :p.

We might want to move these numbers to the internal settings tough.
Code:
// Adjust for uneven gain in skills
    int expMult = 1;
    if (_exp < 1000)
    {
        switch (expName)
        {
//        case "Leadership":    expMult =  3; break;    // LDH 30Apr09
        case "Fencing":        expMult =  3; break;
        case "Sailing":        expMult =  1; break;    // included for completeness
        case "Accuracy":    expMult =  1; break;    // included for completeness
        case "Cannons":        expMult =  1; break;    // included for completeness
        case "Repair":
            expMult = 50;                            // repair is a lot of small skill gains, minimum of 20 sent by repair functions
            if (sti(_refCharacter.rank) < 3)        // keeps player from getting repair skill 5 or 6 in the tutorial - 25Feb09
            {
                expMult = 20;
            }
            break;
        case "Defence":        expMult =  6; break;
        case "Sneak":        expMult =  3; break;
        }
    }
So it's easier to change when needed.

Also as far as I can tell there is no mention of the difficulty in it.
Code:
// If you think skills are gained too slow or too fast, here's where to tweak the overall rate.
    // Higher number gives faster gain for all skills.
    // float SkillTweak = 1.0;                           // changed by El Rapido to be configurable via internal settings
    float SkillTweak = SKILL_EXPERIENCE_MULTIPLIER;            // changed by El Rapido to be configurable via internal settings
    if (SkillTweak < 0.1) SkillTweak = 0.1;

    skillExp = makeint(makefloat(skillExp) * SkillTweak);

In above code you would expect it.
So maybe we should add the difficulty there too? On higher difficulty the SKILL_EXPERIENCE_MULTIPLIER gets divided by something so you need more experience to get to the same level?
 
The difficulty levels are already quite convoluted and I'm not sure what it does and what it doesn't.
I'm afraid adding that might be opening a can of worms.
Balancing one system is hard. With difficulty basically we need to balance four systems.

When I get to fixing the False flags, I'll probably remove the difficulty effect too for simplicity's sake.
 
Back
Top