# Marrakesh (2022) Unofficial AI-Based Solitaire Mode by Allan647 Version 0.1 – 4/30/2023

Acknowledgements: This solitaire mode is strictly a “fan-made” project to be made entirely free for public use/modification, and is not affiliated with the Marrakesh(2022) board game, its designer Stefan Feld, or its publisher Queen Games.

## Design Goal:

Implement a solitaire mode for the “Marrakesh”(2022) board game. The solitaire mode consists of an AI opponent that attempts to simulate a second player, while providing a means for the solo human player to familiarize themselves with the core mechanics in the game so they can teach the game to other human players next game night. The key design priorities in order are:

1) Usability: Minimize the solo player’s efforts in performing the AI’s turns (at the cost of AI competitiveness). Minimize if … then … else evaluations for the solo player to do for the AI. [Solo player has enough thinking to do already : )]

2) Rules: Minimize the amount of changes to the base game rules applicable on the solo player’s turns.

3) Difficulty: Provide a means for the solo player to adjust the difficulty level towards meeting the win condition(i.e Most VPs wins). The modifiers in these rules will be prefixed by “[Variant: ....]”.

## Setup:

\- Setup main board as in the base rules

Solo Player uses same player board setup as in a 2-player game [Variant: setup player board as in a 3p game]

\- 1 player board for AI, but no Supply Board, and no Provisions Board. Randomly set Pink Wheel on AI board.

AI gets 6 Assistants next to their player board instead of 3 (i.e use 3 of another colour different from yours) and may activate up to 6 Assistants on its player board on its turn

\- Solo Player starts game with Mr. Feld, and Ms. Camel [Variant: AI starts game with Mr. Feld and Ms. Camel]

\- No other changes to the setup from the official rules

## Rules Exceptions for the AI (for entirety of the game unless overridden by any rules proceeding):

The AI does not collect resources for the entire game or have to feed its ‘people’ at the end of each season (because they are bots ; ).

\- AI never pays resource costs for anything in the game EXCEPT for Luxury Goods(it pays Keshis as applicable)

AI chooses bonuses in order 1) VPs 2) Mosque/Palace Tracks 3) River 4) Keshi

## Breaking Ties for AI when More than one Choice is Feasible (in general) by Priority:

1) Use AI player board and go left->right top->down order by District:

Brown>Grey>Blue>Green>Beige>White>Market>Black>Pink). [N.B It’s less management for solo player this way : )]

2) Use left->right, top->down reading order as shown on the Cube Tower base[i.e Brown>Blue>Orange ….. >Green>Black>Pink].

3) For Palace/Mosque Track: AI moves up on track on which it is behind you [Variant: Move up on track where it is in highest position].

4) Solo player chooses for AI.

## Game Loop:

## For Each Season[1 to 3]

1) Season Start: Solo player starts with 12 Keshis(one of each colour as usual). For the AI put 2 of each colour in the bag (i.e the AI starts each season with 24 Keshi)

## 1) Keshi Selection and Placement of Assistants:

i. Solo player selects 3 Keshis per base game rules, and assigns the 3 Assistants accordingly.

ii. AI randomly draws 6 Keshis from the bag and assigns Assistants to the corresponding Districts accordingly. The ‘Market’(Souk) District may have maximum of 3 Assistants for the AI on its turn. [Variant/Difficulty Modifier: Restrict to maximum of 1 or 2 Assistants for AI ‘Market’] (Note: AI does not necessarily place all Assistants on any given turn. For example, if it draws 2 Blue Keshis, it only deploys one Assistant to Blue Region)

iii. If AI draws one or more Red Keshi, the corresponding Assistant(s) goes on the AI board in the District in which it has the most Keshis. If multiple Districts on AI board are tied for most Keshi, then assign the Red Keshi in left->right top->down order by District(i.e Brown>Grey>Blue>Green>Beige>White>Market>Black>Pink)

iv. Dunk the 9 Keshi into the Cube Tower(i.e your 3 Keshis + 6 Keshis from AI).

## 2) Keshi Draft/Deployment: AI Drafts the maximum of 2 Keshi if possible, otherwise AI drafts just 1. break ties by drafting in left->right, top->down reading order as shown on the cube tower base[i.e Brown>Blue>Orange …

