In the game being developed, players will be playing best-of-three matches against one another. XP will be given out depending on their score vs the average score and will receive a bonus for whether or not they win or lose.
Given the nature of our game, players will be able to leave a match in between any of the 3 rounds, able to return to them at a later point in time. In order to decentivize players from starting and immediately leaving games/not continuing if they sense they might just lose, I've designed an equation around the idea that alters/gives bonus xp based on if/how many rounds they have played.
In said equation, I reference variables monitored by our database for recording reasons, specifically 'round,' which notes what round the player is currently on, and 'win,' which refers to whether or not the player won.
The issue I'm having is it's been a good long time since I took any Maths classes and have forgotten a good chunk of notation + terminology, and am struggling to put my thoughts down into words, either to explain to programming or search to help myself.
Eqn:
$\text{XP}= \lfloor \frac{p}{a}* R\rfloor + E$
In this equation:
- p = player's highest score from the 3 rounds
- a = Game's Average Score / 10
- R = Rounds played bonus (Bonus based on number of rounds they played)
- E = End status bonus (Bonus based on whether they won or lost)
My probelm here is the fact that R depends on the round # recorded in the database and similarly E depends on whether or not they won as recorded in database, and in both cases I'm not sure how to notate it.
If in database:
- round = 1, R = 1
- round = 2, R = 1.15
- round = 3, R = 1.35
- win = 1, E = 15
- win = 0, E = 5
- win = 2, E = 0
- win = 3, E = 0
In relation to my equation, how can I best notate everything?
Edit: Pic of me attempting to explain said equation to programming in poor handwriting
Fairly certain I'm not notating that 100% correctly, given programmer literally said "could you put this part in an equation?" while pointing at my if thens.