# Math question + XP dilemma

20 replies [Last post]
bbblackwell
Offline
Joined: 10/23/2013

Hi! I am aware that what follows is probably not a viable system for my game, but it raised a math question that I would like to resolve, just for the sake of becoming a better designer.

In my adventure game, XP is accumulated by the party as they kill enemies, etc. Then, it's dished out at the end of the scenario according to the following formula:

(TOTAL XP) divided by (# OF PLAYERS) = (XP DEDUCTION)
(TOTAL XP) minus (XP DECUCTION) = (MODIFIED XP)
(MODIFIED XP) divided by (# OF PLAYERS) = XP RECEIVED PER PLAYER

EXAMPLE:
20 / 4 players = 5
20 - 5 = 15
15 / 4 = 3 XP per player

This is the math question:
Can this formula be refined to achieve the same result?
Have I just said "1+1+1+1=4" when I could have said "2+2=4"?

If you're interested in exploring further concerns about this XP dilemma, here they are (otherwise, thanks for stopping by!):

This formula requires that the solo game have an alternate formula. Namely:

(TOTAL XP) divided by (2) = (XP DEDUCTION)
(TOTAL XP) minus (XP DECUCTION) = (MODIFIED XP)
(MODIFIED XP) divided by (2) +1 = XP RECEIVED

This is what was necessary for me to get XP where I wanted it to be for each player, but it all seems ridiculously complicated. It was born of my desire to scale XP for different numbers of players. The nature of the game dictates that 2 players will have a harder game than 4 players will, and so 2 players will gain more XP for success.

This raises the question: "Why not just make the scenario grant a fixed amount of XP divided by the number of players?" The answer is that I wanted to give each kill an XP value. Personally, I don't like when I succeed in combat and receive no reward other than the elimination of the enemy.

There are gold rewards, but having each enemy drop gold would inflate the economy and be unthematic (kill a bear, get 100 gold... huh? Bears have pockets now???) There are no item drops in the game (they come via other means).

What are you thoughts? I'm open to anything.

Thanks for checking in, it's greatly appreciated!
Brian Blackwell

WikkedWood
Offline
Joined: 10/27/2016
Let's have a look

In your example, there is the following sequence of operations

X / N = Q , then
X - Q = Y , then
Y / N = R

Q is X-Y, which means X / N = X - Y
solving that for Y: Y = X - X/N
then R = (X - X/N) / N or X/N - X/N^2

Just a quick check to see if we're in line with your example
N = 4 and X = 20 gives R = 20/4 - 20/16 = 5 - 1.2 = 3.8 (3 with a remainder)
if N = 6 and X =20 you'd get R = 20/6 - 20/36 = 3.33 - 0.55 which would be 2 (eliminating the remainder)

20 / 6 = 3
20 - 3 = 17
17 / 6 = 2

so it checks out.

As you can see it's not simple arithmetic as it scales with the square of the number of players...thus you cannot reduce it simply as you feared you might have done.

If I were you, though, I'd create a table with total XP on one axis and number of players on the other and at the high end of the XP chain reduce it to arithmetic series, such as each 10 XP above a threshold 1 player gets 10, 2 players each get five, 3 players each get 3, 4,5, or 6 players each get 2, 7 or more players each get 1...something like that.

Thanks for the opportunity to actually use math I learned a thousand years ago but never use in a job that they told me I needed to be smart in math in to get!

X3M
Offline
Joined: 10/28/2013
EXAMPLE: 20 / 1 players =

EXAMPLE:
20 / 1 players = 20
20 - 20 = 0
0 / 1 = 0 XP per player

Correct?

EXAMPLE:
20 / 2 players = 10
20 - 10 = 10
10 / 2 = 5 XP per player

EXAMPLE:
20 / 3 players = 6.7
20 - 6.7 = 13.3
13.3 / 3 = 4.43 XP per player

EXAMPLE:
20 / 4 players = 5
20 - 5 = 15
15 / 4 = 3 XP per player

***

No, I think, this isn't what you want.

EXAMPLE:
20 / 4 players = 5
20 + 5 = 25
25 / 4 = 6 XP per player

And of course balance accordingly.
It cannot be rewritten to something simpler.

1 player: 40 XP
2 players: 15 XP each
3 players: 8 or 9 XP each

Offline
Joined: 07/08/2013
XP?

I'm not entirely sure what kind of game you're creating...RPG? Board Game? Card Game?

Regardless, having XP in a game should, in my opinion, should really scale according to the scope of the game. If it's a video game, XP is easy because you can automate the XP per kill and scaling doesn't require an immense amount of work or physical elements. Yes, you have to account for scale and such, but that comes out in gameplay.

If you're doing something like a board or card game, I'd keep it extremely simple. 1XP per player per fight regardless of how many players or enemies are in the encounter. Yeah, it can be cheese for the player that doesn't "do" anything, but calculations are simple.

If you're doing something like an RPG, consider something slightly more complicated or try something different. I'm working on a card game that gives loot in lieu of XP and loot (in my case) can be in the form of bullets (for their weapons), equipment, or weapons. That way everybody gets something that can benefit them and random enough for them to keep them on their toes.

Regardless, you're going to need to keep it simple unless the whole theme of the game is XP, which I'm pretty sure isn't the sole focus of the game.

But I understand your question. How do you divide up XP for multiple minion or multiple player encounters? Again, I'd stick with something extremely simple, even if it seems off. You want the player to not be bogged down by the mechanics of the XP math and be more focused on the task at hand.

Anyways, that's my take.

Offline
Joined: 09/02/2014
X3M wrote:EXAMPLE: 20 / 1

X3M wrote:
EXAMPLE:
20 / 1 players = 20
20 - 20 = 0
0 / 1 = 0 XP per player

Correct?

Yeah I looked at it for 2 seconds and that was the thing that jumped out at me. The fact that you need a special case rule for solo play is a red flag.

So OP, what are you actually trying to achieve with this system? What is the purpose of this equation?

In terms of refining it:
you have:
X (total XP)
P (number of players (2+))
D = X / P (deduction)
M = X - D (modified XP)
R = M / P (XP reward per player)

So
R = (X - D) / P
R = (X - X/P) / P
R = X (1 - 1/P) / P

If you literally want "simplified", I don't think you can go much further than that.

If you more mean "can I have a better equation to reach this goal" or something, then back to my earlier question: what are you trying to achieve?

X3M
Offline
Joined: 10/28/2013
This is what bothers me. Why

This is what bothers me. Why the special treatment on XP distribution?
Why not simply divide XP amongst the players in a normal way?

The only reason that I can think of is that the combat mechanics show altering results in the game if things grow to fast or to slow.

Are you willing to share the combat mechanics with us?

gilamonster
Offline
Joined: 08/21/2015
I think he wants to the

I think he wants to the amount of experience to decrease non-linearly with the number of players - so five players fighting against one monster have more than a five-fold advantage (and therefore gain less than one fifth of the experience in the fighting). An interesting approach, and probably not completely unrealistic.

But the way he's attempting to model this probably isn't ideal. As others have already worked out, XP_per_player=XP_TOTAL*(N-1)/N^2
where N is the number of players. The problem is that as N gets bigger, (N-1)/N^2 gets ever closer to a value of 1/N [that is, (N-1)/N^2 tends to 1/N as N tends towards infinity], so while there's a noticable difference in XP when going from two to three players, the difference per player in going from three to ten players is much less. If you rounding down to integers, it masks this somewhat (that is, above a certain number of players, nobody gets any experience for a sufficiently low-XP monster because you're throwing away the decimal points).

I would rather have the XP per player tend smoothly towards 0 as the number of players increases towards infinity. To do this "properly" you probably need an exponential decay function, but as your number of players is unlikely to be above 10, you could probably set up a simple table to approximate this, giving fraction of XP per monster to discard for a given number of players (eg. for 3-5 players, the amount of XP divided up is half that for one player, and so on).

X3M
Offline
Joined: 10/28/2013
If you put it that way. Maybe

If you put it that way. Maybe something along the lines of (XP/N)-N and rounding down.

20 XP gives
1N: 19 per player
2N: 8 per player
3N: 3 per player
4N: 1 per player

But then again. Rounding down becomes more devastating with more players. So substracting isn't even needed.

gilamonster
Offline
Joined: 08/21/2015
You are right. And my last

You are right.

And my last paragraph was utter nonsense - f(x) = 1/x definitely smoothly tends to zero as x-> inf - so sharing the XP equally and rounding down is enough.

[new equation: lots of work + lack of sleep = loss of mathematical ability]

bbblackwell
Offline
Joined: 10/23/2013
Shenanigans!

Hahah, you would think you could trust someone who made such a promise, after all, it's a rare scoundrel that uses math as a lure!

bbblackwell
Offline
Joined: 10/23/2013
Further clarification

First of all, thank you all for giving so much thought to this dilemma.

It's an RPG-style adventure card game whereby players fight together to overcome combat and skill encounters. Nothing too unusual to consider in this regard. Each enemy has an XP reward dependent upon difficulty, and upon a kill, the appropriate number of XP tokens is placed into a communal pile.

What I failed to mention earlier (/facepalm):
-The game is for 1-4 players
-The equation rounds down during each step; there are no decimals at any stage.

The goals:
-To have a per-encounter XP reward (as opposed to an overall mission reward) in order to create more satisfying encounters (kill a guy = get something tangible).
-To have XP calculations deferred to the end of the game, so as not to interrupt immersion.
-To have XP spread over the party evenly, while scaling non-linearly with the number of players (more on this below).

The challenge of each mission is not dependent upon the number of players, so I'm trying to grant more per-player XP for parties with less players, since they are actually playing a more difficult game. I thought this seemed realistic (the mission is the mission, and 2 guys will have more trouble completing it than 4 guys), so I did not seek a solution by altering this aspect of the system.

However, I don't want the XP distribution to be linear, as gilamonster mentioned, since this is less thematically accurate. I also don't want this differential to be too drastic since XP is spent between missions to purchase upgrades; so it would throw off the balance of future missions if players were able to double their XP reward by having less players, as would occur if I implemented a linear division of party XP:
20 XP/2 players = 10
20 XP/4 players = 5

So you see the conflicting goals here... I look upon my current solution with disdain, since I strongly believe in keeping things as simple as possible. I just don't know how to achieve these goals any other way and yet I'm hesitant to alter the goals themselves, believing them to be noble.

No man can serve two masters... simplicity MUST win the day, but theme always looms over my shoulder as I design my game, reminding me that there is "only one who can bend it to his will. And he does not share power!"

X3M
Offline
Joined: 10/28/2013
Simplicity it is. Total XP =

Simplicity it is.

Total XP = XP1 + XP2 x Number of missing players (max is 3)

So a creature gives XP, then you give XP for missing team effort.

And then divide this XP by the number of players.

Example:

XP1=20
XP2=5

1 player gets 35
2 players get 15 each
3 players get 8 each
4 players get 5 each

You can play with the second XP value for certain creatures. For example, a creatur that hits multiple opponents will nog be giving much XP2. But a lot of XP1. Meaning that this creature will be relatively weaker against 1 player, and thus give less XP.

The other end gives extra XP to 1 player if the creature needs a lot to be killed.

WikkedWood
Offline
Joined: 10/27/2016
Function that doesn't fall off so fast

The problem was the square in the denominator, right?

There have been some suggestions on falling off at 1/N but they still seemed TOO penalizing.

Here's yet another idea: Subtract from the numerator with a value that grows with N and THEN divide evenly.

To start to see if this is nice, I would just use as the penalty the number of "tens" in the base XP (round down). The penalty grows with number of players. After the division, you can eliminate the remainder. Two examples.

20 XP: ---> the penalty number is 2
1P = 20 XP (no advantage so no XP penalty)
2P = 20 - (1*2) = 18/2 = 9 XP each
3P = 20 - (2*2) = 16/3 = 5 XP each
4P = 20 - (3*2) = 14/4 = 3 XP each
5P = 20 - (4*2) = 12/5 = 2 XP each
6P = 20 - (5*2) = 10/6 = 1 XP each
This also shows that 6 players beating up on a lowly 20 XP monster probably doesn't gain much experience cuz it's a slaughter. You may still want to give a novel XP per, but you don't have to.

Bigger monster: 108 XP ----> the penalty number is 10
1P = 108 XP
2P = 108 - 10 = 98/2 = 49 XP each
3P = 108 - 20 = 88/3 = 29 XP each
4P = 108 - 30 = 78/4 = 19 XP each
5P = 108 - 40 = 68/5 = 13 XP each
6P = 108 - 50 = 58/6 = 9 XP each

so... Y = (X - N*Z) / N, where Z is basically X/10, rounded down

This falls off a lot slower, as there is no (square of the player number) decay.

Since this is a board game, you have a lot of power to restrict the possible values for number of players (obviously) but also the XP levels of the monsters they will encounter, so it would be a simple matter to make a table in the appendix...# of players vs. total XP to find how everybody gets ahead of time, so nobody is stuck doing math.

WW

saluk
Offline
Joined: 05/11/2010
Give everyone all the xp.

Give everyone all the xp. Then, there is a lookup table for the number of players that has the xp costs for leveling. It might look something like this:

players 1 |2 |3 |4 |
level 1 0 |0 |0 |0
level 2 20 |45 |60 |90 |

It has the same effect of making it take longer for a bigger group to get their upgrades as adjusting the xp, but without a formula the player has to worry about. They can look at their xp stack and have a good idea of how close they are getting. They can level in the middle of a mission if you want that. It also leaves you the flexibility to do things like give the last player to get a hit in some bonus xp, if you want that. You can adjust the scaling rather than relying on a strict forumla (maybe 4 players are really overpowered and need to be nerfed a bit more than 3 would for instance).

pelle
Offline
Joined: 08/11/2008
Did you consider that if

Did you consider that if scaling too much the single player might eventually become so powerful that the game will become easier than for the poor four players that have leveled up less than 25% as much? Sounds like a tricky thing to balanxe compared to scaling each encounter to be more or less difficult.

pelle
Offline
Joined: 08/11/2008
Saluk's idea sounds great for

Saluk's idea sounds great for keeping everything reasonably balanced and easy to grasp though, unlike the attempts to automatically scale each xp gain.

X3M
Offline
Joined: 10/28/2013
Yes, Saluk's idea is waaay

Yes, Saluk's idea is waaay better.
It is a one time deal for the game designer.
Players don't need to calculate.

bbblackwell
Offline
Joined: 10/23/2013
Great stuff

It's the greatest and the most troublesome characteristic of game design that the possibilities are truly infinite! Great ideas here.

The trouble is that I've divided the leveling process. A character doesn't "level up" in the traditional sense. Their "Reputation" increases as a reward for mission completion, which unlocks new missions and available card upgrades, but then they purchase these upgrades using XP. So XP is actually a currency, not an accumulated value that results in a new level.

Maybe I can just do a static deduction to the total XP based on the number of players. This deduction could come right off the top before dividing XP between the players. It's not perfect because it doesn't adjust with the varying amount of XP gained during a mission, but the possible spread of this value wouldn't be too big anyway.

Actually, it would probably be better to grant a bonus to fewer players rather than a deduction to a bigger party. It would have the same effect, but would be more psychologically palatable. I don't like the idea that people are being overtly punished for playing with their friends. This could have unfortunate results:

BIG LOU: "Hey Gary, you coming to game night?"

GARY: "Um... no... *cough* *cough*... I think I'm coming down with something..."

BIG LOU: "Liar! You're going to solo play that stupid card game again, aren't you?!"

GARY: "Don't call here anymore!!!"

bbblackwell
Offline
Joined: 10/23/2013
My thoughts exactly

pelle wrote:
Did you consider that if scaling too much the single player might eventually become so powerful that the game will become easier than for the poor four players that have leveled up less than 25% as much?

Absolutely; that won't due at all. I came up with my original formula specifically because it didn't create a huge spread when I ran the numbers through it. The average total XP accumulated during a mission is about 25, so it winds up looking something like this:

# of players/xp per player

1 player = 7xp
2 players = 6xp
3 players = 5xp
4 players = 4xp

(at each stage of the forumula, remainders are dropped)

Players can buy upgrade cards for their 20-card deck for about 1-5 XP each, depending on how powerful they are, so a solo player may be able to buy a couple of extra low-power cards between missions, or 1 mid-power card, but it wouldn't be a tremendous advantage.

Plus the game has a lot of player interaction that makes a group stronger than the sum of its parts; and characters -- although customizable -- are pretty focused, so a solo player would have a pretty tough go of it (he can do damage, but barely heal at all; he could slow enemies down, but not kill them fast enough to stop their accumulation, etc.). Even with upgrades, he'll never be able to squash the game if he's playing alone.

saluk
Offline
Joined: 05/11/2010
Re: solo game - I don't know

Re: solo game - I don't know that having the game be a bit easier for a solo player is necessarily a bad thing. I find that harder games are less fun solo because I don't have the social pressure or encouragement to make it through and am more likely to walk away. I think many coop games are in fact easier solo in general, so whether it's good or bad, at least it's the norm.

My table idea for leveling could be used for the upgrade cards as well. The levels were just a suggestion. Replace "level" with "card power level".

The infinite possibilities get me every time, no matter what creative process I am engaged in!

Just to throw more fuel on the fire, here are a few other places that you could scale:

1) encounters - with more players, they are fighting more or more powerful creatures. Many attacks in sentinels for instance do (H-x) damage, where H is the number of heros. So with more players, more damage is being dealt.

2) hero abilities - the fireball for a solo player can target 4 enemies, but with 4 players it can only target 1. You may need to do this anyway in addition to your other scaling depending on what kinds of powers you include.

It's also worth noting that in these kinds of games (the Pathfinder Adventure game is one I play regularly), I typically will play with 2 heroes if I am solo, 2 or 4 in a 2 player game, and 3 at 3 players. I think this is pretty common. So it might be worth thinking about if it would be easier to just balance the 2 and the 4 player game. 3 player can be either a little easier than with 2, or a little harder than with 4.

bbblackwell
Offline
Joined: 10/23/2013
Solo

saluk wrote:
...with more players, they are fighting more or more powerful creatures. Many attacks in sentinels for instance do (H-x) damage, where H is the number of heros. So with more players, more damage is being dealt.

It's also worth noting that in these kinds of games.. I typically will play with 2 heroes if I am solo

I know what you mean... I play solo a ton, and I never use solo vaiants. I play Pathfinder ACG with 4 characters, Shadowrun Crossfire with 2-4, etc. But apparently people do like to solo with one character, so I want to make sure they can.

Ya know, it makes a lot of sense what you're saying about scaling encounters, but it always rubs me the wrong way when I see it in games -- it seems too meta-gamey.

It feels like the Truman Show, like an omniscient hand... like the game is being laid out just for you, rather than being a world that exists and you're just entering into it.

For me, if a guy wants to go into a deadly dungeon by himself -- and ill-conceived notion -- then let him deal with the consequences. The world ain't gonna swaddle you, pal, take the heat or get out of the dragon's den!

Just my subjective preference. I want every aspect of my game to make perfect thematic sense, above all other considerations. At least then, even if nobody else likes it, I'll have what I consider to be the perfect game sitting on my shelf.