Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: Not that complicated, but my first AI  (Read 2802 times)

0 Members and 1 Guest are viewing this topic.

JustANewPlayer

  • Pearl Diver
  • **
  • Offline Offline
  • Posts: 13
  • Respect: +1
    • View Profile
Not that complicated, but my first AI
« on: February 22, 2012, 09:02:16 pm »
0

Just a basic Woodcutter/Gardens, since it seems to be missing. Any obvious changes?

Code: [Select]
<player name="Woodcutter/Gardens"
 author="Anonymous"
 description="">
 <type name="Bot"/>
 <type name="TwoPlayer"/>
 <type name="Optimized"/>
 <type name="UserCreated"/>
 <type name="Province"/>
   <buy name="Province"/>
   <buy name="Duchy">
      <condition>
         <left type="countCardsInSupply" attribute="Gardens"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Gardens">
      <condition>
         <left type="countCardsInDeck" attribute="Woodcutter"/>
         <operator type="greaterOrEqualThan" />
         <right type="constant" attribute="6.0"/>
      </condition>
   </buy>
   <buy name="Gardens">
      <condition>
         <left type="countCardsInSupply" attribute="Woodcutter"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Woodcutter"/>
   <buy name="Estate">
      <condition>
         <left type="countCardsInSupply" attribute="Gardens"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
   <buy name="Copper"/>
</player>

Note that I don't expect it to be able to buy Provinces, I just put it there in case there is some crazy fringe case where it can. Also, I have no idea what the magic number is for Woodcutters; this is just a complete guess.
« Last Edit: February 23, 2012, 04:44:11 pm by JustANewPlayer »
Logged

ftl

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2056
  • Shuffle iT Username: ftl
  • Respect: +1345
    • View Profile
Re: Not that complicated, but my first AI
« Reply #1 on: February 22, 2012, 11:15:18 pm »
0

How does it do versus the default Workshop/Gardens included with the simulator?

Obvious change - it shouldn't always take silver over estate! As it is, this bot will buy up a bunch of woodcutters, then run out the gardens and woodcutters, and then build up enough silvers to run out the duchies. As it is, with $4, I think in this rush, Estate/Estate is better than Silver/Copper when Gardens and Woodcutters run out.

Things you may want to try optimizing:
1) Play around with the number of Woodcutters to get before gardens. You pointed that out yourself.
2) Buying estates should probably take precedence over buying silvers? You will be buying things with mostly woodcutters and coppers, I suspect that by the time the woodcutters are out, you want estates rather than silvers? But you should sim that and see whether it's actually true.
Logged

JustANewPlayer

  • Pearl Diver
  • **
  • Offline Offline
  • Posts: 13
  • Respect: +1
    • View Profile
Re: Not that complicated, but my first AI
« Reply #2 on: February 22, 2012, 11:29:52 pm »
0

Good point about the Silver; I swapped them. As for the number of Woodcutters, 6 does happen to be a good balance, based on the (admittedly little) testing I did.
Logged

Algebraist

  • Scout
  • ****
  • Offline Offline
  • Posts: 43
  • Respect: +26
    • View Profile
Re: Not that complicated, but my first AI
« Reply #3 on: February 23, 2012, 11:16:48 am »
0

You need something a bit more subtle than just "buy gardens if at least X woodcutters" to handle the mirror matchup. At present, if the woodcutters split 5-5, your bot will never buy a gardens at all!
Logged

DG

  • Governor
  • *****
  • Offline Offline
  • Posts: 4074
  • Respect: +2624
    • View Profile
Re: Not that complicated, but my first AI
« Reply #4 on: February 23, 2012, 12:49:33 pm »
0

A first tip would be to shuffle some cards up and see how you would play it yourself so you have some idea when you're buying each type of card. Alternatively you can look at your simulator game logs and ask yourself "why is the bot doing that?". Some things you might consider are

- Do you need to buy estates right from the start? Can you set a condition to buy them later in the game?
- Can you time your purchase of terminal actions a little better so that they don't collide so often?
- Are there times when you'd buy a duchy ahead of a gardens? Does it depend upon your opponent's strategy?
- If you have two buys can you check the available $ to make better purchases. Should 8$ be spent on province+copper, duchy+woodcutter, or gardens+gardens?
Logged

JustANewPlayer

  • Pearl Diver
  • **
  • Offline Offline
  • Posts: 13
  • Respect: +1
    • View Profile
Re: Not that complicated, but my first AI
« Reply #5 on: February 23, 2012, 04:14:01 pm »
0

You need something a bit more subtle than just "buy gardens if at least X woodcutters" to handle the mirror matchup. At present, if the woodcutters split 5-5, your bot will never buy a gardens at all!

True, hadn't thought of that. Fixed.

A first tip would be to shuffle some cards up and see how you would play it yourself so you have some idea when you're buying each type of card. Alternatively you can look at your simulator game logs and ask yourself "why is the bot doing that?". Some things you might consider are

- Do you need to buy estates right from the start? Can you set a condition to buy them later in the game? True, I'm thinking only after the Gardens are all gone
- Can you time your purchase of terminal actions a little better so that they don't collide so often? Good idea, but I'm not sure how.
- Are there times when you'd buy a duchy ahead of a gardens? Does it depend upon your opponent's strategy? It's virtually impossible for the bot to end up with less than 30 cards, so Gardens will always be a priority.
- If you have two buys can you check the available $ to make better purchases. Should 8$ be spent on province+copper, duchy+woodcutter, or gardens+gardens? Again, I'm not quite sure how I'd implement it.
Logged
Pages: [1]
 

Page created in 0.042 seconds with 20 queries.