Struggling: eed to know the total xp required to reach 1000

BigSneakyWorm

New member
Joined
Oct 22, 2018
Messages
2
Currently developing an XP system for a game. The system has 1000 levels and each level requires xp = (currentlevel+1) x 250. If there was 1000 levels what would be the total ammount of experience needed to reach max level? I'm awful at maths so came to you absolute warriors for help.

Working on a games XP system. The xp required to level is based on xpRequired=(currentlevel+1) x 250. The maximum level is 1000 and i need to know the total xp required to reach level 1000 starting from 1.
 
Last edited by a moderator:
Working on a games XP system. The xp required to level is based on xpRequired=(currentlevel+1) x 250. The maximum level is 1000 and i need to know the total xp required to reach level 1000 starting from 1.

Does this look right? 2*250 + 3*250 + ... + 1001*250 = (2 + 3 + ... + 1001)*250 =
Can you continue?
(I am not sure whether the last component in the sum should be 1000 or 1001 - do we need to get out of level 1000 or just reach it?)
 
What you have there seems to be correct "(1+2+3+4...) x 250"
Level 1000 would only need to be reached and not completed. Thanks for you input buddy
 
Let's call the next level you want to get to \(\displaystyle L\) (so the current level is \(\displaystyle L-1\)), and the number of experience points (XP) needed to get to that next level is \(\displaystyle X\). So \(\displaystyle L\) is the independent variable and \(\displaystyle X\) is the dependent variable (its value depends on what \(\displaystyle L\) is). This relation between two variables is also called a function. We say that \(\displaystyle X\) is a function of \(\displaystyle L\), and write it as \(\displaystyle X(L)\) (which is pronounced "\(\displaystyle X\) of \(\displaystyle L\)"), where the idea is that if you plug a certain value for \(\displaystyle L\) into the brackets, \(\displaystyle X(L)\) is an operation applied to it that gives you a certain result. So a function is like a black box that spits out certain output value when you pass a certain input value into it. In this case, we know exactly what operation the black box does. It can be written down as:

\(\displaystyle \displaystyle X(L) = 250L\)

Remember that in algebra, placing two variables (or a number and a variable) next to each other like this, means that they are multiplied together. So the above reads \(\displaystyle X(L) = 250 \times L\). I omit the times symbol below except where it is helpful for clarity (or where only numbers are being multiplied together, with no symbols). I assume that the game starts at level 0, and the formula above is applicable for levels 1 and above? In any case, let's see how this function works for the first few levels, under this assumption:

\(\displaystyle \displaystyle X(1) = 250\times1 = 250 \)

\(\displaystyle \displaystyle X(2) = 250\times2 = 500\)

\(\displaystyle \displaystyle X(3) = 250\times3 = 750\)

.
.
.

\(\displaystyle \displaystyle X(1000) = 250\times1000 = 250\,000\)


To get the total number of XP needed to finish the game, you need to add these up cumulatively, i.e.:

\(\displaystyle \displaystyle X_\mathrm{total} = X(1) + X(2) + X(3) + \cdots + X(1000) \)

It would be really easy to copy and paste the \(\displaystyle X(L)\) equation into 1000 cells in a column of (ironically enough) an Excel spreadsheet. Then all you'd have to do is sum up all the values in the column. But if you would like to know how to work this out without resorting to a computer, then it might help to first write the equation for the total XP in a more compact way. Mathematicians use the Greek capital letter Sigma (\(\displaystyle \Sigma\)) to indicate the summation operator. And they place limits below and above it to indicate the lower and upper values of the range over which an expression is supposed to be summed:

\(\displaystyle \displaystyle X_\mathrm{total} = \sum_{L=1}^{1000} X(L) = \sum_{L=1}^{1000} 250L \)

Now notice, that every single term in this sum is multiplied by 250. Therefore, the 250 can be factored out (brought outside of the summation operator) and we just end up with

\(\displaystyle \displaystyle X_\mathrm{total} = 250\sum_{L=1}^{1000} L \)

This is just (250 times) the sum of the first 1000 consecutive whole numbers. Let's call this sum \(\displaystyle S\). Is there a way to figure out what the sum of the first \(\displaystyle N\) whole numbers is? Yes, there is a trick that the famous mathematician Gauss came up with (I think when he was only 7 years old?). You duplicate this sum, write it down in reverse, and place it underneath the first sum:

\(\displaystyle S = 1 + 2 + 3 + \cdots + (N-2) + (N-1) + N \)

\(\displaystyle S = N + (N-1) + (N-2) + \cdots + 3 + 2 + 1 \)

Now, take the above two equations and add them together vertically. You end up with:

\(\displaystyle 2S = (N+1) + (N+1) + (N+1) + \cdots + (N+1) + (N+1) + (N+1) \)

So twice the sum we were looking for turns out to just be equal to \(\displaystyle (N+1)\) added together \(\displaystyle N\) times. Therefore the sum of the first \(\displaystyle N\) whole numbers is:

\(\displaystyle S = \frac{N\times(N+1)}{2} \)

In our case, \(\displaystyle N=1000\). So we end up with:

\(\displaystyle \displaystyle \begin{aligned}X_\mathrm{total} &= 250\sum_{L=1}^{1000} L = 250 \times \frac{1000 \times 1001}{2}\\ &= 250\times \frac{1\,001\,000}{2} = 250 \times 500\,500 = 125\,125\,000 \end{aligned}\)

It looks like you need 125,125,000 (125 million and 125 thousand) XP to get through this game.
 
Last edited:
Also note that 1+ 2+ 3+ …+ n= n(n+1)/2 so that (1+ 2+ 3+ …+ 999)250= 999(500)(250)= 124875000.
 
Top