Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Embargo #42

Open
rspeer opened this issue Nov 3, 2011 · 1 comment
Open

Implement Embargo #42

rspeer opened this issue Nov 3, 2011 · 1 comment
Labels

Comments

@rspeer
Copy link
Owner

rspeer commented Nov 3, 2011

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.

@vote539
Copy link

vote539 commented Jul 29, 2012

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants