Cyril Kato's blog

PCN and PGN: Complementary Approaches to Game Notation

For decades, PGN (Portable Game Notation) has served the chess community well. It emerged in the early 1990s as a plain-text standard for recording games, and it remains the foundation for countless engines, databases, and training materials. I have used it extensively, and I appreciate what it achieves within its domain.

Yet as I explored other traditions—shogi, xiangqi, makruk—I kept running into the same friction. PGN was designed specifically for Western chess. Its assumptions about board geometry, piece behavior, and game state are deeply embedded in the format. Adapting it to other games felt like forcing a square peg into a round hole.

This led me to develop PCN (Portable Chess Notation): a format-agnostic alternative that aims to record games across chess-family traditions without privileging any single rule set. This article explains the motivation behind PCN and how it complements rather than replaces PGN.


What PGN does well

PGN deserves its longevity. It offers broad interoperability across software, supports rich annotations, follows standardized metadata conventions, and benefits from the durability of plain text. From club archives to online repositories, from engine analysis to preparation workflows, PGN has proven its worth.

But PGN was designed for a specific game, and that specificity—its strength for chess—becomes a limitation elsewhere.


A classic example

Consider this miniature from Gioachino Greco's 1620 manuscript Trattato Del Nobilissimo Gioco De Scacchi. Like many of Greco's games, it is likely a didactic construction rather than an actual game record:

[Event "?"]
[Site "?"]
[Date "1620.??.??"]
[White "Greco"]
[Black "NN"]
[Result "1-0"]

1. e4 e5 2. Nf3 Qf6 3. Bc4 Qg6 4. O-O Qxe4
5. Bxf7+ Ke7 6. Re1 Qf4 7. Rxe5+ Kxf7
8. d4 Qf6 9. Ng5+ Kg6 10. Qd3+ Kh5 11. g4+ 1-0

Black resigns after 11. g4+ as checkmate is unavoidable. The example illustrates PGN's strengths: compact notation, embedded metadata, conventions aligned with chess tournament requirements.


Where PGN falls short

Shogi has developed its own notation ecosystems—KIF for traditional Japanese text, CSA for software, SFEN/USI for modern engines. PGN cannot naturally accommodate shogi's fundamental mechanics: pieces dropping from reserve, promoted piece states, a 9×9 board with different movement rules.

Xiangqi presents similar challenges. It operates on a 9×10 grid with distinct spatial constraints like the river and palace. PGN's assumptions about board geometry are rooted in the 8×8 Western chess board. Xiangqi communities rely on dedicated formats like XQF and various server-specific notations.

These are not failings of PGN—they reflect its design scope. But for someone interested in multiple traditions, the fragmentation is inconvenient.


The case for a broader approach

I wanted a single format that could serve several purposes: unified tools spanning chess-family traditions, preservation of regional and historical game systems, consolidated datasets for comparative research, and support for emerging variants without inventing new protocols each time.

This led to PCN.


How PCN works

PCN is a recording format designed to remain rule-agnostic and notation-agnostic across many chess-family traditions. The full specification is available on the Sashité website.

PCN supports two serialization options: TOML for human-readable configuration files, and JSON for web services and programmatic access. Both encode the same logical structure.

The format integrates with modular companion specifications. PMN (Portable Move Notation) encodes individual plies with explicit operator semantics—displacement (e2-e4), capture (d1+f3), and castling (e1~g1). FEEN (Field Expression Encoding Notation) handles position encoding, including reserves for drop-capable games. SNN (Style Name Notation) identifies the variant or movement tradition, enabling cross-variant encounters where opponents might play by different rules.


Greco's miniature in PCN

The same game expressed in PCN using TOML serialization:

[meta]
name = "Greco Miniature"
comment = "From Trattato Del Nobilissimo Gioco De Scacchi (1620)"
rule_system = "standard"

[sides.first]
name = "Greco"
variant = "Chess"

[sides.second]
name = "NN"
variant = "Chess"

[setup]
feen = "+rnbq+k^bn+r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/+RNBQ+K^BN+R / C/c"

[[plies]]
pmn = "e2-e4"

[[plies]]
pmn = "e7-e5"

[[plies]]
pmn = "g1-f3"

[[plies]]
pmn = "d8-f6"
assessment = "dubious"

[[plies]]
pmn = "f1-c4"

[[plies]]
pmn = "f6-g6"

[[plies]]
pmn = "e1~g1"

[[plies]]
pmn = "g6+e4"
assessment = "mistake"

[[plies]]
pmn = "c4+f7"
check = true
assessment = "brilliant"

[[plies]]
pmn = "e8-e7"

[[plies]]
pmn = "f1-e1"

[[plies]]
pmn = "e4-f4"

[[plies]]
pmn = "e1+e5"
check = true

[[plies]]
pmn = "e7+f7"

[[plies]]
pmn = "d2-d4"

[[plies]]
pmn = "f4-f6"

[[plies]]
pmn = "f3-g5"
check = true

[[plies]]
pmn = "f7-g6"

[[plies]]
pmn = "d1-d3"
check = true

[[plies]]
pmn = "g6-h5"

[[plies]]
pmn = "g2-g4"
check = true

[outcome]
result = "1-0"

Key differences from PGN

Several design choices distinguish PCN from PGN.

PCN offers a choice of serialization—TOML for configuration-friendly files, JSON for APIs. The ply encoding through PMN removes ambiguity about which piece moved and how, using explicit operators rather than relying on context. Metadata is organized in structured objects rather than tag pairs. Each player can declare their own variant via SNN, enabling hybrid games. Time control supports Fischer increment, fixed banks, and quota-based systems with per-ply timing through a flexible periods array. Assessments like "good", "mistake", "brilliant", "blunder", "interesting", and "dubious" map to PGN's NAG system but use readable strings. And custom properties can be added at any level without conflicting with the specification.


Getting started

Reference implementations are available for Ruby and Elixir. Both provide parsing, validation, and serialization of PCN documents in TOML and JSON formats.

The companion specifications are documented on the Sashité website: FEEN for position encoding, PMN for move notation, and SNN for variant identification.


Conclusion

PGN and PCN serve complementary purposes. PGN remains the definitive standard for Western chess, backed by decades of tooling, community adoption, and annotation conventions. I have no intention of displacing it.

PCN offers an alternative for projects that need format flexibility, multi-variant capability, or integration with modular specifications. Its rule-agnostic design accommodates shogi, xiangqi, makruk, and hybrid games within a single framework.

The choice depends on the project's scope. For pure chess work, PGN is the sensible default. For cross-tradition applications, PCN might be worth exploring.