# Osmium Chess Engine **Osmium** is a chess engine written in C# targeting .NET 8.0. It uses a bitboard-based architecture and incorporates advanced move generation, search algorithms, and evaluation techniques to achieve efficient and accurate play. ## Features ### Position Representation - Bitboard-based position representation - Move generation: - Pawns, knights, and kings use precomputed move tables - Bishops, rooks, and queens use magic bitboards - Move and position legality determined via: - Bitboard operations - Magic bitboards ### Search Algorithms - Negamax search with: - Principal Variation Search (PVS) - Late Move Pruning (LMP) - Late Move Reductions (LMR) - Futility pruning - Null move pruning - Null window search - Aspiration windows - Quiescence search with delta pruning - Transposition table for position caching ### Move Ordering - Fully sorted move list using: - MVV-LVA (Most Valuable Victim - Least Valuable Attacker) - History heuristic - Killer moves - Counter moves ### Evaluation - Material evaluation with delta updates - 3-Phased Piece-square tables (PST) - King safety evaluation - Pawn structure analysis - Mobility evaluation ### Additional Capabilities - FEN parsing and position initialization - Algebraic Move Notation with Ambiguity Differentiation - UCI protocol support (partial, not supporting full UCI commands yet) ## Usage ### The Engine is a console app, inputs taken through text, and out through console output, which only supports limited uci commands - to run, download the .exe, and run it, a console window should pop up, and you can start typing commands into the chess engine - or, download a GUI like CuteChess if you wish, and connect it to that and play against it, or have it play against other chess engines - Note: the engine will not have a chessboard set up when you first load, so be sure to run ucinewgame upon start or write position startpos to initialize the engine - Note 2: Most of the commands will have 0 output, it'll do things in the background (such as ucinewgame) - [A more detailed description of the UCI protocol and how the engine expects input](https://gist.github.com/DOBRO/2592c6dad754ba67e6dcaec8c90165bf) ### Not all of the commands are supported (yet), below is a list that is supported - uci - uci info about author (me) and engine specifications, as well as any tuning options, however, values does not need to be adjusted to use the engine - isready - sets up the engine - ucinewgame - prepares the engine for a new game, with a fresh board - quit - exits engine - go movetime - start thinking with total time alotted (use >200 because the engine accounts for 200ms ping in searchtime, so any searchtime less than 0.2s (200ms) will result in invalid results) - go wtime btime winc binc - can be only wtime and btime, increment is optional - stop - early stop for search - setoption