can I use the SharedMatrix to create a ticktacktoe game in fluid framework? #8614
Replies: 1 comment 1 reply
-
Yes, you could, but there are some things to note. First, Fluid isn't a great fit for turn-based games/apps. You can definitely do it, but you will need to enforce the turns (i.e. make sure only one player can change data at a time) yourself. If your goal is to explore Fluid, I would recommend not worrying about the turn-base aspect and instead make a "tic-tac-toe grid simulator." All users could write an X or an O in any grid, so there would be no enforcement of the game rules, but there would be a shared game board where the players can "collaborate" on the board contents. This would enable you to focus on the Fluid pieces, assuming that's what you want. Second, I wouldn't recommend SharedMatrix for this. SharedMatrix is designed for tabular data that can grow in any direction (i.e. add more rows/columns to the data) and may be sparse (i.e. the matrix is 1000 columns wide but only the first and last columns have data), and in this case, you have a grid of a fixed size. Instead, I would recommend using a SharedMap. You can assign IDs to each of the nine game board cells, and store an "X", "O", or "" in each SharedMap key. When a player changes a value on the board, update the value stored in the map. |
Beta Was this translation helpful? Give feedback.
-
I want to develop a ticktacktoe game on top of fluid framework, can I use the SharedMatrix to create a ticktacktoe game in fluid framework. can we manage state history in fluid dds?
Beta Was this translation helpful? Give feedback.
All reactions