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
- GAN is rule-agnostic and does not encode game states, legality, validity, or game-specific conditions.
- GAN provides unambiguous identification, ensuring that actors from different games can coexist without naming conflicts.
- GAN uses a canonical representation where equivalent actors yield identical strings.
- GAN supports cross-game contexts where pieces from multiple games may be present simultaneously.
Constraints
- GAN supports exactly two players.
- Players are distinguished by casing: uppercase identifiers represent actors belonging to the first player; lowercase identifiers represent actors belonging to the second player.
- Both game and piece identifiers must use alphabetic characters only (
A-Z
for uppercase,a-z
for lowercase). - An actor identifier must be entirely uppercase or entirely lowercase - mixed casing is not permitted.
Terminology
- An actor is a game piece with a unique identifier in GAN format.
- A game identifier specifies which game the actor originates from.
- A piece identifier specifies the type of piece within that game.
- Player association is determined by the casing of the entire GAN string.
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:
<game-id>
is a sequence of alphabetic characters identifying the game variant.:
is a literal colon character serving as a separator.<piece-id>
is a sequence of alphabetic characters identifying the piece type.
Casing Rules
The casing of the entire GAN string indicates player association:
- Uppercase format (e.g.,
CHESS:QUEEN
) denotes actors belonging to the first player. - Lowercase format (e.g.,
chess:queen
) denotes actors belonging to the second player.
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:
- Multi-game environments: When positions or analyses involve pieces from multiple game variants.
- Game engine development: When implementing engines that need to distinguish between similar pieces from different games.
- Hybrid games: When creating or analyzing positions from games that combine elements from different variants.
- Database systems: When storing game data that must avoid naming conflicts between similar pieces from different games.
- 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:
- State representation: Game-specific systems can manage piece states, promotions, and conditions independently of GAN identification.
- Board notation: Position formats can reference GAN identifiers while maintaining their own structural conventions.
- Move notation: Move formats can use GAN identifiers to specify which pieces are involved in actions.
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
- Gan.rb - Implementation of the General Actor Notation specification for Ruby.