dominiate icon indicating copy to clipboard operation
dominiate copied to clipboard

Implement Embargo

Open rspeer opened this issue 14 years ago • 1 comments

The interesting part is guessing what your opponent wants.

I don't want to use Geronimoo's trick of peeking into the opponent's mind.

rspeer avatar Nov 03 '11 08:11 rspeer

Hello,

I'm new here, but I've been playing Dominion for about a year and keep up on DominionStrategy.com. Since I recently learned the ins and outs of CoffeeScript, I thought I could contribute to Dominate.

I was thinking about the best way to implement Embargo without being psychic like in Geronimoo's simulator. There are a few obvious ways that I can think of, the first of which would probably be easier to implement than the others:

  1. Add a decision to choose the card to embargo, like the decisions to trash, discardHand, etc, in basicAI.coffee. By default, the decision would choose the most expensive card not in the AI's gainPriority method. (I don't know how we could "search" gainPriority seeing that it does not return all possible priorities, given the game state.) More intricate AIs would specify a custom embargoPriority() method.
  2. Look at the cards that other players have bought, and embargo those. This could possibly done by looking at the size of the current stacks, such as by defining a method on State called getSmallestStack:
getSmallestStack: (omissions) ->
  supplyByCount = sortNumericAssociative(@supply.slice(0)) # we'd define sortNumericAssociative similar to how sortNumeric is defined
  for card of supplyByCount
    return card if card.name not in omissions

getSmallestStack() would be called in embargoPriority(), and omissions would pass the value of @gainPriority:

embargoPriority: (state, my) ->
  state.getSmallestStack my.gainPriority

Again, we'd somehow have to solve the problem of my.gainPriority not returning all future gains.

Thoughts?

I've forked Dominate and will start working on it as soon as I work out some kinks (see my other post).

vote539 avatar Jul 29 '12 10:07 vote539