Sashité for Developers
  1. Sashité for Developers
  2. Game Protocol

Game Protocol

The Game Protocol defines the minimal, rule-agnostic mechanics required to implement abstract strategy board games in the Sashité ecosystem.

It specifies:

All capitalized terms (Game, Rule System, Match, Position, Piece, Move, etc.) are defined in the Glossary. This document does not redefine those terms; it adds constraints on how they interact.


1. Scope and responsibilities

1.1 What the protocol defines

The Game Protocol defines:

In particular, it determines which state transitions are structurally valid (Protocol-Valid Moves).

1.2 What the protocol does not define

The Game Protocol does not define:

Those aspects belong to Rule Systems, which use the protocol as a foundation.


2. Core data model

All terms in this section are defined in the Glossary. This section only adds protocol-level constraints and expectations for implementations.

2.1 Players, Sides, and Match roles

Constraint: The mapping between Players and Player Sides is fixed for the duration of the Match. The mapping between Piece Side and control (which player may move a given Piece) is defined by the Rule System, not by the protocol.

2.2 Locations

The protocol recognizes exactly three kinds of Location:

  1. Board Squares – individual cells on the shared Board.
  2. First Player Hand – the Hand associated with Player Side first.
  3. Second Player Hand – the Hand associated with Player Side second.

Protocol constraints:

Implementations MUST represent Locations in a way that uniquely identifies:

2.3 Pieces

A Piece has at least the following attributes:

Together, these form the Piece Identity.

Protocol constraints:

2.4 Position

A Position is the protocol-level snapshot of the game state, consisting of:

  1. the Location of every Piece,
  2. the attributes of each Piece (Piece Side, Piece Name, Piece State, Piece Style),
  3. the current turn, i.e. which Player is to move next (the Active Player).

Protocol constraints:

Note: The protocol does not impose any constraint on the number of times a given Position may appear in a Match. Repetition policies, if any, are defined by Rule Systems at the level of Game State, not by the Game Protocol.


3. Actions and Moves

3.1 Action

An Action is the smallest atomic transformation of a Position.

An Action MAY:

Implementations SHOULD represent an Action with:

Protocol constraints:

3.2 Allowed Displacements

The only displacement patterns authorized by the protocol are:

  1. Board → Board A Piece moves from one Square to another Square.

  2. Board → Hand A Piece moves from a Square to the Hand of a Player. (In many Games this corresponds to capture.)

  3. Hand → Board A Piece moves from a Hand to a Square on the Board. (In many Games this corresponds to a drop or placement.)

Any other displacement pattern (for example Hand → Hand) is not allowed at protocol level. Game mechanics that conceptually transfer a Piece between Hands MUST be expressible as a sequence of protocol-allowed Actions (e.g. via an intermediate Board location), or handled at Rule System level without violating protocol invariants.

3.3 Mutation

A Mutation is the part of an Action that changes one or more attributes of a Piece:

A Mutation:

Examples (Game-dependent):

3.4 Move

A Move is an ordered, finite sequence of zero or more Actions, performed by the Active Player during a single turn.

Applying a Move:

  1. takes a source Position,
  2. applies each Action in order, respecting all protocol invariants,
  3. yields a target Position, and
  4. toggles the Active Player (i.e. changes the current turn to the other Player).

Protocol constraints:

3.5 Pass Move

A Pass Move is a Move with zero Actions.

When a Pass Move is applied:

Whether Pass Moves are permitted, and under which conditions, is entirely defined by the Rule System. If a Rule System does not allow passing, then a Pass Move is always an Illegal Move in that Game.


4. Protocol invariants

Implementations MUST maintain the following invariants for every Position and for every applied Move.

4.1 Piece conservation

4.2 Location exclusivity

In particular:

4.3 Square occupancy

Intermediate states during Move application MAY use internal representations, but the final Position MUST respect this constraint.

4.4 Allowed displacements only

Every Displacement in every Action MUST be one of:

Any Move that attempts a Displacement outside this set is not Protocol-Valid.

4.5 Turn alternation

After every Move (including a Pass Move, if allowed):

There is no exception to turn alternation at protocol level. Rule Systems that model multiple consecutive choices by one Player MUST express them as sequences of Moves (possibly grouped at a higher semantic layer), not as single Moves that violate alternation.


5. Protocol-Valid Move

A Protocol-Valid Move is any Move that:

  1. uses only allowed Displacements (see §3.2),
  2. respects Piece conservation (see §4.1),
  3. respects Location exclusivity (see §4.2),
  4. respects Square occupancy (see §4.3),
  5. correctly alternates the Active Player (see §4.5).

Properties:

Rule Systems MAY further restrict protocol-valid Moves to obtain:


6. Interaction with Rule Systems (informative)

This section is informative and does not impose additional constraints.

6.1 Layering

In a typical implementation:

6.2 Repetition and Game State

The Game Protocol:

Any repetition policy (e.g. “draw on threefold repetition”, “loss on perpetual threat”, etc.) MUST be implemented at the Rule System level, as part of Game State evaluation.

6.3 Terminal Pieces and outcomes

The protocol is agnostic to:

These aspects belong entirely to the Rule System. The protocol’s role is only to provide a consistent, invariant-preserving substrate on which these semantics can be defined.