Extended Piece Identifier Notation (EPIN) Specification
- Version: 1.0.0
- Author: Sashité
- Published: June 23, 2025
- License: MIT License
Overview
Extended Piece Identifier Notation (EPIN) extends Piece Identifier Notation (PIN) to provide style-aware piece representation in abstract strategy board games. EPIN adds a derivation marker that distinguishes pieces by their style origin, enabling cross-style game scenarios and piece origin tracking.
EPIN represents all four fundamental piece attributes:
- Type + Side → ASCII letter with case encoding (from PIN)
- State → Optional prefix modifier (from PIN)
- Style → Optional derivation suffix
EPIN maintains full backward compatibility with PIN while adding style differentiation capabilities.
Terminology
For complete definitions of terms used in this document, see the Glossary.
Format Specification
Structure
<pin>[<suffix>]
Grammar (BNF)
<epin> ::= <pin>
| <pin> <derivation>
<derivation> ::= "'"
<pin> ::= <letter>
| <state-modifier> <letter>
<state-modifier> ::= "+" | "-"
<letter> ::= <uppercase-letter> | <lowercase-letter>
<uppercase-letter> ::= "A" | "B" | "C" | ... | "Z"
<lowercase-letter> ::= "a" | "b" | "c" | ... | "z"
Regular Expression
\A[-+]?[A-Za-z]'?\z
Piece Attribute Mapping
EPIN extends PIN’s attribute encoding with style information:
Piece Attribute | EPIN Encoding | Examples |
---|---|---|
Type | ASCII letter choice | K /k = King, P /p = Pawn |
Side | Letter case | K = First player, k = Second player |
State | Optional prefix | +K = Enhanced, -K = Diminished, K = Normal |
Style | Derivation marker | K = Native style, K' = Foreign style |
Style Derivation Logic
- No suffix: Piece has the native style of its current side
- Apostrophe suffix (
'
): Piece has the foreign style (opposite side’s native style)
When both sides use the same native style, derivation markers become optional. For instance, if both first and second players have Shōgi as their native style, P
and P'
pieces are functionally equivalent.
Example: In a Chess vs. Makruk match:
P
: White pawn with Chess style (first player’s native style)P'
: White pawn with Makruk style (second player’s native style)p
: Black pawn with Makruk style (second player’s native style)p'
: Black pawn with Chess style (first player’s native style)
Conversion to QPI
EPIN pieces can be converted to QPI format using the match’s side-style associations:
Conversion Rules
EPIN Format | Style Selection |
---|---|
Native (no suffix) | Current side’s native style |
Derived (' suffix) |
Opposite side’s native style |
Example: Chess vs. Shōgi Match
Side-style associations:
- First player: Chess
- Second player: Shōgi
Conversions:
P
→CHESS:P
(first player’s native style)P'
→SHOGI:P
(second player’s native style)p
→shogi:p
(second player’s native style)p'
→chess:p
(first player’s native style)
The QPI case always matches the EPIN case, ensuring side consistency.
System Constraints
Native Style Requirement
EPIN requires each side to have a defined native style:
- First player: Must have an assigned native style
- Second player: Must have an assigned native style
The native style assignment is rule-dependent and remains fixed throughout the match. During gameplay, pieces may change style through mutations, with the derivation marker indicating whether the current style matches the piece’s side native style.
Examples
See EPIN Examples for practical implementation guidance.
Reference Implementations
Ruby
- EPIN.rb – Reference implementation with PIN compatibility and style derivation logic.