Scourge is a complex game, and programming its model involves accomplishing several tasks. Starting out, I wanted to separate the game concepts that are specific to Scourge from the concepts that form the underlying structure of a strategy board game.
So! What makes a good model for a strategy board game? By “good” I mean, “offers a representation of the system it’s modeling that best facilitates reasoning about that system”. I want views, net protocols and computer opponents to be relatively easy to map to this thing. So here’s the list of criteria that I came up with:
- Each player decision must be explicitly represented : rather than leaving it up to players to discover what options are available to them, the model should create options from the state that players may then evaluate, compare and choose from. This limits the role of an AI to purely strategizing, and reduces the amount of code that a player relies on to reason about a particular rule. (I could technically write a functioning AI that performs no rule-specific reasoning about its decisions, relying solely upon a coarse estimate of the board’s value. I think it makes for a good starting point!)
- A traversable decision tree : we can couple the aforementioned player decision generation with a rewindable history object, so that players can climb up and down the decision tree like a rock climber on a climbing wall, moving from handhold to handhold, trying to reach a goal position.
- Dynamic rules : there are games with many, many rules, with each one applying to a particular context. If the game is being played in a context where a rule never applies, then the game model should not represent that rule computationally– after all, it will never contribute to the available options to a player.