Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble working out a formula using this experience curve to get the total exp after each level. I bet its easy and im just over thinking it.

maxlvl = 10;
increment = 28;
baseexp = 100;
function calc(){
    for (i = 0;i<(maxlvl*increment);i+=increment){
        expperlvl = baseexp + i;
share|improve this question
If you solved your problem, add an answer and accept it, don't edit your question. – Byte56 Jun 10 '12 at 16:57

If you're just trying to calculate the experience at maxlvl (10), and you want it so that each level requires increment (28) more experience than the last, you can just use this formula (without the loop):

var expperlvl = baseexp + ((maxlvl - 1) * increment);
//Note: I subtract 1 from max level so that level 1 = baseexp.

However, this is linear and not a "curve" so you'll have to be more specific about what you are trying to do.

share|improve this answer
@Drackir -- I figured out the formula. I edited my post with the solution. Sorry i wasnt more clear, but I was trying to calculate the total exp at maxlvl. Is there any simplification able to be done? – StealingMana Jun 10 '12 at 14:46
up vote 1 down vote accepted

I figured it out. I decided to attempt to work out the formula on paper first and success.

function total(){

(made alteration to the formula, now its correct)

share|improve this answer
A better answer would include an explanation of what was wrong and how you fixed it, not just code. Thank you for posting this as an answer instead of editing your question though. Improving this answer may just net you some reputation and you can level up to more privileges. – Byte56 Jun 11 '12 at 5:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.