70 added a tool for building game boards 🗺️ but it still requires editing code to ultimately play on it. I'd like to take this idea further and allow players to build their own board to play on.
Implementation Ideas
Boards might eventually be saved to a database, but for now, I think a game board could be compressed into a string. A board is ultimately a subset of the possible 85 tiles, each mapped to a region, which could be represented as an 85-character string with 0 for "no tile" and 1-8 for "yes, a tile, in this region". The board builder could spit out such a string, which could be pasted in when starting a new game or even saved to the session (if we had longer-lived sessions) to allow playing on a custom board. And eventually, put into a database once users can log in, to allow saving your own boards to play on.
Prerequisites
[ ] For custom boards, make the number of players auto-inferred, either based on the size of the board or specifiable when starting a game (#18)
[ ] For custom boards, make the value of regions auto-inferred based on their number of border tiles (as mix regions [NAME] already calculates
[ ] Update Sengoku.Board.new to accept a compressed representation of a board
[ ] Update the Board Builder to output this compressed representation
[ ] Allow entering such a representation as a custom board when starting a new game
70 added a tool for building game boards 🗺️ but it still requires editing code to ultimately play on it. I'd like to take this idea further and allow players to build their own board to play on.
Implementation Ideas
Boards might eventually be saved to a database, but for now, I think a game board could be compressed into a string. A board is ultimately a subset of the possible 85 tiles, each mapped to a region, which could be represented as an 85-character string with
0
for "no tile" and1
-8
for "yes, a tile, in this region". The board builder could spit out such a string, which could be pasted in when starting a new game or even saved to the session (if we had longer-lived sessions) to allow playing on a custom board. And eventually, put into a database once users can log in, to allow saving your own boards to play on.Prerequisites
mix regions [NAME]
already calculatesSengoku.Board.new
to accept a compressed representation of a board