The Gaming Beast and why I don’t get the important things done

I like computer games. I like a lot of games. So much that it’s becoming almost like an addiction. Not the one that makes me lie to people and forces me to make morally despicable choices just to satisfy the Beast, but the kind that stops me from being a better version of myself.
Tell me you don’t recognize the situation; I got some stuff I should do, doesn’t matter if it’s important or just a little thing. I want to do it, and doing it would give me a sense of achievement. If I did it I wouldn’t have it hanging over my head. But somehow I end up putting it off and not having it done by the time I end up going to bed, which these days end up being much later than it should be. Especially considering I got two small kids to take care of.
Why is this? Games. Lots and lots of games. It’s so easy when I settle in front of the computer, which is around 8 PM, when the kids are sleeping. I feel my energy ebbing out, knowing I could be doing things with my time now, that I can’t do during the day, if only I could muster the willpower … And then it’s just sitting there. That little icon that promises a few minutes of fun. It starts off so innocent and BAM, the evening has passed. The wife and I have an understanding. She likes watching TV, I like my computer games. And we go to bed at the same time. Well used to anyways.

So why is this? Because I’m soft. Because I’ve put myself in a vicious loop where I don’t get enough sleep since I’m up playing games, and I play games since I’m too tired to do anything else. But I know I’m able to change this. I just need to take the first step… And this is it. So tomorrow evening I’ll refrain from clicking that little time consuming icon. If I can’t muster the energy to get the important things done first, then just shut the computer down and go to bed, or read a book, or spend time with my significant other.
So tomorrow I’ll let the Beast sleep.
And who knows, I may even get something done …

How fast do users upgrade to a new version of your app?

Hi,

About a month ago I released a new version of the 10,000 app. It contained a few things but nothing ground breaking. Nonetheless I had some assumptions about how fast users would upgrade their app, more precisely I expected that 80 to 90 percent would be running the latest version within 30 days of launch.
At the time of writing a little over a month has passed and I have some numbers to reflect on. With a total of about 10,000 active device installs (totally coincidental :)) I think there’s some basis for statistics, which I find interesting.

EDIT: I made a miscalculation the first time I ran through the numbers. I have adjusted this and some of my conclusions has been re examined and adjusted accordingly.

 

The numbers

After 1 day: 15.5 % had upgraded
After 2 days: 28.9 %
After 3 days: 33.7 %
After 4 days: 36.4 %
After 5 days: 38.9 %
After 6 days: 40.0 %
After 1 week: 42.1 %
After 2 weeks: 48.4 %
After 3 weeks: 52.6 %
After 4 weeks: 55.9 %
After 1 month: 56.8 %

What I find interesting is two things.

  1. The “curve” flattens quicker than I anticipated. After recalculating the numbers it’s not cut in half every day, but the curve still rapidly flattens
  2. A little over half the devices have been upgraded one month after the release.

 

Conclusions

I’ll be wary of what to conclude based on this, but for future reference I’ll just note that getting a new version out to all users/devices is going to take a lot longer than I first anticipated. If only 3.3 % upgrades every week from now, which is the difference between week 3 and 4, it’ll take more than 4 months total, for all devices to get upgraded.

 

Just something to think about 😉

10,000 version 1.4 on Google Play

Hi all,

I’ve put a new version of “10,000 – The Dice Game” (there’s a link at the bottom of the post) with a few new things in it.

  • Bug Fixed! One of the user, Brian Farmer, took the time to write a review, where he described an error where the game was reset if your screen went to sleep. That bug is now fixed and your game will now live on, while your phone takes a break. Thank you, Brian.
  • Cookie Policy. A popup appears when you start the app for the first time (or the first time after you update to 1.4). This warns the user about the use of cookies and provides a link where they can read more about it. This is a requirement to comply with the European legislation and the Google User Consent Policy. I chose to not restrict the message to EU citizens only.
  • Danish Translation. I am Danish after all, so why not 😉

 

As the astute reader may have noticed, the Google Play listing has also been changed a bit. A user, Daniel Der, made me aware the a comma is the correct digit grouping sign. That has also been corrected in the game too. Thank you, Daniel.

 

