PCN and PGN: Complementary Approaches to Game Notation
When working with abstract strategy games across different traditions, I found myself needing a format that could record complete game sessions in a way that modern applications could easily parse and process. Portable Game Notation (PGN) has served the chess community remarkably well for decades, and it was natural to draw inspiration from its success while adapting to contemporary technical needs.
This led to the development of PCN (Portable Chess Notation): a JSON-based format for recording complete game sessions, designed to work across chess variants and other abstract strategy games.
This article explores the relationship between these two formats and their complementary roles in the game notation ecosystem.
PGN's Foundation
Portable Game Notation has been the standard format for recording chess games since its introduction. It serves as the primary format for:
- Online game transmission and sharing
- Chess database storage and archival
- Program-to-program game exchange
- Tournament record keeping
PGN's text-based format with tag pairs for metadata and algebraic notation for moves has proven robust and widely adopted. Its success demonstrates the value of a standardized game recording format.
PCN's Approach
PCN builds upon PGN's successful foundation while adapting to different technical requirements:
Format Advantages
- JSON structure: Machine-readable format with widespread parser support across programming languages
- Specification ecosystem: Native integration with PMN (moves), FEEN (positions), and SNN (styles)
- Type safety: Clear field types and validation rules
- Unicode compatibility: Native support for international characters in metadata
Scope Advantages
- Cross-variant support: Not limited to Western chess — supports shōgi, xiangqi, makruk, and custom variants
- Cross-style games: Enables hybrid scenarios where players use different game systems
- Rule-agnostic design: Separates game recording from rule interpretation
- Multi-dimensional boards: Supports 2D, 3D, and higher-dimensional game spaces
Understanding the Trade-offs
Both formats make deliberate design choices that serve their primary use cases:
PCN Prioritizes
- Mechanical precision: Explicit source-destination coordinates eliminate notation ambiguity
- Linear representation: Single game path simplifies parsing and state reconstruction
- Universal applicability: Supports any abstract strategy game, not just chess variants
PGN Prioritizes
- Human readability: Algebraic notation is compact and familiar to chess players
- Rich annotation: Comments, variations, and evaluation symbols support deep analysis
- Chess optimization: Format tailored specifically for chess and its variants
Conversion Considerations
PGN → PCN
Converting from PGN to PCN requires position analysis to transform algebraic notation (such as "Nf3" or "O-O") into PMN's explicit source-destination format. Tag pairs map naturally to PCN's meta
and sides
fields.
However, several PGN features cannot be preserved:
- Move comments and annotations: PGN allows textual comments after moves; PCN records only the move sequence
- Variations: PGN supports move trees with alternative lines; PCN represents a single linear game path
- NAGs: Numeric Annotation Glyphs (!, ?, !!, etc.) are not supported in PCN
- Evaluation symbols: Position assessment markers do not transfer to PCN
PCN → PGN
Converting from PCN to PGN is possible for Western chess games using standard rules. PMN coordinates can be transformed into algebraic notation through position analysis.
However, PCN's broader scope means many features cannot be represented in standard PGN:
- Cross-style games (e.g., Chess vs. Shōgi)
- Multi-dimensional boards (3D chess variants)
- Non-chess variants (Xiangqi, Makruk, etc.)
- Games with piece-in-hand mechanics
When to Use Each Format
The choice between PGN and PCN depends on your specific needs:
PGN is Well-Suited For
- Traditional chess game recording and analysis
- Applications where human readability is paramount
- Games requiring extensive annotation and commentary
- Analysis with multiple variations and evaluations
- Integration with existing chess databases and tools
PCN is Well-Suited For
- Cross-platform applications requiring JSON parsing
- Abstract strategy game platforms beyond chess
- Systems leveraging the Sashité specification ecosystem
- Games requiring formal style identification
- Cross-variant and hybrid game scenarios
- Applications needing unambiguous mechanical move representation
Complementary Rather Than Competitive
PCN aims to complement rather than replace PGN. Each format serves its domain well:
PGN remains the established standard for chess, with decades of tooling, databases, and community support. Its human-readable format and rich annotation capabilities make it ideal for chess analysis and study.
PCN offers a modern alternative for applications that need JSON compatibility, cross-variant support, or integration with the Sashité specification ecosystem. Its rule-agnostic design enables universal applicability across different game systems.
For projects working exclusively with Western chess and requiring extensive annotations, PGN is likely the better choice. For projects working with multiple game variants or needing modern data formats, PCN may offer advantages.
A Modest Contribution
PCN represents one approach to modern game notation, inspired by PGN's success while addressing different technical requirements. It will not fit every use case, nor was it intended to.
If you are working with abstract strategy games across different traditions, or building applications that benefit from JSON-based data formats, PCN might offer a useful tool.
The complete specification is available here, and a Ruby implementation can be found here.
I welcome any feedback or suggestions for improvements.