Well I achieved my initial goal of getting into the top 10, only to be hoinked out to around 100 as the opposition got a lot stronger once the maps changed to avoid draws.
The bots that seem to beat mine have great depth in their searches. I'm using minimax with alpha beta pruning which is probably what they're using so search depth isn't the issue. So I figure their evaluation functions are finding the better moves at the same depths. My rudimentary 'most available squares' approach needs an upgrade. Without adding too much time as the evaluation function is called quite frequently (around 10000 times per second).
With the middle island forming a significant 'block' I need to get better at luring them my way, cutting their approach off then going around the other side and cutting at a point favourable to me. I'm going to try changing the evaluation function that evaluates which player is first to each square. This should give me a better sense of where a future border will be and hence try to maximize my player's area.
Link to my bot
A blog about computer and electronics projects to make life just that little bit sweeter.
Sunday, February 21, 2010
Wednesday, February 10, 2010
Google AI Competition
Hmmm, how good are AI comps? I am letting my inner geek take over for the next few days as I put the evil stumac bot in Google's AI comp.
I am currently 30th (out of 415 entrants) with a few things still to do to really make my bot competitive.
To begin with I implemented a basic strategy and that had me at 90th out of 400. When I say basic, I mean really basic (code to come after the competition).
I then added a minimax look ahead, this currently looks ahead 9 moves, a bug was causing me to lose games.
So now I will:
Hopefully this should be able to get us into the top 10.
I am currently 30th (out of 415 entrants) with a few things still to do to really make my bot competitive.
To begin with I implemented a basic strategy and that had me at 90th out of 400. When I say basic, I mean really basic (code to come after the competition).
I then added a minimax look ahead, this currently looks ahead 9 moves, a bug was causing me to lose games.
So now I will:
- alpha beta prune my minimax.
- upgrade my evaluation function.
- add a 'in same area' check and revert to flooding if in separate areas.
- Add a timing check (if possible) to give a good answer before timing out.
Hopefully this should be able to get us into the top 10.
Wednesday, November 11, 2009
Projects on the table.
Well it took longer than expected to get the 16MHz crystals, but now that I have some and I've updated the code to communicate by packets. Testing tonight.
I've been playing around with a few things recently. Software wise I've been honing my Java skills with a few little apps. I usually program in Eclipse but recently I've found I get a project up and running faster with NetBeans. I'll post them soon once they're a little prettier. The apps are:
A basic Race for the Galaxy game this interfaces with a PHP server but is incomplete as a mate implimented the game on his server.
A Tigris and Euphrates tile counter. This can read in the game log from the online implimentation at BoardGameGeek and tell you what tiles are left in the game eg. the tiles left in the players hands and the bag. Useful for those precious game winning final moves.
A program for sending data via the serial port to a 8 x 8 RGB Matrix. I saved myself the etching and purchased the semi constructed board from here.
To come: Organise and finish my guitar's pedalboard. I'm hoping to find an unwanted computer requisition the PSU and perform this instuctable again to get a nice smooth 12V.
Good thing it's winter - plenty of time to do all this :)
I've been playing around with a few things recently. Software wise I've been honing my Java skills with a few little apps. I usually program in Eclipse but recently I've found I get a project up and running faster with NetBeans. I'll post them soon once they're a little prettier. The apps are:
A basic Race for the Galaxy game this interfaces with a PHP server but is incomplete as a mate implimented the game on his server.
A Tigris and Euphrates tile counter. This can read in the game log from the online implimentation at BoardGameGeek and tell you what tiles are left in the game eg. the tiles left in the players hands and the bag. Useful for those precious game winning final moves.
A program for sending data via the serial port to a 8 x 8 RGB Matrix. I saved myself the etching and purchased the semi constructed board from here.
To come: Organise and finish my guitar's pedalboard. I'm hoping to find an unwanted computer requisition the PSU and perform this instuctable again to get a nice smooth 12V.
Good thing it's winter - plenty of time to do all this :)
Wednesday, September 23, 2009
Plant Monitor
It took me a little while to get a few bugs sorted out. But I now have a working plant monitor.
The receiver sits by the computer. It's an arduino with a loosely wired shield. The RF receiver's data line goes into the Arduino's RX. The rest are either unused or for power.
One change I will make to version 2 (if I ever get round to a version 2) is to make a small packet get sent rather than the ID and then the reading. I would also be interested in sending the temperature. I'm unsure if the temperature effects the conductivity of the soil, but I guess I'll work that out in the coming weeks. Maybe I'd have to adjust the threshold dependant on the temperature.
Both .pde files needs the RFDriver.pde file from Morris's site (mentioned in the last post). It needs to be in the same directory and this only works with Arduino's IDE version 16 onwards.
PlantRcvr.pde
PlantTrans.pde
Note - don't program the tx with rx or vice versa. Rookie mistake.

