Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You might be interested in the Phase abstraction of my engine.

Basically you represent your board game as a tree of phases through which your game progresses in.

Each node of your phase tree can contain state. At any point, your game is at leaf of your tree, and the state of the game is composed of all the states of all the nodes from the current leaf-phase to the root of the tree. Each leaf node also have a set of possible inputs describing what possible action players can take to progress into the game. This makes it really easy to handle games that have special "rare" phase that can break the flow of the game (for 7 Wonders: Duel, for example, phases where players must resolve a wonder's effect that asks them to destroy an opponent's card).



That's almost exactly what I've done here, and then defined various nodes with different behaviour like for-loops, while-loops, etc.

Take a look at https://docs.boardzilla.io/game/flow to see how it looks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: