algorithmmathmultiplayergambling

How to organize bets/prizes in a game with ranked results?


Problem

I'm making a multiplayer game with bets where players end up ranked by their final score. I want to figure out how much money do they win/lose in the end based on:

  1. their ranking/score;
  2. size of their bet.

Example

There was a game with 5 players, and it ended like this:

1. Ben, score 2115, bet 100
2. Jim, score 1856, bet 250
3. Lenny, score 1512, bet 30
4. Martha, score 1220, bet 70
5. Richard, score 987, bet 50

Thoughts

Now, how do I decide who gets how much money? The only thing that's obvious for me is that player #1 should at least get their bet back so they don't lose.

I can't even tell that in a critical case of 2 players, the whole bet of 2nd ranked player goes to the winner.

Why I want the size of bets to be considered is to not make it possible that a player who bets 1 coin plays against another player who bets 100 coins and thus risks only 1 coin while their potential prize is 100. That's unfair to the player who bets 100 coins because they risk 100 times more than they can gain. I'm afraid of potential abuse.

Another questionable situation that is theoretically possible is that players end up with the same score. With no or equal bets, we could just consider it a draw, but what if players made different bets? They were in unequal conditions, had unequal risk, but achieved same result, so isn't it a win for one of them?

Possible solutions

I was thinking of an option to make "top half" of players winners, "bottom half" losers, and a possible middle player a drawer. Then, in the above game, Lenny is a drawer and gets his bet of 30 back, not losing and not gaining. Martha and Richard lose their bets and this total of 120 gets split between winners Ben and Jim. But there are some problems:

I tried to look into betting systems in other games, like poker, roulette, horse racing, but nothing exactly matches this situation.

In the worst case, I might consider awarding players from "the house" instead of what other players lost. But I would like to keep it as a game between players, not against the house.

P.S. Sorry if the question isn't exactly fit for Stack Overflow. In my view, it's actually a programming question about an algorithm/formula to handle specific data. I will consider asking elsewhere if I get a good suggestion where.


Solution

  • Match the top bet with the bottom bet. Repeat.

    In the case of ties, pool their bets, figure out how much the group wins or loses, then divide that proportionately to how much they gave. (If it comes out uneven, randomly choose who gains/loses the last point.)

    So in your example we would do this:

    1. Ben, score 2115, bet 100
    2. Jim, score 1856, bet 250
    3. Lenny, score 1512, bet 30
    4. Martha, score 1220, bet 70
    5. Richard, score 987, bet 50
    

    Match Ben with Richard. Ben wins 50, Richard drops out.

    1. Ben, score 2115, bet 50
    2. Jim, score 1856, bet 250
    3. Lenny, score 1512, bet 30
    4. Martha, score 1220, bet 70
    

    Match Ben with Martha. Ben wins 50 and drops out.

    1. Jim, score 1856, bet 250
    2. Lenny, score 1512, bet 30
    3. Martha, score 1220, bet 20
    

    Match Jim with Martha. Jim wins 20 and Martha drops out.

    1. Jim, score 1856, bet 230
    2. Lenny, score 1512, bet 30
    

    Match Jim with Lenny. Jim wins 30 and Lenny drops out.

    1. Jim, score 1856, bet 200
    

    We are done. The final division of the rewards is:

    1. Ben, score 2115, has 200
    2. Jim, score 1856, has 300
    3. Lenny, score 1512, has 0
    4. Martha, score 1220, has 0
    5. Richard, score 987, has 0
    

    And now winnings generally go to the top half. And nobody stands to gain or lose more than they put up.