>Green>Black>Pink). AI will not draft a colour for any District already fully-populated by Keshis(including Red) on its player board. AI deploys Keshi as follows for the corresponding Districts below:

a) Red Keshi: Deploy to District where AI has most Keshis on its player board. Break ties per “Breaking Ties…” section above.

b) Brown Keshi: Deploy Keshi left->right bottom->top (i.e 2VP->2 resources->Black path 1<sup>st</sup> hidden Oases-> White path 1<sup>st</sup> hidden Oases -> …. -> Black path final hidden Oases -> White path Final Oases). Flip Oases tile according to base rules.

c) Pink Keshi: AI deploys Keshi in Pink District in this preference order: 2VP>River Bump>Palace/Mosque Bump>Gain Purple/Orange/Yellow Keshi, and gains the Deployment bonus per base rules. The other spots in the Pink Districts do not give bonuses to the AI and are merely there to allow the AI to complete the District for 10VP District completion bonus at end of game. [Variant: Treat the water space as equivalent to the River bump space for difficulty increase].

d) For all other Keshi colours, follow the standard base game rules.

3) Activation of Assistants on AI Player Board: AI activates its Assistants in District order as described in the “Breaking Ties…” section above. [Variant: Start with District with the most Keshis present to least. Break ties per section “Breaking Ties…” above]. If AI has no Keshi in the District it is activating, it gains a Keshi in the District and applicable deployment bonus. Modifications to the base game rules for AI’s Activations below:

a) Brown District: Only Deploy a Brown Keshi from the supply to the District per section 2(b) above. If the District has no space left to deploy a Keshi, move the bottom-most Oases tile above the AI’s player board. It will score a maximum of 3 of these tiles above its board at end of game for 7VP each.

b) Green District: No Dates for AI! [Variant: 1VP per Green Keshi in the District]

c) Beige: For each Beige Keshi in the Guard Tower, AI will take a City Gate matching the coloured District where it has the most Keshis deployed (must have a Red Keshi in that District). It will take the Gate from the left-most Workshop space gaining the VP bonus (or -3VP from first Workshop). It scores 2VP on colour match per base game rules.

d) Gray: AI's scroll purchasing power is sum of all Gray Keshis it has deployed. It will acquire as many scrolls as its purchasing power permits and chooses scrolls in preference order:

1. Most Scholars requirement to least(i.e 7,5,3) in left-right reading order

2. Ongoing Ability Tiles (i.e Tile with ∞ ) [It will not use these abilities during game]

3. Tile with lowest Stack height

e) Blue District: Bump +1 per Blue Keshi in District + 1 bump per Red Keshi in which the AI still has an Assistant on(including this District).

f) Black/White Districts: Same as base game. When AI passes thresholds on the Black/White tracks, AI gets 1VP (instead of Coin) and 1 connection bonus per usual (VP bonus only).

g) Pink: Rotate the wheel one wedge per base rules. AI gets bonus in ONE location where there is a 3x multiplier on the pink wheel facing an already deployed pink Keshi. AI gains applicable bonus 3x (see Section 2c above for applicable bonuses and tie-breakers).

h) Market(Souk): AI spends as many Keshi it can afford to acquire the Luxury good that scores the most VPs. Break any ties by choosing from the Blue Tile stack with lowest height. If it cannot afford any Luxury good, look at the prices for the face-up Luxury goods in the market and determine which colour(Orange/Yellow/Purple) appears most on the tiles. It gains and deploys one Keshi of that colour to its Market(Souk).

4) End of Round: AI Always chooses highest VP bonus on River if it qualifies for the bonus.

## End Round Loop

River Evaluation: Same as standard base game rules.

Providing for Citizens: N/A for the AI. Base game rules still apply for human solo player.

## End Season Loop

End of Game Scoring: Same as base game for the solo player. AI scores 7VP for each Oases it has above its board (up to a maximum 3 Oases tiles). [Variant: Score 5VP/3VP/1VP for each of AI’s Oases tile to lower difficulty to taste].

End of Game Loop

Variant(s):

Beat-Your-Own-Score: Same rules as above, just don’t score VPs for the AI : ). Win with 200VP or more.

## END OF DOCUMENT