Sashité for Developers

General Actor Notation (GAN) Specification

Version: 1.0.0 Author: Sashité Published: May 4, 2012 License: MIT License


Overview

General Actor Notation (GAN) defines a consistent and rule-agnostic format for identifying game actors in abstract strategy board games. GAN provides unambiguous identification of pieces by associating each actor with its originating game, eliminating collision problems when multiple games are present in the same context.


Properties


Constraints


Terminology


Format

An actor is represented by a game identifier, followed by a colon separator, followed by a piece identifier.

Actor Structure

<game-id>:<piece-id>

Where:

Casing Rules

The casing of the entire GAN string indicates player association:


Examples

Chess Pieces

Piece Type First Player Second Player
King CHESS:KING chess:king
Queen CHESS:QUEEN chess:queen
Rook CHESS:ROOK chess:rook
Bishop CHESS:BISHOP chess:bishop
Knight CHESS:KNIGHT chess:knight
Pawn CHESS:PAWN chess:pawn

Shōgi Pieces

Piece Type First Player Second Player
King SHOGI:KING shogi:king
Gold SHOGI:GOLD shogi:gold
Silver SHOGI:SILVER shogi:silver
Knight SHOGI:KNIGHT shogi:knight
Lance SHOGI:LANCE shogi:lance
Rook SHOGI:ROOK shogi:rook
Bishop SHOGI:BISHOP shogi:bishop
Pawn SHOGI:PAWN shogi:pawn

Collision Resolution

These examples demonstrate how GAN resolves naming conflicts between different games:

Description GAN Identifier
Chess Rook (first player) CHESS:ROOK
Shōgi Rook (first player) SHOGI:ROOK
Makruk Rook (first player) MAKRUK:ROOK
Xiangqi Rook (second player) xiangqi:rook

Formal Grammar (BNF)

<actor> ::= <uppercase-actor> | <lowercase-actor>

<uppercase-actor> ::= <game-id-uppercase> ":" <piece-id-uppercase>
<lowercase-actor> ::= <game-id-lowercase> ":" <piece-id-lowercase>

<game-id-uppercase> ::= <identifier-uppercase>
<game-id-lowercase> ::= <identifier-lowercase>

<piece-id-uppercase> ::= <identifier-uppercase>
<piece-id-lowercase> ::= <identifier-lowercase>

<identifier-uppercase> ::= <letter-uppercase> | <letter-uppercase> <identifier-uppercase>
<identifier-lowercase> ::= <letter-lowercase> | <letter-lowercase> <identifier-lowercase>

<letter-lowercase> ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j"
                    | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t"
                    | "u" | "v" | "w" | "x" | "y" | "z"

<letter-uppercase> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
                    | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T"
                    | "U" | "V" | "W" | "X" | "Y" | "Z"

Regular Expression

The following regular expression validates a GAN actor string:

^([A-Z]+:[A-Z]+|[a-z]+:[a-z]+)$

JSON Schema

Schema URL: https://sashite.dev/schemas/gan/1.0.0/schema.json

The JSON Schema provides structural validation for GAN format compliance, ensuring that actor identifiers conform to the specification requirements without dependencies on external execution environments.


Applications

GAN is particularly useful in the following scenarios:

  1. Multi-game environments: When positions or analyses involve pieces from multiple game variants.
  2. Game engine development: When implementing engines that need to distinguish between similar pieces from different games.
  3. Hybrid games: When creating or analyzing positions from games that combine elements from different variants.
  4. Database systems: When storing game data that must avoid naming conflicts between similar pieces from different games.
  5. Cross-game analysis: When comparing or analyzing strategic elements across different game systems.

Design Principles

Agnostic by Design

GAN deliberately avoids encoding any game-specific information beyond identification. States, conditions, and game rules are handled by separate systems, maintaining GAN’s role as a pure identification protocol.

Collision-Free Identification

By prefixing piece identifiers with game identifiers, GAN ensures that CHESS:ROOK and SHOGI:ROOK are unambiguously different actors, even though both represent similar pieces in their respective games.

Canonical Representation

For any given actor in a specific context (game and player), there is exactly one valid GAN representation. This ensures consistency across different implementations and use cases.


Relationship with Other Specifications

GAN is designed as a foundational identification system that can work alongside other game notation systems:

This separation of concerns allows each system to focus on its primary responsibility while maintaining interoperability.


GAN Implementations

This section lists available libraries and tools that implement the GAN specification.

Ruby