Daily Joker Devlog: Month 2

Daily Joker Devlog: Month 2

Read about Month 1 here. Let’s dive into Month 2!

Week 1

I had an idea for a single player roguelike mode (shocker, I know). But I’m going to resist that urge and keep focusing on the multiplayer part. My big goal this month is to get a basic server up and running for cheap so I can share the game with others and get some feedback.

Troubleshooting Statistics

Since we’re dealing with 1000 automated games at a time it can be hard to detect problems with the loop. We’re just looking at stats like “win percentage” and “winningest card”. Let’s look at an example I’m working through right now:

I’m running 1000 games of this table:

  • 5 players with a deck of Blanks 1-10 and a threshold of 17.
  • 1 Daily Joker with a deck of Blanks 1-10 and a threshold of 17.

From this setup I would expect a few things:

  • All players should have around the same win/lose/bust percentage.
  • The DJ should have a higher percentage of wins, since the DJ wins any tie games.

So we plug in the table and get this WIN / LOSE / BUST percentage:

  • Player 1: Won: 41.6%, Lost: 31.1%, Busted: 27.3%
  • Player 2: Won: 39.7%, Lost: 31.4%, Busted: 28.9%
  • Player 3: Won: 41.3%, Lost: 30.0%, Busted: 28.7%
  • Player 4: Won: 38.1%, Lost: 32.6%, Busted: 29.3%
  • Player 5: Won: 38.3%, Lost: 33.5%, Busted: 28.2%

That looks about right; maybe the win percentage is a tad high. Now let’s look at the DJ:

  • Daily Joker: Won: 23.02%, Lost: 49.5%, Busted: 27.48%

What?! How? The math must be busted somehow, or there’s a problem with the randomization. After spending 30 minutes digging into the code, I found this example game that helped me realize the truth:

  • Game 936 Winners: [“Player 1, Player 2, Player 4]

….OHHHHHH!! Right. A game can have multiple player winners, but only ever has one DJ winner. An easy way to confirm this is to look at the winnings of those games:

  • Player 1 Pennies: 861
  • Player 2 Pennies: 842
  • Player 3 Pennies: 817
  • Player 4 Pennies: 900
  • Player 5 Pennies: 845
  • Daily Joker Pennies: 1,129

BOOM! Finally, an explanation. The DJ might have a lower win percentage overall, but it never splits the pot with anyone else. There’s nothing wrong with the game, I’m just bad that thinking statistically. Am I the wrong person to make this game?…No! It’s the mathematicians are wrong.

And with every little puzzle it raises the question: SHOULD the game be this way? How do things look if we tweak the rules for how winning works?

  • Current Rule: “Any unbusted player with a score higher than the DJ is a winner.”
  • New Rule: “The unbusted player(s) with the highest score(s) are the winner(s). DJ wins ties.”

How does that change the stats?

  • Player 1: Won: 18.4%, Lost: 54.3%, Busted: 27.3%, Pennies: 800
  • Player 2: Won: 20.8%, Lost: 53.0%, Busted: 26.2%, Pennies: 981
  • Player 3: 19.7%, Lost: 53.2%, Busted: 27.1%, Pennies: 925
  • Player 4: Won: 20.4%, Lost: 51.5%, Busted: 28.1%, Pennies: 914
  • Player 5: Won: 23.1%, Lost: 50.3%, Busted: 26.6%, Pennies: 1091
  • Daily Joker: Won: 24.4%, Lost: 47.76%, Busted: 27.84%, Pennies: 1,220

These stats look much more like what we would expect. This also pivots the game to be less about beating the DJ and more about beating other players. For now, I think I want to keep the focus on the DJ, even if the stats are a bit weirder. So we’ll stick with the original rules.

Suit Statistics

