Player XP curve


If it doesn't fit anywhere else, it belongs here. Also, come here if you just need to get hammered.

bel

Cocytus Succeeder

Posts: 2184

Joined: Tuesday, 3rd February 2015, 22:05

Post Thursday, 27th June 2019, 02:29

Player XP curve

The player XP need to attain various levels has the following comment as preamble:

  Code:
    // Note: For historical reasons, all of the following numbers are for a
    // species (like human) with XP aptitude 1, not 0 as one might expect.

    // Basic plan:
    // Section 1: levels  1- 5, second derivative goes 10-10-20-30.
    // Section 2: levels  6-13, second derivative is exponential/doubling.
    // Section 3: levels 14-27, second derivative is constant at 8470.

    // Here's a table:
    //
    // level      xp      delta   delta2
    // =====   =======    =====   ======
    //   1           0        0       0
    //   2          10       10      10
    //   3          30       20      10
    //   4          70       40      20
    //   5         140       70      30
    //   6         270      130      60
    //   7         520      250     120
    //   8        1010      490     240
    //   9        1980      970     480
    //  10        3910     1930     960
    //  11        7760     3850    1920
    //  12       15450     7690    3840
    //  13       26895    11445    3755
    //  14       45585    18690    7245
    //  15       72745    27160    8470
    //  16      108375    35630    8470
    //  17      152475    44100    8470
    //  18      205045    52570    8470
    //  19      266085    61040    8470
    //  20      335595    69510    8470
    //  21      413575    77980    8470
    //  22      500025    86450    8470
    //  23      594945    94920    8470
    //  24      698335    103390   8470
    //  25      810195    111860   8470
    //  26      930525    120330   8470
    //  27     1059325    128800   8470



Ok, I understand what the code is trying to do, but why choose an XP curve which looks like this at all? What is gained by making three different kinds of piecewise functions, with breakpoints at XL6 and XL 14?
User avatar

Zot Zealot

Posts: 982

Joined: Monday, 29th September 2014, 09:04

Post Thursday, 27th June 2019, 04:15

Re: Player XP curve

From a bottom up perspective, this data table / curve is insane.

But from a top down perspective, XL progression through a typical game is pretty sensible. Or at least, nobody is saying otherwise.

The way this sensible XL progression has been implemented in code is hairy. XP logic in crawl is convoluted to say the least. From the non-continuous curve you've found above to the crazy stuff that determines how much XP a monster is worth.

As to why: it's a gordian knot of hacks put in place over time from what was presumably a simpler origin with "worse" XL progression. People tried to improve XL progression with small specific fixes over time, without redesigning the whole system.

I guess the natural reaction to code like this is "we should fix it so it's more elegant".

If you want to do that, it would be good to decide up-front if you want to refactor the system and keep user-visible behaviour (eg XL progression) the same, or if you want to change that user-visible behaviour. It's certainly tempting to refactor dumb logic just because it's dumb and could be done in a less dumb way, I have done that myself. But it's hard to get that sort of change included, because the reaction from devs is "why? I'm worried about merging this.".

bel

Cocytus Succeeder

Posts: 2184

Joined: Tuesday, 3rd February 2015, 22:05

Post Thursday, 27th June 2019, 05:09

Re: Player XP curve

I am not opposed to complicated formulae which give better results than simplistic formulae. Crawl has tons of different mechanics, and sometimes complicated formulae better capture the various interactions.

However, we should have in mind an objective. If we have an idea of what the XL curve is trying to achieve, we might have some idea of whether it actually comes close to its goal. Unfortunately, I have no idea of what the curve is trying to achieve.

My suspicion is that the curve becomes harsher around XL6 because that's roughly the time people find Lair. There is a surfeit of XP in Lair. So, to make the XP curve somewhat reasonable, the game tries to soak up the surplus XP.
User avatar

Zot Zealot

Posts: 982

Joined: Monday, 29th September 2014, 09:04

Post Thursday, 27th June 2019, 05:35

Re: Player XP curve

It looks like you're partially right. Viewing the history for this function (git log -L :exp_needed:player.cc), it existed basically unchanged in the original Git commit (2005):
673bdae75485d14f759af597c3c62b99601f9a43
However there was ifdef'ed out code with a simpler system that was described as "not smooth and [with] a horrible bump at level 12 followed by [comparatively] easy teen levels".

It's been changed exactly once in 2013:
f54e3ca8c7a706449d143d9c9b8ccfc674668e1c

  Code:
    Increase xp required for higher levels, smooth out mid levels

    As a second facet of the attempt to reduce player power growth into
    mid and lategame, the xp requirement of experience levels above 15
    is steadily increased, with xl 16 requiring 3% more xp than previously
    while xl 27 requires 25% (xl 13-15 cost slightly less than before).

    Skill point costs are also increased in tandem, though the reduction
    in skill growth should be somewhat less than the one in xl.

    This also smooths out skill gain in the mid-teens, where the old values
    led to a sudden spike of growth which then sharply trailed off shortly
    after Lair (or thereabouts). The rate of change in growth should hopefully
    feel more continuous, instead of a noticable stall as one proceeds into
    midgame.


The experience required to hit XL 14 was decreased 7%, while XL 27 was increased 25%.

For this message the author chequers has received thanks: 2
bel, Implojin

Return to Crazy Yiuf's Corner

Who is online

Users browsing this forum: No registered users and 64 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.