Latest Diablo 3 News
DiabloWiki Updates
Results 1 to 4 of 4
  1. #1
    IncGamers Member ElSmisko's Avatar
    Join Date
    May 2007
    Location
    Sweden - The Cold North
    Posts
    380

    Need help with formula behind experience penalties.

    Hey all!

    I am trying to figure out how the experience penalty is calculated.
    I know that there are tables with these values on the wiki but I want to know how they are calculated.
    This is what I have deducted so far from reading the wiki. I bet some of you out there have been digging in the source code and can help explain to me what really happens.

    Perhaps there allready is a thread where this is explained, but if so, I couldn't find it.

    First off we have the character level (clvl) and area/monster level (mlvl).
    As far as i understand, the basic percentage of experience kept is done by taking the ratio between clvl and mlvl and with a maximum of 100% and a minimum of 5%.
    Code:
    if [clvl]/[mlvl] > 1 then
          [xpquotekept] = 1
    elseif [clvl]/[mlvl] < 0.05 then
          [xpquotekept] = 0.05
    else
          [xpquotekept] = [clvl]/[mlvl]
    end if
    Then the game checks to see if the character is below level 25 and in an area that differs at least 5 levels from the character.
    If the level difference is equal to or greater than 10, the penalty is kept at 5 %.
    I don't really see how that penalty is calculated though, and the penalty for positive and negative level difference differs. Any input here is apprechiated.
    Code:
    if [clvl] < 25 and abs([clvl] - [mlvl]) > 5 then
          if abs([clvl] - [mlvl]) > 10 then
                [xpquotekept] = 0.05
          else
                [xpquotekept] = 1 - ???
          end if
    end if
    Then the game checks to see if the character is level 70-85 and gives an additional penalty on the ratio we calculated earlier.
    Each character level above 69 subtracts an additional 4,6875% of the ratio.
    Code:
    if [clvl] >= 70 and [clvl] <= 85 then
          [xpquotekept] = [xpquotekept] * (1 - ([clvl]-69)*0.046875)
    end if
    At level 85 the penalty lets the character keep 25% of the experience ratio, but I noticed that when the character is above level 85 it changed to a decrease of a quarter for each additional level.
    Code:
    if [clvl] > 85 then
          [xpquotekept] = [xpquotekept] * (1 - 0.25*(3/4)^([clvl]-85))
    end if
    And then the game gives the experience to the character.
    Code:
    [characterxp] = [characterxp] + [monsterxp] * [xpquotekept]
    Then on top of all this there are of course rounding errors and such that have to be taken into consideration.

    This is my interpretation of what happens. I hope someone can explain this in more detail to me.
    Thank you for your time!
    Last edited by ElSmisko; 18-05-2013 at 16:12. Reason: Spelling errors

  2. #2
    IncGamers Member
    Join Date
    Jun 2006
    Location
    Chihuahua
    Posts
    32

    Re: Need help with formula behind experience penalties.

    Everything you need to know is explained in good detail here.

    It also mentions experience bonuses for being partied, moster experience gains by increased number of players, exp penalty at higher levels and more.

  3. #3
    IncGamers Member
    Join Date
    Apr 2008
    Location
    Vanilla, 1.12a
    Posts
    421

    Re: Need help with formula behind experience penalties.

    Look at the source of that calculator. It's pretty much how the game calculates experience with one slight rounding error when calculating it for champions/minions/uniques on even player cоunt(2, 4, 6, 8).
    Here is old thread about calculating Pindleskin experience on that same subject.

  4. #4
    IncGamers Member ElSmisko's Avatar
    Join Date
    May 2007
    Location
    Sweden - The Cold North
    Posts
    380

    Re: Need help with formula behind experience penalties.

    Rodrigo: Haha, how silly of me to not think of looking at Arreat Summit and start digging in the forums instead. =) Thanks!

    Victus: Ah, interesting, will take a look. Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •