Hacker News new | past | comments | ask | show | jobs | submit login

Oh wow, thanks, I'll check this out.

We were doing something more like merely recording the game moves and applying them to arrive at the game state (having deterministic per-session rng). It's a good way to do it, but for the same of simplicity, this time around we just record the whole json blob per move. It simplifies undos and it also lets us easily move through history if you want to view a previous state.

But I'd love to try to apply some of your lessons to a later version. The challenge for us now is making a good api for expressing board games. That's been really tricky tbh. We've been working on this for ~7 years and have gone through many iterations of this api trying to get it right. I sure hope we're closer this time.




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.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: