Rollbot: Roll for the Galaxy AI

Rollbot: Roll for the Galaxy AI

Rollbot is an artificial player that can play Roll for the Galaxy.

Rollbot isn't just a solo variant or alternate challenge. It is an artificial intelligence that plays the entire full game by standard rules. It follows logic to select its phases based on the current game state, giving other players the opportunity to predict and benefit from its phase selection. Any number of Rollbots can play in a game with any number of humans (up to the game's normal total count of 5.) You may want to do any of the following:

How Rollbot works

Rollbot works by rolling dice, choosing a phase, assigning its dice, and playing through all chosen phases just as in the standard game of Roll for the Galaxy. Rollbot follows all the standard rules of the game as a human player would, with all of its choices defined by these rules.

Rollbot begins the game as usual, with a faction tile and home world, and gains the dice and other modifiers associated with them. Rollbot also begins by drawing two tiles as usual. It chooses the cheaper world to place on the Settle side; if that is tied it chooses the cheaper development to place on the development side; if that is also tied it picks randomly.

1. Roll dice and choose phase

Rollbot begins each turn by rolling all its dice as a human player would. Now Rollbot chooses a preference level for each phase based on the following logic. Note that for each phase, Rollbot must determine how many dice could be assigned to it. Rollbot uses all available capabilities to determine and reach that maximum, including Reassign and extra dice powers in its tableau, wild dice, and Dictate.

Rollbot now chooses its phase to call by the highest preference. If there is a tie, break it as follows:

If there is still a tie, Rollbot picks randomly, by rolling a spare white die until it shows one of the tied phases.

2. Assign dice

Rollbot now assigns dice to its chosen phase. It does so by using the available methods in this order:

Rollbot stops assigning dice to its chosen phase at the following thresholds:

Once Rollbot stops assigning to its chosen phase, it continues as follows:

Notes:

Choosing dice to reassign

The assignment steps marked by * in the above list require Rollbot to consider where it is reassigning dice from.

Pool 1: Rollbot identifies unspendable dice beyond its possible capacity to spend on each phase:

Dice from pool 1 are considered all together and are reassigned by color regardless of what phase they show.

If pool 1 is exhausted, continue as follows to keep reassigning dice. Identify dice in the following sequence of pools depending on which phase Rollbot is calling:

 Pool 2Pool 3Pool 4Pool 5
ExploreProduceShipDevelopSettle
DevelopProduceShipSettleExplore
SettleProduceShipDevelopExplore
ProduceColor-matching on
Develop/Settle/Explore
Nonmatching on
Develop/Settle/Explore
Ship
ShipColor-matching on
Develop/Settle/Explore
Nonmatching on
Develop/Settle/Explore
Produce

"Color-matching" means a die that matches a color of an empty (for Produce) or full (for Ship) world that isn't already matched by another die. Purple dice always match.

Always exhaust each pool before proceeding to the next, even if the next pool has dice of a better color.

Choosing colors

Assigning dice requires Rollbot to choose what colors it is using. Rollbot considers the dice colors to rank in the following hierarchy as listed on the game screen: Yellow > Green > Brown > Cyan > Purple > Red > White.

If Rollbot has a Dictate die that is a lower color than its phase-selection die and the phase-selection die doesn't color-match a world for Produce or Ship, swap the phase-selection die and the Dictate die.

3. Execute phases

During the turn sequence, Rollbot executes each phase chosen by anyone in the game, as a human player would. It gets all effects triggered by any of its developments during any of the phases. It returns dice assigned to uncalled phases or Dictate back into its cup, as normal.

Before beginning, Rollbot projects how many dice will be in its Citizenry at the end of the round. Add up the following:

Rollbot remembers this number as its projected Citizenry count for use in the following phases.

Explore:

Rollbot resolves Explore dice (including any extra dice granted by its developments) in the following order:

  1. Rollbot will Stock to increase its money total until it is within $1 of its projected Citizenry count.
  2. Rollbot will Scout to increase each construction stack to 2 tiles (but not beyond 13 total tiles in the tableau plus construction zone.)
  3. Rollbot will Stock to increase its money total to at least $9.
  4. Rollbot will Scout with any remaining dice (even beyond 13 tiles total.)

When Scouting, Rollbot always takes one new tile and never discards any. It places that tile on the bottom of one stack as follows:

If Rollbot is the Alien Archaeology faction (Stocking with a yellow explorer yields +$4), it will Stock with yellow explorers before non-yellow, and Scout with non-yellow explorers before yellow.

Develop:

Rollbot will place all Development dice into its construction zone and complete any developments according to standard rules.

If Rollbot will spend some dice and leave some waiting in the construction zone, it chooses the higher colors to spend into the citizenry and the lower colors to leave in wait.

If Rollbot will spend some dice and end up with extra unspendable dice refunded into its cup, it chooses the lower colors to spend into the citizenry and the higher colors to get refunded.

If a development or world instructs Rollbot to remove one of its dice, and there is no white die in the citizenry, Rollbot will spend one lowest-colored develop/settle die on that development or world. Then Rollbot removes the lowest-colored die in the citizenry. If there are none, it removes the lowest-colored die in its cup.

Settle:

Same as Develop.

Produce:

  1. Rollbot places yellow, green, brown, and cyan dice on a matching colored world if available.
  2. Rollbot places white and red dice on the highest available value worlds.
  3. Rollbot places purple dice on the highest available value worlds.
  4. Rollbot places cyan, brown, green, and yellow dice on the highest available value worlds.

Ship:

If a condition that ends the game has been reached, or if all players consuming all their goods would exhaust the VP stock, Rollbot consumes everything for the maximum points possible. If not, proceed as follows.

  1. Rollbot pairs as many shippers as possible to worlds that will result in a 3-point consume action, starting with the highest value worlds. (But it doesn't ship just yet.)
  2. Rollbot pairs as many shippers as possible to worlds that will result in a 2-point consume action, starting with the highest value worlds.
  3. Rollbot pairs its remaining shippers and worlds for 1-point consume actions, starting with the highest value worlds and lowest-colored shippers.
  4. While Rollbot's money total is below its projected Citizenry count, it trades its highest value pair that would be a 1-point consume action, then repeats this step.
  5. While Rollbot's money total is $2 or more below its projected Citizenry count, it trades its highest value pair that would be a 2-point consume action, then repeats this step.
  6. While Rollbot's money total is $4 or more below its projected Citizenry count, it trades its highest value pair that would be a 3-point consume action, then repeats this step.
  7. Rollbot consumes all remaining pairs.

Recruit:

Rollbot recruits the maximum possible dice from its Citizenry, starting with the highest available colors.

If Rollbot has no dice in the citizenry or cup and must recall one, it chooses by the following priority order:

  1. A good whose color doesn't match its world, lowest-value world first
  2. A color-matching good, lowest-value world first
  3. A die in the construction zone on whichever of Develop or Settle needs more dice to complete the topmost tile
  4. If that is tied, whichever of Develop or Settle has fewer dice
  5. If that is tied, recall from Develop

If the game has not ended, Rollbot now begins the next round as usual.

Endgame considerations

Rollbot thinks the game is likely to end this round if either of the following conditions is true:

Rollbot's endgame logic changes as follows:

Difficulty

To allow Rollbot a handicap to make for a stronger opponent, grant it a higher minimum on its money track at the end of each round.

Easy: $1 minimum (the standard rule)
Medium: $2 minimum
Hard: $3 minimum
Insane: $4 minimum and try to keep up with this monster!