Hello,

I was wondering if someone could help me. My calculus skills are many years rusty, however I think I have an interesting practical application of calculus in a video game. I think this could be a good real-world example on what math can solve. Could anyone help me solve this dilemma?

Bacroground information | Rules:

General XP gain - This a mass multiplayer game where a player advances in the game by gaining experience points (XP). For example, when you start you are level one. To reach level 2, you must gain 300 XP. To gain 300 XP, you can kill monsters that give you 25 XP points each time you kill them. So after 12 kills of this specific monster, you have now leveled up to level 2. Now to reach level 3, you now need to accumulate 450 more XP points. This process goes on and on until you reach level 200, the max possible level. But to reach level 200, you need say 200,000,000 XP points to move from level 199 to level 200. I am unsure of the XP needed for each level increase exponentially or in a linear fashion. If needed I might be able to provide the data, but I hope that doesn't need to be accounted for in the final equation.

Monsters - The monsters being killed are of different levels also. So back to our level 1 example. The monster being killed yields 25 XP and this monster is the same level of the player, level 1. But if our player kills a higher level monster, say a level 6 monster, the level 1 player now receives say 249 XP for killing a a level 6 monster when they are level 1. A player can kill a monster who is 20 levels below the player and receive XP, but the XP will be very low since the monster is very easy to kill. Once the monster is more than 20 levels below the player, when killed the monster no longer yields XP. However, if the monster being killed is of a higher level than the player the player keeps gaining more and more XP depending on how many levels higher the monster is compared to the player.

Parties - This is where the curve ball comes in. Players in this game often work together in a "party" which is anywhere from 2 to 8 players in a group. When someone in the party kills a monster (high enough level to yield XP), everyone in the party receives XP. The problem is though, the XP is not just simply divided amongst the players. Players of a higher level gain more XP, while players of a lower level receive less depending on their level. If a party of 3 level 70 players are killing level 20 monsters, no one in the party is receiving XP because the monster is too easy to kill. BUT, if a level 1 player joins the 3 level 70 players, now when that same level 20 monster is killed, everyone in the party now begins to receive XP because the monster is difficult to the level 1.

Goals of this project:

I want to be able to predict how much XP each player in a party will receive depending on many variables. Basically what is needed is a formula which does the following.

INPUT:
Number of players in party
Levels of each player in party
Level of the monster being killed
(Possibly the amount of XP needed to "level up" for each player-let me know if it's needed)

OUTPUT:

Exact XP received for each person the party

Data to work with:

I have gathered some data to show how the rules work and to use in "reverse engineering" this process/equation/formula. This first batch of data is from parties of players killing a single monster and the XP gained from each person in the party:

DATA SET 1:
Level of monsters being killed = 56
Number of people in Party = 5
Average Level of party = 66.8
Levels of people in party: 41, 51, 71, 82, 89
Exp received per kill/player: 140, 157, 201, 212, 220 (Means the level 71 player got 201 EXP)
Average Exp per person in party: 183.9

More data, with the level player no longer from the party:

Level of monsters being killed = 56
Number of people in Party = 4
Average Level of party = 70.75
Levels of people in party: 41, 71, 82, 89
Exp received per kill/player: 141, 205, 223, 226
Average Exp per person in party: 202

Oddly, without a player who is lower level than the monster being killed, the rest of the party begins receiving more XP.

DATA SET 2:

Here is data from SINGLE players (No party) kill monsters of various levels. Note how some monsters yield more or less XP than they should if monster level vs. XP from monster was graphed in a linear fashion. Most of the data points are linear, however some spike a little bit. Please try to use the "trend line" of this data.

Player Level Monster Level XP Gained
1 2 61
2 8 106
4 2 57
4 6 92
4 8 106
4 11 128
55 36 31
55 42 142
55 44 242
55 44 253
55 54 277
55 50 329
55 56 440
95 78 124
95 76 191
95 80 262
95 98 297
95 88 495
95 90 588
95 99 729
95 95 777

With this above data, I was able to plot points in Excel to create a chart with a trend line. The trend line would then give me the formula for 1 player's XP gain formula. For the lvl 95 player, the forumla was y = 0.0275x + 76.099 and for the level 4 player the formula is y = 0.1266x - 5.3683 (y=MonsterLevel and x=XP Gained from monster). The problem is though that is only Single Player XP gain at the specific level of the player you are calculating for. The lvl 95 formula doesn't work for the level 4 player. I think all three columns of data above need to be graphed/poltted in 3D and then a new formula created for Single Player XP gain at any level. But I don't know how to graph in 3d, nor would I remember how to determine the equation for something like that.

So, is there any really smart people out there willing to help? The suggest course to the solution is to:

-Determine how XP is calculated for a single player
-Determine how much XP the party gains.
-Determine how the party XP is distributed among the players.

If you need any clarifications on the rules, or more data, please let me know and I can provide it. It just might take me a day or two to get a party of people together and generate and accurately record the data.

Hello!

I can help you with your dilemma. To find a formula for calculating the XP gained by each player in the party, we need to consider several factors:

1. XP Calculation for a Single Player: To determine how XP is calculated for a single player, we can analyze the data you have provided. By plotting the player's level against the XP gained from killing monsters, we can create a trendline equation that represents the relationship between the two variables. This equation will allow us to calculate the XP gained by a single player at any level.

2. Party XP Gain: To calculate the total XP gained by the party, we need to sum up the XP gained by each player. This calculation will depend on the number of players in the party, the level of the monster being killed, and the XP gained by each player (using the equation obtained from step 1).

3. Distribution of Party XP: To distribute the party XP among the players, we need to consider the level of each player relative to the monster being killed. Players of higher levels should receive more XP, while players of lower levels should receive less. Determining the exact distribution formula might require analyzing more data and considering the rules of the game.

To get started on finding the XP formula, let's tackle the first step:

Step 1: Calculate XP for a Single Player
- Plot the player's level against the XP gained from killing monsters using the data provided. You can use Excel or any other graphing tool for this.
- Once you have the scatter plot, try fitting a trendline or curve to the data points. This will give you an equation that represents the relationship between the player's level and the XP gained.
- If the trendline equation doesn't provide an accurate fit for all player levels, you might need additional data or different approaches to create a more general formula.

Try to follow these steps and let me know if you need any further assistance or have additional questions.