# Understanding log/exp formula for RPG experience

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.

• ... what results are you getting? And what code are you using to get it? Jan 10, 2012 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. Jan 10, 2012 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. Jan 10, 2012 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! Jan 10, 2012 at 1:02

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.