Neural Networks
Checkers Strategy
Game AI
Machine Learning
Optimal Input

Ideal Input In Neural Network For The Game Checkers

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

The ideal neural-network input for checkers is a representation of the board state that preserves piece type, ownership, and turn information without making the model relearn obvious game structure from scratch. In practice, the strongest baseline is usually a compact board encoding built around the playable dark squares, with separate channels for men, kings, and side to move.

Core Sections

Start from the real geometry of the game

Standard checkers is played only on the dark squares of the 8 by 8 board. That means there are 32 playable positions, not 64 meaningful locations. A good input encoding should reflect that instead of wasting half the input on unused white squares.

The most common choices are:

  • a flat 32-square representation for dense networks
  • an 8 by 8 multi-channel tensor for convolutional networks

Both can work. The better one depends on the model architecture.

A practical 32-square encoding

For a simple feed-forward network, encode each playable square numerically or with one-hot channels. One clean scheme is four binary planes:

  • current player's men
  • opponent's men
  • current player's kings
  • opponent's kings

That gives a 32 x 4 binary representation.

python
1import numpy as np
2
3# Example with 32 playable squares and 4 channels
4state = np.zeros((32, 4), dtype=np.float32)
5
6# Square 0 contains the current player's man
7state[0, 0] = 1.0
8
9# Square 5 contains the opponent's king
10state[5, 3] = 1.0
11
12flat_input = state.reshape(-1)
13print(flat_input.shape)  # 128 values

This encoding is compact, easy to generate, and avoids conflating kings with normal pieces.

Add side-to-move explicitly

The same board can have a different value depending on whose turn it is. If you omit the side to move, the network has incomplete information. Add a dedicated scalar or channel for turn.

python
side_to_move = np.array([1.0], dtype=np.float32)  # 1.0 for current player, 0.0 otherwise
model_input = np.concatenate([flat_input, side_to_move])

Without that bit, the network may assign the same value to positions that are strategically very different.

When an 8 by 8 tensor is better

If you want to use convolutional layers, keeping the spatial structure of the board can help. In that case, use an 8 x 8 x C tensor and place zeros on unplayable light squares.

python
1board = np.zeros((8, 8, 4), dtype=np.float32)
2
3# Current player's man on row 5, column 0
4board[5, 0, 0] = 1.0
5
6# Opponent king on row 2, column 3
7board[2, 3, 3] = 1.0

This is a little less compact, but it preserves neighborhood relationships naturally for convolutional filters.

What extra features are worth adding

Useful optional features include:

  • move count or ply number
  • repetition or draw-rule counters if your rule set uses them
  • legal-move mask for policy networks

Features that are usually not worth hand-coding early are deep tactical heuristics such as "bridge patterns" or "piece mobility scores." Those can help in classical engines, but for a neural baseline it is often better to start with clean board state plus side to move and then add complexity only if experiments justify it.

Keep the representation player-relative

A strong simplification is to encode the board from the perspective of the player to move. That means channel zero always means "my men" and channel one always means "opponent men," regardless of color. This reduces symmetry the model has to learn.

For self-play systems, player-relative encodings are often easier to train than fixed-color encodings because the same strategic pattern appears in a consistent orientation.

Common Pitfalls

  • Encoding all 64 squares for a dense model and wasting half the input on unused positions.
  • Failing to distinguish kings from normal pieces and losing critical game-state information.
  • Omitting the side-to-move feature and forcing the network to evaluate incomplete states.
  • Mixing player colors directly into the encoding instead of using a player-relative representation.
  • Hand-crafting too many heuristic features before establishing a solid board-state baseline.

Summary

  • A good checkers input representation should encode only meaningful board information and piece types clearly.
  • For dense networks, a 32 playable-square encoding with separate channels is a strong baseline.
  • For convolutional models, an 8 x 8 x C tensor preserves spatial structure well.
  • Always include whose turn it is.
  • Start with clean board state plus turn information before adding advanced handcrafted features.

Course illustration
Course illustration