Two versions of Don’t be a Stranger

May 28, 2012

I’m hoping to get a new PC this autumn and in an attempt to cut down on the amount of stuff I’ll need to backup and copy across to a new system, I’m slowly going through old Cubase, FL Studio and Reaper projects and working out what to keep and what to bin. There’s a lot of half done stuff kicking around on my hard disc drive.

Read the rest of this entry »

Advertisements

Developing Dominion: Day 4

May 26, 2012

(well, it’s really day 5, but post 4).

Anyway, a few small updates. Hopefully you can play it here.

  • The AI is still stupid. And it never takes advantage of any bonus actions.
  • I’ve implemented most of the “simple” core cards. If I’ve missed anything obvious, let me know.
  • I’ve started adding in some flexibility to my code so I can implement cards with “small print.” So far, the only one that I’ve added is the witch.

Plans for the next update mainly involve creating some simple algorithms that will allow the AI to play its current hand sensibly.
ie, instead of picking an action card from its hand at random, it should first play cards such as village which grant it addition actions. It should also aim to maximise the amount of money it will have in the buy phase. This is a pretty simple heuristic, although it doesn’t place any value on making other players pick up curses, or gaining the ability to buy more than one card.


Day 3 of my Dominion AI project

May 24, 2012

Ok, a few bugs have been fixed and I think the implementation is now playable. If you can find a bug, please let me know. Or any other suggestions![I have a sneaking suspicion that the player decks aren’t working properly, but I’m not sure… will do some digging].

So, assuming I don’t find any more bugs, I’ll soon by able to start work on coding some AI algorithms 🙂 I’ll start with a few baseline dumb algorithms.

  • random1: play actions randomly, and buy cards randomly (although I’ll tell the AI to never buy curse cards.
  • random2: as above, but it will always try and buy the most expensive card it can afford.
  • big money: a common, simple and effective strategy. The algorithm only buys silver, gold or provinces.

I’ll also have to write some code to save game results for future analysis. 🙂

 

 


Day 2 of my Dominion AI project

May 23, 2012

Ok, no progress on the AI last night, but my code now supports human intelligence! (Ie, you can play against the AI. Which is useful for checking that the game has actually been implemented properly!)

Will I haven’t quite finished implementing the game rules, you can have a peak here if you like.

Known bugs:

  • the game currently doesn’t let you pass.
  • related to the above, if you play a card that grants extra actions, but have action cards to play, then you’re stuck
  • I need to give better feedback on what the AI is doing.

I’ll hopefully fix some of these tonight. If you spot any other bugs, please let me know. And also bear in mind that the AI is just playing randomly… it’s as likely to buy a curse card as anything else. Once I get the interface working a little smoother, I’ll start implementing some simple, and not so simple, heuristics.

 

 


A Little Coding Project: Dominion AI

May 22, 2012

Hello,

as part of my ongoing paranoia about future employment prospects, I’ve decided to work a bit on my coding skills, and building something that shows off some of my machine learning knowledge. I’m going to start with building an AI for the card game Dominion. The game itself is pretty simple (the Wikipedia article explains the rules, so I won’t explain it here), with two main decisions to make each turn:

Read the rest of this entry »