Package com.fortemate.dicechess.bot


package com.fortemate.dicechess.bot
Dice Chess Java Bot Starter Template & Reference Implementation.

This package provides an end-to-end reference implementation for writing Dice Chess bots in Java 25+. It demonstrates how to interface with the dicechess-bot-runtime Webhook server, parse game positions and generate legal turns using the dicechess-engine JvmApi facade, and evaluate positions using an ONNX neural network model or built-in engine heuristics.

Architecture Overview

  • Main: Application entry point. Configures port, loads secrets from env, instantiates evaluator and strategy, and launches the HTTP webhook server.
  • Strategy: Core functional interface for decision-making logic. Maps a TurnContext to a list of long algebraic move notations.
  • OnnxStrategy: Primary strategy implementation. Parses DFEN via JvmApi, expands full multi-move turns via JvmApi.legalTurns(GameState), and scores candidate positions using OnnxEvaluator.
  • OnnxEvaluator: Manages ONNX Runtime sessions (OrtSession) to evaluate board positions via neural network models (e.g. baseline.onnx). Falls back gracefully to JvmApi.evaluate(GameState, int) engine heuristic evaluation if no model file is provided.

Environment Variables

Environment Configuration
VariableDefaultDescription
DICECHESS_WEBHOOK_SECRETEmptyHMAC secret key for verifying incoming webhook requests.
MODEL_PATHmodels/baseline.onnxPath to the ONNX model file on disk.
PORT8080HTTP server binding port for incoming webhook deliveries.
See Also:
  • CustomHandlerServer
  • WebhookHandler
  • Class
    Description
    Entry point for the Dice Chess Java bot starter template.
    Evaluates board positions using an ONNX value model or falls back to engine heuristics.
    Strategy implementation using an ONNX value model (or fallback engine evaluation) over every legal full turn available from the current position, via the engine's JvmApi facade.
    Common functional interface for Java bot strategies mapping a TurnContext to move notations.