Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 102 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ Other, proposed notations include:
- [Matrix Notation](https://drive.google.com/drive/folders/10332r6crq_pD-d4pG4VSynM8ziu1uT98)
- [Hexicube's adaptation of Axel' AN](https://github.com/Hexicube/5D-Chess-Game-Viewer)
- [nidlatam's notation](https://github.com/nidlatam/my-5d-chess-notation)
- [Internal notation of 5d-chess-js](https://gitlab.com/alexbay218/5d-chess-js)
- [AverageHuman's Simplified 5D Algebraic notation](https://pastebin.com/raw/EwVSTFbj)
- [AquaBaby's analysis of several notations and proposal for a modern notation](https://docs.google.com/document/d/1-SnsdYIzrGao0ToyGXSaoEd_0tYKxYePO1C-Bp5ziXA/view)
- [Alexbay's notation as part of their library](https://gitlab.com/alexbay218/5d-chess-js/)
- [Alexbay's notation as part of their library **\[DEPRECIATED\]**](https://gitlab.com/alexbay218/5d-chess-js/)
- [AquaBaby's client, written in Java and using a custom notation for both moves and FEN](https://github.com/Slavrick/5dChessGUI/)

This algebraic notation is meant to be an extension of [PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation) for 5D chess.
Expand Down Expand Up @@ -51,9 +50,12 @@ This repository includes a converter and previewer. For information on how to ru
- [5DFEN and custom variants](#5dfen-and-custom-variants)
- [Additional Metadata](#additional-metadata)
- [Examples](#examples-1)
- [Export or minimal notation](#export-or-minimal-notation)
- [Export moves](#export-moves)
- [Export turns](#export-turns)
- [Raw notation mode](#raw-notation-mode)
- [Raw notation moves](#raw-notation-moves)
- [Raw notation turns](#raw-notation-turns)
- [Hashing](#hashing)
- [5DFEN Strictness](#5dfen-strictness)
- [Examples](#examples-2)
- [Notes](#notes)
- [Even-numbered starting boards](#even-numbered-starting-boards)
- [Branching](#branching)
Expand Down Expand Up @@ -133,14 +135,18 @@ On starting positions with more than one king for either player or kings in othe
Jumps use the following syntax:

- The super-physical coordinate of the origin board
- The piece's letter
- The piece's letter*
- The piece's physical coordinate
- `>>` if the jump is branching, `>` if the jump isn't branching
- `x` if a piece is being taken
- `>>` if the jump is branching, `>` if the jump isn't branching**
- `x` if a piece is being taken*
- The super-physical coordinate of the target board
- The physical coordinate of the target square
- `+`, `*` or `#` if the moves checks, softmates or checkmates the adversary
- `~` if the jump is branching and the present is being moved to the new branch
- *[Optional]* `+`, `*` or `#` if the moves checks, softmates or checkmates the adversary*
- `~` if the jump is branching and the present is being moved to the new branch*

**Parsers aiming for raw notation mode compatibility should not rely on this token for information*

***Parsers aiming for raw notation mode compatibility should expect only the character `>` when in raw notation mode*

All put together, it looks like this: `(-1T4)Nc3>>x(0T2)c3+~` ("The knight from board -1L, T4, c3 jumps and takes on L, T2, c3, creating a new timeline (-2L) and moving the present").

Expand Down Expand Up @@ -173,22 +179,31 @@ Both present movement and created timeline tokens are purely for better human co

## Turns

During their turn, each player may make several moves. Each move is written next to each other, separated by one or more spaces.
During their turn, each player may make several moves. Each move is written next to each other, separated by one or more spaces and/or newlines (`\r\n` or `\n`).
Sub-turns are separated by a forward slash (`/`).

A turn's syntax is the following:

- `<x>.`, with `<x>` being the turn number (remember that this is different from the time coordinate of a board)
- `<x>.`, with `<x>` being the turn number (remember that this is different from the time coordinate of a board)*
- White's moves
- `/`
- Black's moves

**Parsers aiming for raw notation mode compatibility should expect only a `.` character instead*

Such a turn looks like this:

```
1. (0T1)d4 / (0T1)d6
```

With newlines:

```
1. (0T1)d4
/ (0T1)d6
```

## Tags

This format's specific tags are the following:
Expand Down Expand Up @@ -390,36 +405,93 @@ This is how `Rook Tactics I` would be encoded:
2. Re1 / Kd3
```

## Export or minimal notation
## Raw notation mode

Depending on the usecase, the notation does not need to be human readable and instead only needs to convey the raw move information.
The following is a raw or "minimalized" version of this notation, which can later be parsed again into the full notation. This notation format should be close to being a subset of the regular notation, making converting existing parsers to support raw notation mode trivial.

Depending on the usecase, the exported, formatted data may not need to or cannot contain all of the information that this notation tries to convey.
The following is a raw or "minimalized" version of this notation, which can later be parsed again into the full notation.
*This standard is still just a proposal and not official yet!*

*This raw notation is still a proposal!*
### Raw notation moves

### Export moves
A raw notation move is made up of:

- The super-physical coordinates of the starting board in the format: `(<l>T<t>)`
- The physical coordinates of the moving piece
- The `>` character
- The super-physical coordinates of the target board
- The physical coordinates of the target square
- The promotion piece character, if needed

Castling is encoded as the king moving two pieces: `(0T6)e1>(0T6)g1`. The rook's movement is not annotated.

### Raw notation turns

A raw notation turn has a similar format as regular turns:

- The `.` character if white, `/` if black
- All raw notation moves separated by a single space
- Newline (`\n` only) character

```
. (0T1)d2>(0T1)d4
/ (0T1)d7>(0T1)d6
```

An export move is made up of:
## Hashing

- the super-physical coordinates of the starting board `(<l>T<t>)`
- *the piece's letter (optional)*
- the physical coordinates of the moving piece
- the super-physical coordinates of the target board
- the physical coordinates of the target square
For certain applications, getting a hash or checksum of either the full state (all boards) or a single board is desired. To facilitate standardization, hashing both the full state and a single board should be create by the following processes.

Castling is encoded as the king moving two pieces: `(0T6)Ke1(0T6)g1`. The rook's movement is not annotated.
*This standard is still just a proposal and not official yet!*

### Export turns
For single board hashing:

An export turn is made up of an introductory token, which indicates which player is playing, and a set of space-separated raw moves.
1. Create the 5DFEN string of the single board, stripping any and all whitespaces (including newlines)
2. Feed the resulting string (encoded as UTF-8) into the MD5 message-digest algorithm
3. Extract the resulting hash as hexadecimal digits
4. Convert to UTF-8 string (alphabet characters should be lowercase)

The introductory token is for white `w.` and for black `b.`
For full state hashing:

Such a raw turn would thus look like:
1. Grab the 5DFEN string of all boards.
2. Concatenate all of these 5DFEN strings together (sorting boards by timeline (ascending) first and then by turn (ascending)), stripping any and all whitespaces (including newlines)
3. Feed the resulting string (encoded as UTF-8) into the MD5 message-digest algorithm
4. Extract the resulting hash as hexadecimal digits
5. Convert to UTF-8 string (alphabet characters should be lowercase)

### 5DFEN Strictness

For purposes of sorting, timeline -0 is considered lower than timeline +0.

For strictness, extracting 5DFEN strings should standardize on move sensitivity. The following pieces should be marked as unmoved if needed (the rest of the pieces should not include the unmoved marking):

- Pawn
- Rook
- King
- Brawn

### Examples

For the 'Standard' variant, both the single board and full state have the same hash:

```
w. (0T1)d2(0T1)d4
b. (0T1)d7(0T1)d6
md5('[r*nbqk*bnr*/p*p*p*p*p*p*p*p*/8/8/8/8/P*P*P*P*P*P*P*P*/R*NBQK*BNR*:0:1:w]')

|
V

'd574889fd9da3f2bc65249ff27249b00'
```

For the 'Standard - Two Timeline' variant, the full state hash looks like this:

```
md5('[r*nbqk*bnr*/p*p*p*p*p*p*p*p*/8/8/8/8/P*P*P*P*P*P*P*P*/R*NBQK*BNR*:-0:1:w][r*nbqk*bnr*/p*p*p*p*p*p*p*p*/8/8/8/8/P*P*P*P*P*P*P*P*/R*NBQK*BNR*:+0:1:w]')

|
V

'3672761404ffcd15ae644c75401812be'
```

## Notes
Expand Down