Now the transmitter is a little simpler.The idea is that one transmitter can do a windowsill full of plants. Luckily the ATmega328 has 6 A/D channels, so we don't have to do anything tricky to monitor 6 plants.
You could pull the AVR out of the arduino (carefully!) and attach the power rails and hook all of the lines up as per the pins on the arduino if you want to save yourself an arduino board. I'll be doing that as soon as I get my hands on a 16MHz crystal. Even after changing the clk fuse I can't seem to get a un-clocked chip to work.
I'm sure there's bugs in the code and it's hardly optimised at all. Let me know if you use it, like it, hate it, or find bugs. If you optimise or add functionality let me know, I'm interested to see what this could become.
One change I will make to version 2 (if I ever get round to a version 2) is to make a small packet get sent rather than the ID and then the reading. I would also be interested in sending the temperature. I'm unsure if the temperature effects the conductivity of the soil, but I guess I'll work that out in the coming weeks. Maybe I'd have to adjust the threshold dependant on the temperature.
Both .pde files needs the RFDriver.pde file from Morris's site (mentioned in the last post). It needs to be in the same directory and this only works with Arduino's IDE version 16 onwards.
PlantRcvr.pde
PlantTrans.pde
Note - don't program the tx with rx or vice versa. Rookie mistake.
Now the transmitter is a little simpler.The idea is that one transmitter can do a windowsill full of plants. Luckily the ATmega328 has 6 A/D channels, so we don't have to do anything tricky to monitor 6 plants.
You could pull the AVR out of the arduino (carefully!) and attach the power rails and hook all of the lines up as per the pins on the arduino if you want to save yourself an arduino board. I'll be doing that as soon as I get my hands on a 16MHz crystal. Even after changing the clk fuse I can't seem to get a un-clocked chip to work.
I'm sure there's bugs in the code and it's hardly optimised at all. Let me know if you use it, like it, hate it, or find bugs. If you optimise or add functionality let me know, I'm interested to see what this could become.
Monday, September 21, 2009
Arduino Project
I've been enjoying playing around with the Arduino recently. It's really quick to prototype and then I can optimize the code and port to a cheaper AVR if I like the project enough.
My girlfriend and I (okay, mainly me) struggle to keep the houseplants watered. We've lost a few crops of basil to overwatering and some chillis have dried out and are currently struggling to keep on keeping on.
So, the plan... Using the principle that dirt will have a lower resistance when it's wet, I'm going to set up some remote voltage sensors on all of the plants and then wirelessly transmit the soil moisture level to an Arduino Duemilanove equiped with a receiver.
The basic concept for the wireless link is seen at this hackaday entry - Cheap wireless for microcontrollers.
The microprocessor will check on the moisture (read:voltage) level every half hour and transmit it and their id back to the receiver shield which will sit next to my computer.
At the receiver I will store the maximum and minimum resistances. The plants should never get to 'dry' so once the moisture level is 20% above minimum. I will light up the Arduino' s LED to to indicate that the plants need watering.
Prototype reciever working... code to come.
My girlfriend and I (okay, mainly me) struggle to keep the houseplants watered. We've lost a few crops of basil to overwatering and some chillis have dried out and are currently struggling to keep on keeping on.
So, the plan... Using the principle that dirt will have a lower resistance when it's wet, I'm going to set up some remote voltage sensors on all of the plants and then wirelessly transmit the soil moisture level to an Arduino Duemilanove equiped with a receiver.
The basic concept for the wireless link is seen at this hackaday entry - Cheap wireless for microcontrollers.
The microprocessor will check on the moisture (read:voltage) level every half hour and transmit it and their id back to the receiver shield which will sit next to my computer.
At the receiver I will store the maximum and minimum resistances. The plants should never get to 'dry' so once the moisture level is 20% above minimum. I will light up the Arduino' s LED to to indicate that the plants need watering.
Prototype reciever working... code to come.
Subscribe to:
Posts (Atom)