Category Archives: ranking

Back to the game ranking app

Finally after at least a couple of years I have returned to the rewrite of the ranking code I wrote.

I got a new copy of the data from the bgstat app that I use to record my game plays. The app also the master list of all the games that make up my game collection. And syncs all of that info back onto the bgg website for me.

The point I’m making is this new data file is different to the one I originally got from the app some six or seven years ago. Back then it was just a csv file of the game plays.

Now its a json file that contains all the apps data. So not only game results, list of games, locations, tags, etc.

Luckily using Python as the language of choice for this project means there is a nice json library I can import in to do all the heavy lifting for me to read in and process the json file I have.

Sadly for me the json used by bgstats is not a simple format. It contains arrays within arrays! A nightmare to code to get to the information that I need for this project, even with a json library.

Now if you had asked me before I had started this second attempt at a rewrite that the bits of data analysis I’ve been picking up (different projects) would be of use here. I would of been a bit sceptical.

However using the pandas library I found out I could use pandas to extract these arrays within arrays to get the data I want into a dataframe.

Having the data in a dataframe opens up all sorts of cool data analysis stuff I can do.

So not only can I do the paired comparisons, and top 10 lists, but also produce stats that not even the bgstats app currently does.

Acheron island paradise

Just a quickie I’m still alive!

I thought I’d better post something if only to confirm the opening statement.

Decided to take a “break” from Bioshock for a day or two to play, well start Animal Crossing New Horizons.

I know I’m nearly a year late to the party. But I’m here now. I started my island adventures yesterday, and if you stalk me on Instagram or Twitter amongst chihuahua and coffee/food pictures (not much gaming to photograph at the mo) you will be able to follow my struggles with island life.

It won’t be more than a day or so more before I return to Rapture, and get into a daily routine of visiting Acheron between visits to that dystopian utopia!

If you wish to visit Acheron in a dream you can with the dream address below.

Also during this radio silence I’ve made a start rewriting my python game ranking program.

Once that’s complete I’ll repeat the exercise I did in 2017 of working out what my top 100 games of all time are.

Top 10 Mechanics in My Game Collection

This morning when I drove into work I thought “I wonder how many games I have by mechanic? Just what are the top mechanics in my collection?”

So after trying to get some sql written to extract that information for me, I gave up and wrote the functionality I wanted in Python in a fraction of the time.

So here are the Top 10 Mechanics in My Game Collection.

  1. Hand Management (90 games)
  2. Dice Rolling (80 games)
  3. Variable Player Powers (70 games)
  4. Set Collection (44 games)
  5. Card Drafting (43 games)
  6. Modular Board (40 games)
  7. Player Elimination (36 games)
  8. Co-operative Play (31 games)
  9. Area Control / Area Influence (28 games)
  10. Deck / Pool Building (23 games)

It should be noted that the games could have (and most probably will) more than one game mechanic, so will have been counted more than once.

However it’s still interesting to see this sort of information. I would have never in a million years thought that I had that many games with a hand management mechanic.

I might write a small version of my ranking engine to allow me to rank these game mechanics, and also maybe publisher and designer. If I look at my rankings only four of my Top 10 games that I own have this mechanic. Which is 40%. While the mechanic itself is approximately 41% of my collection. So in this case there does seem to be some correlation between the two.

With this new information in hand I can do a series of posts now of my Top 10 games by popularity of the mechanic in my collection.

Verses: Istanbul vs Viticulture 

Well I think there has been enough of a break to justify doing another of these Verses posts. I actually put this match up out there before the expo.

It really is a hard decision to make. Then again I think I have said that about more than one of these so far. Both of these games are in my Top 10 (at the moment, but I don’t expect that to change).

Istanbul, when played with all the expansions goes from a great game to an amazing game. The random nature of the layout of the tiles (taking into account a couple of tile positioning rules that stop one or two tiles being near each other) adds to the replay-ability of the game. With the expansions there is more than one path to victory. Plus there is a little take that added when you can block a route on the board slowing down your opponents.

Viticulture is a great worker placement game. But like Istanbul add in the expansions and wow. This has great production values. The turn order selection for each round is really cool, and gets even better when using the Tuscany extended board. The decisions you have to make at this stage before you have placed any workers on the board is incredible.