That is it for now. I’ll be eagerly awaiting the data on how fast the updates are getting to the users and maybe even make a post about that.

 

Best regards

Lars Sonne

 

And there’s the link I promised 🙂

Statistics as per 29th of May

Hi again,

 

I hope you all have been having fun with some Dragons of Tarkir and maybe even some Modern Masters. Personally I’ve only been playing the Khans of Tarkir block lately. And having a ton of fun 🙂

I’ve managed to win a few online events. Besides that I feel like I’ve steadily improved my performance, both with regards to deckbuilding and play skills. I can’t say that I’m tearing it up, but my online rating in Limited is above 1700.

 

The numbers for the last 5 months for the rounds played/won:

Month Played Won Win percentage
January 24 14 58,3%
February 22 9 40,9%
Match 13 8 61,5%
April 8 6 75,0%
May 14 9 64,3%

… and for matches played/won:

Month Played Won Win percentage
January 60 33 55,0%
February 48 20 41,7%
Match 32 19 59,4%
April 17 11 64,7%
May 30 19 63,3%

 

I’ve made a graph of my progress since I started tracking.

2015-05-29-mtg-graph

 

The numbers are getting a little low for an actual statistical analysis, but none the less I feel like I’m on the right track. Especially after a dreadful performance in February, where the percentages shows a dip. I’ve mostly been playing in the PPW and Phantom queues, but I still have things to learn every time I play. Most importantly I’ve consistently been asking myself “Do I feel up for 3 hours of Magic?” before I jump in queue and deciding to not do so if I felt that I would perform poorly. That I think has had the most profound effect on my performance.

 

Until next time, have fun playing 🙂

Building an AI (part 2)

This is part 2 of a series on building an AI for the dice game “10.000”. To read part 1 go here.

 

The mission

My goal is that at the end of this post I’ll have a set of formal rules that can be coded into the AI. I want to know what the odds are for scoring when rolling any number of dice and how many points I can expect to score. I also want to make a simple decision tree for when to roll and when not to roll.

 

Calculating the odds

Since I’m no genius when it comes to statistics, I read a few articles on the dice probabilities at different rolls. For those of you that are interested you can find some mathematics explained here, here and here. These articles give us a basis for determining what the chances are of not being able to score points on a given roll.

In the following I’ll be listing tables showing the number of combinations that score points and the probability of these when rolling X dice (the columns “# successes” and “Success %” respectively). Conversely I’ve also listed the chance of not rolling points (the “Failure %” column). In the first table I’ll assume no 3-of-a-kind has been rolled or what I’d like to call basic probability.

The total number of combinations is calculated as 6^x, where x is the number of dice rolled.

Basic probability

Dice # Successes Success % Failure %
6 45.576 97,69 % 2,31 %
5 7.176 92,28 % 7,72 %
4 1.092 84,26 % 15,74 %
3 156 72,22 % 27,78 %
2 20 55,56 % 44,44 %
1 2 33,33 % 66,67 %

 

When rolling 1, 2 or 3 dice it also becomes relevant if there has been rolled 3-of-a-kind previously, since it increases your odds of rolling dice that can score points. In the second table I’ll assume that there has been rolled 3-of-a-kind of 2’s, 3’s, 4’s or 6’s, since these affect the odds.

3-of-a-kind already rolled

Dice # Successes Success % Failure %
3 192 88,89 % 11,11 %
2 27 75,00 % 25,00 %
1 3 50,00 % 50,00 %

 

Diving deeper into the combinations

These odds can be divided further into the different combinations of dice. I’ll list a separate table for every number of dice rolled, sorted by their success probability in ascending order. The column “Combinations” is the name of the combination you scored. “# Successes” and “Success %” express the same as before.

The row “Two 3-of-a-kind” have been included since we use all the dice and unlock all 6 on successive rolls. The row “1 or 5” is for the cases when none of the other combinations occurs.

 

Rolling 6 dice

Combinations # Successes Success %
6-of-a-kind 6 0,01 %
5-of-a-kind 180 0,39 %
Two 3-of-a-kind 300  0,64 %
Straight 720  1,54 %
Three pairs 1.800  3,86 %
4-of-a-kind 2.250  4,82 %
3-of-a-kind 14.400  30,86 %
1 or 5 25.920  55,56 %

 

If you sum up “# Successes” you’ll luckily end up with 45.576, which is the same number as listed in the basic probability table above. In the next two tables the process is repeated for four or five dice.

 

Rolling 5 dice

Combinations # Successes Success %
5-of-a-kind 6 0,08 %
4-of-a-kind 150 1,93 %
3-of-a-kind 1.500 19,29 %
1 or 5 5.520 70,99 %

 

Rolling 4 dice

Combinations # Successes Success %
4-of-a-kind 6 0,46 %
3-of-a-kind 120 9,26 %
1 or 5 966 74,54 %

 

The next three tables are for rolling one, two or three dice without having rolled a 3-of-a-kind previously.

 

Rolling 3 dice

Combinations # Successes Success %
3-of-a-kind 6 2,78 %
1 or 5 150 69,44 %

 

Rolling 2 dice

Combinations # Successes Success %
1 or 5 20 55,56 %

 

Rolling 1 dice

Combinations # Successes Success %
1 or 5 2 33,33 %

 

You could also be rolling one, two or three dice when you’ve already rolled 3-of-a-kind. The following tables shows, where I’ve added the row “Add to 3-of-a-kind” for this. Remember the odds only change when the 3-of-a-kind is 2’s, 3’s 4’s or 6’s.

 

Rolling 3 dice with 3-of-a-kind already rolled

Combinations # Successes Success %
3-of-a-kind 5 2,31 %
Add to 3-of-a-kind 91 42,13 %
1 or 5 96 44,44 %

 

Rolling 2 dice with 3-of-a-kind already rolled

Combinations # Successes Success %
Add to 3-of-a-kind 11 30,56 %
1 or 5 16 44,44 %

 

Rolling 1 dice with 3-of-a-kind already rolled

Combinations # Successes Success %
Add to 3-of-a-kind 1 16,67 %
1 or 5 2 33,33 %

 

This covers the odds for every combination of dice.

 

Weighting the odds

We now have some probabilities down that we can use to guide our decisions (and the AI’s) on whether or not we want to roll the dice at any given point. However if you just decided to roll based on the probability of scoring alone, you would not be playing optimally i.e. scoring the most points.

Enter Expected Value and Opportunity Cost.

So what is this?

Expected Value (or EV) is the value we statistically can anticipate getting over the long run from our roll. In this case the score we can add on average. The Opportunity Cost is the value we give up by rolling; being the points we could have banked instead of rolling.

How do we use that when deciding whether or not to roll?

What we basically want to be doing is weighting out the two, by saying if my opportunity cost greater than my EV, I shouldn’t roll. But why is this correct? Let’s take an example. You have one dice left and have already scored a 1, a 5 and 3-of-a-kind of 2’s. Your chance of rolling and scoring is 50%. You could either be rolling a 1 scoring 100, a 5 scoring 50 or a 2 scoring 200 more. This would give you an average score of 116,67, but only on 50% of your rolls, giving you an EV of 58,33. Your opportunity cost is your current unbanked points of 350 times the chance you’ll miss out on points on the next roll giving you 116,67. Since the opportunity cost is greater than the EV you should be banking instead of rolling here.

To put it simply:

If EV > Opportunity cost, then roll.

Otherwise bank the points.

This is not the complete answer though. It would be if we always banked after this roll, but we could choose to roll again and again. Therefore we need to factor in the EV of successive rolls, at least to some extent. But how do we do this, since you can score and therefore remove a different number of dice after each roll? I’m certain that smarter and more mathematically experienced people would be able to solve this puzzle, but I accepted that the heuristic I’m building will not guarantee that the optimal solution would be found every time, which I why I’ll believe I could employ a short cut here. Calculate the chance of having scored all six dice at the end of the roll when rolling any number of remaining dice. Then weight this by multiplying by the EV of rolling all six dice. This post is however getting quite lengthy, so I’ll save this part for now.

 

The Expected Value of a roll

Working on the combinations I listed earlier I will now map out the EV of every combination on every number of dice rolled. By doing this we get the last set of numbers we need to make an equation for when to roll and when to not. The assumption is that you’ll score the maximum number of dice.

 

Rolling 6 dice

Combinations EV
6-of-a-kind 2.000
5-of-a-kind 1.525
Two 3-of-a-kind 1.000
Straight 1.000
Three pairs 750
4-of-a-kind 1.050
3-of-a-kind 575
1 or 5 156

 

Rolling 5 dice

Combinations EV
5-of-a-kind 1.500
4-of-a-kind 1.025
3-of-a-kind 550
1 or 5 139

 

Rolling 4 dice

Combinations EV
4-of-a-kind 1.000
3-of-a-kind 525
1 or 5 121

 

Rolling 3 dice

Combinations EV
3-of-a-kind 500
1 or 5 105

 

Rolling 2 dice

Combinations EV
1 or 5 90

 

Rolling 1 dice

Combinations EV
1 or 5 75

 

Rolling 3 dice with 3-of-a-kind already rolled

Combinations EV
3-of-a-kind 500
Add to 3-of-a-kind 3-of-a-kind value * 108/91
1 or 5 105

 

The fraction in the “Add to 3-of-a-kind” is to account for doubles and triples. I counted these by hand.

 

Rolling 2 dice with 3-of-a-kind already rolled

Combinations EV
Add to 3-of-a-kind 3-of-a-kind value * 12/11
1 or 5 94

 

Rolling 1 dice with 3-of-a-kind already rolled

Combinations EV
Add to 3-of-a-kind 3-of-a-kind value
1 or 5 75

 

That should be enough numbers to feed into the equation.

 

What if any kind of special rules take effect when playing the last round?

During the last round we could use the equation, but it is not enough to bank any number of points. It only matters if your total score exceeds that of all of your opponents. A simple solution is to keep rolling until you have more points (both banked and unbanked) than your opponent.

Put simply:

If banked + unbanked points <= opponents score, then roll.

Otherwise bank

 

That should be enough to implement a set of rules for the AI.

Building an AI (part 1)

Hi again,

After being in hiatus for quite some time I’ve gotten back to programming a bit. I guess there is an ebb and flow with everything.

Back in November I was looking into how I could be Building an AI with ASyncTask, but I never got to feed the thing some rules with regards to how to play the game. This I aim to remedy now. Since this could get pretty lengthy I’m planning a short series as I go though the process of building an AI for the dice game “10.000”.

 

Choosing a method for problem solving

Building an AI can be done in different ways. I haven’t explored the topic that much, but I could see going about problem solving in different ways; neural networks or some other kinds of fuzzy logic, search algorithms or a basic heuristic. I do however have some programming experience with heuristics and I believe that, since we’re talking about a limited problem space like this a heuristic can do the job just fine.

One of the issues at hand is whether or not we want to get the optimal solution i.e. winning as fast as possible. I can see an argument for building an AI that can do this, but I don’t think it would be very fun to play against. The probability built into the game somewhat remedies this, but the AI should strike a balance between being challenging to play against and still being beatable. Another plus for using a heuristic is that they can be made to give us an answer in short time consistently, thus giving the user a better experience.

 

A basic set of rules

When implementing the heuristic I need to come up with some rules that it will consist of. In principle I want the AI mimics the process of a human player asking himself a set of questions at every decision point during his turn and answering them based on a predefined logic (as humans we have the advantage of being able to adjust our evaluation during a game, whereas my AI will have a fixed set of rules).

Questions you could be asking yourself?

  • What is the probability of being able to make points with X dices?
  • What is the reward for rolling the dices?
  • What is the risk for rolling the dices?
  • Is it the last round and do I have the most points?

Joining these together my heuristic becomes:

Rule A) If my chance of success times the reward for rolling the dices is bigger than the chance of failure times the risk, then roll the dice. Otherwise bank the points (if able)

Rule B) If it is the last round and I haven’t got the most points, then keep rolling.

 

What remains to be done?

For now I’ve established a basic set of rules. To determine whether or not the AI should keep rolling I need to feed some numbers into rule A. These numbers I’ll try and calculate in my next post using statistical analysis.

 

That’s it for now 🙂

 

EDIT: To read part 2 go here.

Statistics as per 31th of October

It’s been a while since I posted anything about my progress in Magic. That is not indicative of my play time. I’ve done both release and pre-release events and quite a few drafts online. I’ve had both ups and downs and at the moment I’m on an up. The numbers won’t show it though 🙂

I haven’t been able to win a single event since July, but that’s ok, since I’m learning a ton. I’m doing the slow bleed and I’m ok with that. I’m having fun despite that.

The numbers breaks down like this for the rounds played/won:

Month Played Won Win percentage
July 23 14 60,9%
August 24 12 50,0%
September 25 14 56,0%
October 43 24 55,8%

… and for matches played/won:

Month Played Won Win percentage
July 52 30 57,7%
August 62 32 51,6%
September 56 29 51,8%
October 106 54 50,9%

I’ve made a small graph of this.
stats-october

As you can see my round win percentage tanked in August and I have been trying to improve that since then. My match win percentage has been pretty stable, but I’ve noticed that getting far more 0-2’s and 2-1’s than 2-0’s and 1-2’s, which is supported by the fact that the match win percentage is lower than the round win percentage.

So where have I gone from here
First off, I’ve started playing Swiss drafts. This may have some effect on the numbers, but I can’t tell you how much.
I’ve started recording the events I play in, both the actual matches and results on an overall basis. I review these and try to figure out where I can get better. I feel like this has already helped me quite a bit, but it’s sometimes tedious work. Oh well, it’s all good 🙂

So November may be shaping up to be a good month for me… who knows?

Statistics for August – M15

Once again I tallied up the score for events played. This time it’s the August numbers, and that was not one of my better performances.

 

Win percentages

The numbers from August where:

Type Played Won Win percentage
Events 7 0 0,0%
Rounds 21 10 47,6%
Matches 54 28 51,9%

No events won, which is ok. I never participate in an event, and expect to win it. If I win it is just a nice surprise, since it drastically improves my Expected Value of the event. But losing more than half my rounds really gave food for thought. This ties into the statistics on the color distribution, but more on that later.

 

Color distribution

I also did some statistics on the deck color distribution and their individual win rates:

 Guild (Color) Wins Losses Rounds Win percentage
Blue 2 1 3 66,67%
Selesnya (WG) 4 6 10 40,00%
Golgari (BG) 4 4 8 50,00%

First off, the sample size on each color is relatively small, which makes any conclusions based on this quite uncertain. The numbers for blue (which is from alive draft) and BG are quite ok, but the WG combination just fell through for me. When I read Matt Costas article on how Team Pantheon dissected the M15 draft format, it gave me a wealth of information I wanted to try out, but I think I may have screwed up somewhere along the way. I think, and this is where I second guess myself, that I may have been forcing the Selesnya decks too much. This may be based off an assumption that they’d come through more often than not. I could have been building them wrong or just misevaluated their power level in general, but the fact of the matter is that I lost far more with those, than with any of the others. Of course I didn’t play much else 😉

Another thing I noticed is that my mood is directly linked to my win percentage in an event. This is something that I really need to work on, since no game should be worth getting pissed over.

 

Takeaways

– Don’t force too much. Look at all options a second time

– It’s not important to win, but to improve.

 

Until next time, take care 🙂

Statistics for July – Theros Block action

It’s been a while since my last post. A little too long not to have something new to write about 😀

 

At the beginning of July I started taking notes on how my performance was on MTGO. At the time I was playing only Phantom Sealed Theros Block events. I was doing ok, since my goal was to win more rounds and matches than I lost.

 

Win percentages

The numbers from July where:

Type Played Won Win percentage
Events 9 1 11,1%
Rounds 26 15 57,7%
Matches 60 34 56,7%

That at least shows me that I accomplished my aforementioned goal 🙂

 

Color distribution

I also did some statistics on the deck color distribution and their individual win rates:

 Guild (Color) Wins Losses Rounds Win percentage
Azorius (WU) 2 1 3 66,67%
Selesnya (WG) 1 1 2 50,00%
Izzet (UR) 3 3 6 50,00%
Simic (UG) 6 3 9 66,67%
Golgari (BG) 3 3 6 50,00%

The sample size may be too small to be able say anything conclusive about, but it does shed some light on how I’m performing. M15 has already been released and I’ll continue keeping track of the events I play.

 

Until next time, may your mana curve be smooth and efficient 😉

PTQ Post mortem

Hi again,

 

This is a follow up on my previous post. The PTQ in Aarhus is over and I feel it’s time to look back on how things shaped out for me.

 

With unlimited time and the intellect of a genius I guess anythings possible. Unfortunately I had neither, although I think less could have put me at the top.  In the end the result was not a ticket to the Pro Tour, since I went 4-4 on the day of the PTQ. The final result put me at a 49th place out of a 150 participants.

 

The pool

The pool contained the cards below. To begin with I built a midrange RB deck, but after losing my first three matches, I asked a friend and went into aggro. That helped 🙂

The final deck contained the following

[d]

Creatures

1 Felhide Brawler

1 Pain Seer

1 Blood-Toll Harpy

1 Odunos River Trawler

1 Nyxborn Eidolon

1 Felhide Minotaur

1 Insatiable Harpy

1 Gray Merchant of Asphodel

1 Marshmist Titan

1 Cyclops of One-Eyed Pass

1 Everflame Eidolon

1 Nyxborn Rollicker

1 Minotaur Skullcleaver

1 Thunder Brute

1 Firedrinker Satyr

Spells

1 Pharika’s Cure

1 Read the Bones

1 Lash of the Whip

1 Sip of Hemlock

1 Bolt of Keranos

1 Fearsome Temper

1 Rage of Purphoros

1 Magma Jet

Lands

1 Unknown Shores

9 Swamps

7 Mountains

Sideboard

1 Servant of Tymaret

1 Cavern Lampad

1 Warchanter of Mogis

1 Marshmist Titan

1 Spearpoint Oread

1 Read the Bones

2 Rise to the Challenge

1 Portent of Betrayal

1 Siren of the Fanged Coast

1 Nimbus Naiad

1 Chorus of the Tides

1 Divination

1 Vortex Elemental

2 Retraction Helix

1 Artisan of Forms

1 Crypsis

1 Stratus Walk

1 Crackling Triton

1 Priest of Iroas

2 Loyal Pegasus

1 Nyxborn Shieldmate

1 Observant Alseid

1 Wingsteed Rider

1 Ray of Dissolution

1 Decorated Griffin

1 Fated Retribution

1 Hold at Bay

2 Last Breath

1 Great Hart

1 Vanquish the Foul

1 Ephara’s Radience

1 Forsaken Drifters

1 Weight of the Underworld

1 Drown in Sorrow

1 Medomai the Ageless

1 Ephara’s Enlightenment

1 Sealock Monster

1 Dissolve

1 Triton Shorethief

1 Gainsay

1 Lost in a Labyrinth

1 Evanescent Intellect

1 Thassa’s Rebuff

1 Nylea’s Disciple

1 Sedge Scorpion

1 Nessian Wilds Ravager

1 Pheres-Band Tromper

1 Swordwise Centaur

1 Satyr Hedonist

1 Fade into Antiquity

1 Time to Feed

1 Raised by Wolves

1 Satyr Piper

1 Hunt the Hunter

1 Defend the Hearth

1 Satyr Wayfinder

1 Guardian of Meletis

[/d]

 

When looking back I think I made a mistake when I constructed my deck. The cards to take it towards aggro where there, but I missed it and went into some midrange solution. The deck tried to do two different things, which I’m not interested in in general. I believe that the more uniform a decks plan is, the better it will perform.