Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

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

While looking for examples of RPG experience formulas I came across this one How to create adjustable formula for RPG level up requirements?, and I would really like to figure it out because I don't seem to get the same results. I'm trying to understand the maths behind it because actually we are using UDK and Unreal scripts for our project.

Thank you in advance for your time.

share|improve this question
... what results are you getting? And what code are you using to get it? – Tetrad Jan 10 '12 at 0:33
Actually I'm trying to figure out the formula used in order to have two variables (startpoint, endpoint)I would like to set up the starting experience and the exp required at the last level. This formula uses two variables, but whenever I calculate it, I get a lesser curve. And rather than getting to 1 000 000, I get to aprox 18 000. I'm not using code (C++ nor other) but just trying to figure out the formula first. Although I found other solutions, but this one seems more suitable. Thanks in advance for your help. And sorry for not being clear enough. – JamesAlex Jan 10 '12 at 0:40
Have you tried using the same variables as the example in the answer? You'll only get to 1,000,000 that is the XP you enter for the last level. – Byte56 Jan 10 '12 at 0:46
This is what I actually did: B = log(1 000 000 / 1 000) / (40 - 1) where B = 0.0769 A = 1 000 / (exp(0.0769) - 40) where A = 924.961 oldxp = round(924.961 * exp(0.0769 * (40 - 1))) newxp = round(924.961 * exp(0.0769 * 40)) newxp - oldxp = 1486 Thanks! – JamesAlex Jan 10 '12 at 1:02
up vote 9 down vote accepted

When used together with exp, the log function is commonly understood as the natural logarithm. You are actually using base 10 logarithm (which would be log10 in C++).

Fortunately you can get the same results using base 10 logarithm, provided you also use base 10 exponent: just replace every occurrence of exp(X) with 10**X (10 to the power of X) in the formulas.

UnrealScript’s logarithm and exponent functions are called Loge and Exp.

share|improve this answer
Thanks for your help and pointing out my mistake. Now is working perfectly. – JamesAlex Jan 10 '12 at 21:24
Remember to accept Sam's answer! – Byte56 Jan 11 '12 at 0:04
Sorry if I ask, but how do you do that?(I'm new here) – JamesAlex Jan 11 '12 at 1:16
@JamesAlex: there is a checkbox on the left of all answers, next to the current vote total. – sam hocevar Jan 11 '12 at 8:03

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.