These two games are great examples of how to take great games and then take them to the next level with the expansions. I’d only play either without the expansions when introducing new players to the games. Otherwise it has to be all in (well we are still working towards that with Viticulture).

What did I decide? Well I don’t think it will come as any surprise to anyone I sat on the fence on this one and called it a draw. It is so hard to decide which one I prefer more than the other. There really is nothing that separates these two.

On Facebook Jonathan echoes my feelings about this one.

On a follow up, since the comment was made by Gavin, he has caved and bought Viticulture.
On Instagram I had one comment. I think the difficulty of this match up scared people off. That or they just didn’t care.

Ranking Engine Update

I feel like I have been doing lots to this project this week with not much to show for it.

As you can see I’ve just edged over the 25% mark for the number of pairwise comparisons that I need to do for my game ranking of my collection.

I’m not going to bore you with another “look at my current top 10”. Instead I’m going to bore you with my top 10 worker placement games based on my current rankings of games. 

What this really show cases is the start of the next stage of my stats engine. After a bit of behind the scenes rewriting of code, I’ve started a gui front end (see below). It’s an ugly, not designed gui. I’ll sketch something out over the weekend. 

But basically I can select a game mechanic and find all the games in my collection that have that mechanic. 

It then takes those results, and finds out how I’ve ranked them, followed by printing out the top ten. 

So before I add categories, designers and publishers I need to sort out the gui. That’s the major effort. 

Once that’s been done I’ll expand the stats to look at the bgg hotlist, followed by the bgg all time top 100. 

I then have more stuff on the road map. Wait did I just type that? That almost makes me sound like professional and I’ve planned it. But in reality I haven’t and I’m not. I’m making things up as I go along. I have ideas that I really should write down before they are lost. In away these posts are acting as my dev notebook. Well hopefully gentle reminders. 

Hopefully you can see things are progressing both code wise and rankings wise. I also hope you are finding the verses posts interesting. Which were a surprise spin off from this project.

Anyway I’ll see you in my next post.

Top 10 After 15% Completed

I’ve hit 15% or 3476 of the total pairwise comparisons that I have to do to rank my game collection. Which I thought was a good point to stop, take a snapshot of the top 10 (well it’s 11 really because I forgot to take zero into account).

Interesting to see what I consider (will this exercise back up that gut feeling?) to be my favourite Pandemic, Iberia drop out of the top 10. Also Tiny Epic Galaxies has also dropped to just outside the top 10.

I also have a new number one game at the moment. I think that the top 3 has been settled on. These will just be jostling for which of the top 3 places they take. The remaining top spots I’m expecting possibly three to be replaced by other games. But we will see. There are still some epic match ups to come.

An Early Top 10 Games of All Time

I’m just over 7% into my journey/experiment in ranking my game collection. That’s 1659 pairwise comparisons (so far).

I have an initial version of the lists/stats engine, that pulls off the results, calculates a value for each game in the collection, and then sorts that list into descending order. That sorted list is then printed out to the screen.

So running the lists/stats engine python script gives me the following 11 games as my Top 10 games (so far). Naturally as I complete more pairwise comparisons this list will change as more results are available. With more results the more reliable and accurate the list will be. I must do some research into at what point do the results generated become truly representative (is that the correct word?) There must be a tipping point where doing more tests is irrelevant because it doesn’t impact the results.

Anyhoo (and I bet that gets up the noses of some folks) here is the first very temporary top ten games of all time.

 

Ranking – Progress Update

So this may not look much. BUT I have a ranking engine for my game collection!

Yep I now have a python script that creates match ups from my collection, and records the results. As you can see the script also gives me the depressing information that in total I will have to do a lot of pairwise comparisons. 23005 to be exact, based on a game collection of 215 games (it’s a couple more than that now, but that updated list hasn’t been imported into the database yet). The formula I used to work this out was totalNumTests = N(N-1)/2.

So two thirds of the way there. I now need to create my lists/stats engine. Or get an initial version done. But considering how many pairwise comparisons I have to do, it’s going to be a while before you see the fruits of that labour. However you may see the odd post that discusses one of the pairwise comparisons. Why did I rank game A better than game B, and asking for which one you’d choose?

