From 9d17bf6b0457aeb5fe7184110233c32889911f6d Mon Sep 17 00:00:00 2001 From: Nemo Date: Sun, 28 Jan 2018 03:34:20 +0530 Subject: [PATCH] Initial commit --- README.md | 11 +++++++++++ sushigo.capnp | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 README.md create mode 100644 sushigo.capnp diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8a5ccd --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# boardgame2vec + +An attempt at board game state space serialization. The basic assumption is that the board game is just a complicated state machine, with player playing moves that result in state transitions. + +If you can serialize a board game, you can do cool stuff: + +1. Play it over the wire +2. Record games played over time +3. Learn patterns from previous games + +This tries not to introduce players into the state itself, instead use markers to keep track of where everything is. Built using Cap'n Proto. The game rules themselves are not part of this. diff --git a/sushigo.capnp b/sushigo.capnp new file mode 100644 index 0000000..c1fd763 --- /dev/null +++ b/sushigo.capnp @@ -0,0 +1,43 @@ +@0x8c474a82150f9ee5; + +enum CardType { + chopstick @0; + dumpling @1; + maki @2; + nigiri @3; + pudding @4; + sashimi @5; + tempura @6; + wasabi @7; +} + +enum Desserts { + pudding @0; +} + +enum PlayerCardLocations { + hand @0; + meal @1; + carry @2; +} + +struct Location { + + union { + deck :group { + deck @0 :Bool; + } + + player :group { + # Which player + index @1 :UInt8; + + location @2 :PlayerCardLocations; + } + } +} + +struct Card { + type @0 :CardType; + location @1 :Location; +} \ No newline at end of file