RPG element: experience points/levelling up

  • megatronx: x would be the level, a and y numbers, ^ stands for exponent, ceil would round the result up and the result would be the total exp needed for a level. It is basically exponential growth.

    An example function could be ceil(2*level^1.5).

    Basically it is a way to calculate the exp requirements for every level by a simple formula. Normally I would probably use a polynome for this, for example ax^4+bx^2+cx+d. But in the end it depends on how you scale the exp of you enemies in the game as well.

    You could start calculating the time needed for a next level if you are constantly fighting creeps with a formula like to this:

    time = time_needed_to_kill_enemy/exp_per_enemy * exp_needed for level

    Tune the time it takes to reach the next level like you want, rule of thumb is ofc that it takes longer the higher your level is.

    You can also check how long it takes to level up in easier areas of the game with the formula. You probably don't want the easier areas to give you more exp over time just because you can kill monsters much quicker there. To prevent this you can also add a malus if the level of your enemies differs from your level. It is like that in Diablo: if the monster level is more than 5 levels (iirc) below your character's level you get a smaller percentage of the total exp.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • And what numbers would be under LEVEL? Would it be current XP or would it be just level number ( for example number 4 ) ?

  • 4

  • x in the example is indeed the current level of your character.

    xpForNextLevel = floor or ceil(factor * playerLevel ^ exponent)



  • mindfaQ


    I've only just got around to looking into what you guys are talking about, and thanks, I really need to learn this stuff. My maths is weak, but I enjoy it!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)