These are more for my benefit as a reference, but it’s also fascinating to see how the different suits impact winrates. For this test every game features 4 players and a DJ who use the Blank 1-10 cards and have a threshold of 17. But one player has a deck of a different suit, so we can see how the winrates compare.

  • Blanks 1-10: Won: 41.6%, Lost: 31.1%, Busted: 27.3%, Pennies: 861
    • The control group, Blanks have no effect. Uses the same deck and threshold as the other players and DJ.
  • Draws 1-10: Won: 41.1%, Lost: 30.3%, Busted: 28.6%, Pennies: 2263
    • Each Draw card forces the other players to draw a card, which doesn’t help them against the DJ, but does eliminate other players, increasing their winnings.
  • Jacks 1-10: Won: 57.7%, Lost: 42.3%, Busted: 0.0%, Pennies: 1279
    • Each Jack is discarded if/when the player would bust. It bumps up winrate, but doesn’t earn as many pennies as Draws.
  • Kings 1-10: Won: 41.4%, Lost: 32.7%, Busted: 25.9%, Pennies: 1035
    • Each King doubles your winnings if you are the only winner. I think if we make this stack, it would be waaaay to crazy. Realistically you only want a few Kings in your deck.
  • Lulls 1-10: Won: 31.8%, Lost: 68.2%, Busted: 0.0%, Pennies: 397
    • Each Lull reduces all players’ thresholds by 1 at the start of the game. Since it doesn’t affect the DJ, it really only shines when combo’d with other cards.
  • Negatives 1-10: Won: 0.0%, Lost: 0.0%, Busted: 100.0%, Pennies: 0
    • Each Negative reduces your score. Another silly example. Players just draw until they bust from an empty deck with a score of -55. I imagine Negatives will be more useful in deckbuilding to supplement higher values.
  • Queens 1-10: Won: 47.8%, Lost: 0.0%, Busted: 52.2%, Pennies: 1050
    • Each Queen lets you draw a card at the end of the game if you aren’t a winner. Like one more chance to try, since there’s no benefit to 2nd place. So obviously there would be no losses; you always bust or win. And the win values are a tad higher!
  • Thresh 1-10: Won: 16.0%, Lost: 1.8%, Busted: 82.2%, Pennies: 666
    • Each Thresh reduces all players’ thresholds by 1 at the start of the game. Since it doesn’t affect the DJ, it really only shines when combo’d with other cards.

So that’s some early testing and review, along with some suit effects added.

Week 2 / 3

Added a bunch more graphs and output. This is when the game really started to come together. The server and client got split into distinct pieces, and I improved the server response time so we can play 1000 games at a time.

Also implemented a dozen Daily Jokers with their own powers and ensured those powers interact differently.

oh! and I stole Mark Rober’s idea for queuing up card effects and expanding them.

And I’ve implented standard triggers for things like “Game Start”, “When Drawn”, or even conditions like “When your score is higher than 20”. This should let me add more complex suits and effects going forward.

As of this point I’ve got 8 Daily Jokers with special decks and modifiers:

  • No Joke: Does nothing. No special modifier. Ha. Ha.
  • Back to Blanks. Game Start: All cards become Blanks.
  • Buster. Game End: Players with a score above 25 are also winners.
  • Five Fingered. Game End: Anyone with more cards in hand than the Daily Joker is also a winner.
  • Greedy. Players bust over 31 instead of over 21.
  • Orderly. Game Start: Order the cards in all player’s decks from highest to lowest.
  • Quickdraw. Game ends after first turn.
  • Thief. The Daily Joker’s deck is a copy of all player’s decks combined.

And I’ve got about 25 different suits for the player, including a few that affect the Daily Joker directly!

The last few big upgrades were making all games deterministic with a random seed so I can debug and re-play games at will. I also added the ability to buy and sell cards with the pennies you earn. Added a basic login, and the ability to connect to an external server. Small stuff. Which makes Week 4 the big one…

Week 4 / 5

Oh no. No. No. No. No.

I need a replay screen. I really really did not want to make any kind of UI representation of a single game. Partially because I think it’s the least interesting part of the game, but also because one game is not a great representation of your deck.

HOWEVER! Players will definitely want to see their games, and will want to know how their cards interact. Even if it’s just to better understand the rules.

Also being able to play a single game is much better than a written tutorial; to show HOW the game works turn by turn.

So let’s look at the plan:

Clear as mud. This little Replay rabbit hole took about two week to resolve, hence “week 5” in a month that only had 4 weeks. Whatever.

A lot of the early iterations were extremely ugly and nonfunctional. Not to mention I had a devil of a time trying to think of a way to display the replays and results.

So let’s just walk through the final result, like a TV chef pulling a finished turkey from the oven.

First, the improved login screen where you can enter a username and password to resume your game if you get disconnected.

After logging in you see the deckbuilding screen that shows your entire card collection. The second picture is after we bought a pack of cards and added them to our deck.

When we’re ready we can pay the entry fee and submit our deck (the first round is free). After the server simulates 1000 games it send back the results which display in a fun little animation.

From the results screen we can see a bunch of stats, and we can click on a replay to view that one game.

And now we have the fabled replay screen of legend. The buttons along the bottom let players view the game turn by turn. Since all players draw cards at the same time, the turns can blend together a bit (e.g. if one card forced everyone else to draw a card, it looks like two turns happened at once).

BUT! it’s definitely a decent peek into how a game played out, and hopefully is enough info to see how your deck handled each game.

Demo!

Yup, it’s time to start letting people break playtest my game. It’s not fun right now, in fact it barely works. But I welcome your feedback all the same.

Please send feedback to davidschirduan@gmail.com

To try the game out for yourself, navigate to https://technicalgrimoire.itch.io/daily-joker

Password: schirduan

Hopefully you can enter a username, login, buy your first pack of cards, and see how well you do against the Daily Joker!