To Do List:

  • Update script for populating to database with games to allow updates to the collection.
  • Lists/Stats Engine
  • Long term: create a GUI front end

Boardgaming and Coding

This post has taken me a day or three to write. Hence why you haven’t been bored by me.

Plus my only other gaming has been the enrichment session for my students since the last post. Which I don’t talk too much about. But do remind you from time to time that I do. I will say about the one at the start of the week is that I introduced a student to Star Realms and deckbuilding. We spent the session playing that game. It was just “one more game” from the student at the end of each one. Plus when I told the student there was an app. They were going to go on Steam to buy it that evening. So I think that was a success. It’s nice to see a student enjoy a game so much they get it for themselves.

Now on with the post and the words I’ve been struggling to write…

Everyone, and I mean everyone whose anyone in the boardgame social media world has done their top 100 games of all time or their top ten this or top five that. From time to time you also get a similar thing on Instagram (see screen grab below).


I’ve tried those sort of posts myself the odd time in the past. I’m not a big fan of them in reality. I kinda see them as click bait. Which will mean this post and the project I’m going to talk about will not make much sense.

These “my top 100 games (insert year here)” lists kind of interest me. Mainly how do they come up with their list? What process do they use? Now that I have started recording my game plays could I produce a similar list based on the number of plays? Would that be a fair reflection of how much I like the game? Is that a good way to rank games I like? I can see flaws in doing it this way.

Just before Christmas there was a website that went up that tried to help you rank the games in your collection. You uploaded a csv (comma separated file) of your collection. Then it would start a series of random game match ups from your collection, where you decide which is the winner. Eventually after lots of these match ups it ranks the games in your collection.

That process is known as pairwise comparison. And allows you to determine a relative order for a group of items. Which in our case is board games.

So I’ve started a project to create my own little ranking program. I’m using Python 3 to write this little project. Mainly because it is quick to prototype with, has some great libraries for doing stuff like accessing a database, web scraping, reading csv files etc. Plus I need to keep my Python skills fresh.

My initial question for this whole project is “What are my top 100 favorite games?” After this has been completed I will then be able to ask other questions such as “What are my top 5 drafting games?” And I’m sure with the data in place other questions will be asked, and expanded on.

But what have I done so far for this project? Well we all know there are not enough hours in the day to do everything. You can’t be lazy, watch tv, play board games, write a blog, hold down a full time job and do other stuff! In other words I did nothing until recently.

Here is what I have done so far…

I started off with a csv file of my game collection downloaded from the bgg website. Which I then tidied up in Excel. This was mainly removing entries that weren’t games but expansions. In data science terminology I was cleaning my data!

I then wrote a Python program to read in the cleaned up data and put it into a sqlite3 database. For each game in the file the program uses the bgg api to get its details. The program then extracts from the returned results the missing information that I want to use later, such as genre, mechanic, designer, etc. Once it has done that the game is added to the sqlite3 database.

This means I now have an sqlite3 database that holds my game collection on a table with the extra info that I have always felt was missing from the csv bgg provide you with. I can now interrogate the sqlite3 database and get a list of all my dice games, or all the games I own by Eric Lang.

I am currently working on a new program in this project which is the the actual ranking engine.  So far this program connects to the sqlite3 database, finds out the number of games I have and generates two random numbers, and then pulls the games details matching those two numbers. You then get something like the following image:

At the moment I can type something in, and the program will keep coming up with new match ups. However at the moment I do nothing with the answer. That’s the next stage of this ranking engine. I need to store the result in a new table. I’m just getting my head round what the best way is to store the information. Because I am using a two dimensional array (well list in Python, although I might use the numpy library to give me a real array) to store the results, I think the best way to store that is with a blob field type. Which means I will have to serialize the data in the array before storing it in the database.

Once the ranking engine has been finished. It’s onto my data visualization engine. This will be the program that pulls off the results and give me like my top 100 games, or top 10 deckbuilders. I also plan to have it also be able to tell me how many of the bgg hotlist I have played or own.

The nice thing about this project is I can also share the badly written code with my students. So they will have examples of how to connect to a sqlite3 database, or read in a csv file, use a web api and use the xml libraries.

So now that I have bored you with an “overview” of my little project. I will threaten you with a more detailed write up once it is completed.