Skip to main content
BeeHex offers multiple game modes to suit your playing style, from competitive ranked matches to casual offline games. Choose between online matchmaking, private rooms, or local play.

Available Game Modes

Online Matchmaking

Search for opponents and compete in ranked or casual matches

Private Rooms

Create private games with friends using room codes

Offline Mode

Play locally without an internet connection

Game Review

Analyze completed games with AI-powered move evaluation

Online Matchmaking

Connect with players worldwide through BeeHex’s matchmaking system. The game automatically pairs you with opponents of similar skill level.

Ranked vs Casual

Ranked mode affects your MMR (Match Making Rating) and is tracked in your game history. Win games to climb the leaderboard!
Ranked games are always competitive with the following settings:
  • Board sizes: 5x5, 7x7, or 9x9
  • MMR-based matchmaking
  • Game results affect your rating
  • Full game history tracking
src/app/game_mode/page.tsx
websocketHandler.sendPacket({
  type: ServerBoundPacketType.GAME_SEARCH,
  game_parameters: {
    time_limit: parseInt(timeLimit),
    board_size: parseInt(boardSize),
    ranked: gameType === "Classé",
  }
} as ServerBoundGameSearchPacket);

Game Search Process

1

Select Game Parameters

Choose your preferred board size (5, 7, or 9) and time limit settings from the game mode page.
src/app/definitions.ts
export const BOARD_SIZES = [5, 7, 9];
export const TIME_LIMITS = [0];
2

Initiate Search

The client establishes a WebSocket connection and sends a game search packet to the server.
src/app/game_mode/WebsocketHandler.ts
this.socket = new WebSocket(`ws:/${getEnv()['IP_HOST']}:3002/`);
3

Matchmaking

The server searches for an opponent within your ELO range and returns match details:
src/app/definitions.ts
export interface ClientBoundGameSearchPacket {
  type: ClientBoundPacketType.GAME_SEARCH;
  game_parameters: GameParameters;
  player_count: number;
  elo_range: [number, number];
}
4

Game Found

Once matched, the server sends a game ID and you’re redirected to the game board:
src/app/game_mode/page.tsx
function gameFoundCallback(game_id: any) {
  window.location.href = `/hex/o_${game_id}`;
}
Your game search shows real-time updates including the number of players searching and the current ELO range being considered for matches.

Private Rooms

Create custom games with friends using private room codes. Perfect for practice sessions or playing with specific opponents.

Creating a Private Room

1

Select 'Partie privée'

On the game mode page, choose “Partie privée” instead of “Chercher une partie”.
2

Enter Room Code

Enter a shared room code (or create a new one) that both players will use:
src/app/game_mode/page.tsx
<InputText
  description="Code de la partie"
  placeholder="Code de la partie"
  autoComplete="off"
  value={gameCode}
  onChange={(e) => { setGameCode(e.target.value) }}
/>
3

Configure Settings

Select your board size and time limit. Both players must use the same room code but the game parameters are set by the room creator.
4

Join Room

The game sends a JOIN_ROOM packet with your room ID:
src/app/game_mode/page.tsx
websocketHandler.sendPacket({
  type: ServerBoundPacketType.JOIN_ROOM,
  room_id: gameCode,
  game_parameters: {
    time_limit: parseInt(timeLimit),
    board_size: parseInt(boardSize),
    ranked: false
  }
} as ServerBoundJoinRoomPacket);
Private room games are never ranked and don’t affect your MMR, regardless of the outcome.

Room Code Tips

  • Room codes are case-sensitive
  • Special characters on French keyboards are automatically converted to numbers
  • Share the exact code with your opponent to ensure successful connection
src/app/game_mode/page.tsx
const numbers = { "&": 1, "é": 2, '"': 3, "'": 4, "(": 5, "-": 6, "è": 7, "_": 8, "ç": 9, "à": 0 };

Offline Mode

Play Hex without an internet connection using BeeHex’s offline handler. Perfect for practicing, learning, or playing on-the-go.

Starting an Offline Game

Offline games use a special URL format:
src/app/game_mode/page.tsx
if (gameType === "Hors-Ligne") {
  window.location.href = `/hex/l_${timeLimit.toString()}_${boardSize.toString()}`
}
The game creates a local instance without any server connection:
src/app/hex/[gameId]/OfflineHandler.ts
export class OfflineHandler {
  private game: GameInstance
  private callbacks: WebsocketCallbacks;

  constructor(callbacks: WebsocketCallbacks, gameParameters: packets.LocalGameParameters) {
    this.callbacks = callbacks;
    this.game = new GameInstance(this, "offline", gameParameters, "1", "1");
  }
}

Offline Features

All standard Hex rules are enforced:
  • Win detection through path-finding algorithms
  • Turn-based gameplay
  • Move validation
  • Game state management
src/app/hex/[gameId]/OfflineHandler.ts
playMove(x: number, y: number) {
  if (this.grid[x][y] !== 0) return;
  this.grid[x][y] = this.turn % 2 === 0 ? 2 : 1;
  let { winner, winningHexagons } = this.checkForWinnerXY(x, y);
  if (winner) {
    this.endGame(this.turn % 2 === 0 ? packets.GameStatus.SECOND_PLAYER_WIN : packets.GameStatus.FIRST_PLAYER_WIN, winningHexagons);
  }
  this.turn++;
}
The offline handler maintains complete game state locally:
  • Grid array tracking
  • Move history
  • Turn counter
  • Win condition checking
All game data is stored in memory and persists only during the session.
Games can be exported as move sequences for later analysis:
src/app/hex/[gameId]/OfflineHandler.ts
exportMoves(): string {
  let movesString = '';
  for (let move of this.moves) {
    movesString += this.hashXY(move[0], move[1]) + ' ';
  }
  return movesString.trim();
}
This allows you to review offline games using the analysis features.
Offline games are not saved to the server. If you close the browser or navigate away, your game progress will be lost.

Board Size Options

BeeHex supports three standard Hex board sizes:

5x5

Quick gamesPerfect for beginners~10-15 moves

7x7

Balanced gameplayStandard practice~20-30 moves

9x9

Strategic depthTournament size~35-50 moves
src/app/definitions.ts
export const BOARD_SIZES = [5, 7, 9];

export interface GameParameters {
  ranked: boolean;
  board_size: number;
  time_limit: number;
}

Game Status Tracking

BeeHex tracks comprehensive game status throughout the match lifecycle:
src/app/definitions.ts
export enum GameStatus {
  IN_PROGRESS = 0,
  FIRST_PLAYER_WIN = 1,
  SECOND_PLAYER_WIN = 2,
  DRAW = 3, // Not implemented - draws are impossible in Hex
  ABORTED = 4 // Used if a player quits before first move
}
Mathematical impossibility: Hex games cannot end in a draw. One player must always form a connecting path.

Recent Games History

View your last 5 games with detailed statistics on the game mode page:
  • Current MMR display
  • Win/loss indication
  • MMR changes per game
  • Opponent information
  • Game date and time
src/app/game_mode/page.tsx
const victory = (isFirstPlayer && game.EloChangeFirstPlayer > 0) || 
                (!isFirstPlayer && game.EloChangeSecondPlayer > 0);
const mmrChange = isFirstPlayer ? game.EloChangeFirstPlayer : game.EloChangeSecondPlayer;

Next Steps

Multiplayer Features

Learn about real-time gameplay and WebSocket communication

AI Analysis

Discover how the AI engine evaluates positions and suggests moves