Sharing game rules
Let your client reason about game rules without maintaining two copies of your logic.
Read time 1 minuteLast updated 15 days ago
CloudBehaviours keeps your authoritative game rules on the server, but your client often needs to know just enough to give good feedback, such as graying out a move a player can't legally make. Choose one of the following approaches, depending on how complex your rules are.
Topic | Description |
|---|---|
| Sync-metadata approach | The server works out the answer to a rule and syncs it down as plain data, and the client reacts to it without re-implementing the rule. This approach fits simple, discrete conditions. |
| Shared rules library | The client and cloud assemblies reference a common library, and the build bundles it automatically on deploy. This approach fits rules too complex for the sync-metadata approach. |