This Unity project is a local multiplayer blackjack simulation where players can compete around a virtual table. It also offers the option to play against AI or simply watch AI compete against each other. Unlike machine learning or deep learning systems, these AI are based on predefined behaviors, inspired by existing strategies documented online. This allows for quick and efficient analysis of game data, making it ideal for studying the performance of different approaches. While this project is not a final application with builds or interfaces for modifying variables, it remains a practical tool for exploring blackjack strategies, whether by playing against AI or observing their interactions.
Roles
Solo
Year
2024 (1 week)
Tools/Technology
Unity

Blackjack Project: Players and AI

Player vs. Player Mode In this mode, players compete locally around a virtual table. Each player starts with an initial amount of money and can place bets each round. The available actions are classic: Stand, Split, Hit, or Double. If the player wins, they recover 1.5x their bet, while a loss results in losing the bet amount. AI and Their Strategies The AI are based on the basic blackjack strategy (also known as Basic Strategy), which relies on mathematical probabilities to determine the best move based on the player's hand and the dealer's visible card. However, the AI differ in their betting strategies, allowing for exploration of different gameplay approaches. • Basic Strategy: The AI strictly follows the optimal probability table for each decision (Hit, Stand, etc.). • DoubleUp Loss: The AI doubles its bet after each loss, hoping to quickly recover losses. • DoubleUp Win: The AI doubles its bet after each win, capitalizing on a winning streak. • Paroli: The AI doubles its bet after each win, but this strategy is limited to a certain number of consecutive wins before returning to the initial bet. • Fibonacci: The AI adjusts its bets using the Fibonacci sequence. Each bet is the sum of the two previous bets in case of a loss, but it reverts two steps back after a win. Card Counting TechniquesHi Lo: A simple method where low cards (2-6) are worth +1, high cards (10, Jack, Queen, King, Ace) are worth -1, and neutral cards (7-9) are worth 0. The AI adjusts its bets based on the count. • True Count: A more precise version of Hi Lo, where the count is adjusted based on the number of decks remaining in the shoe. Configurable Variables The AI can be configured with variables such as StopLoss (stop after a defined loss), StopWin (stop after a maximum gain), Soft Count Adjustment (adjustment for "soft" hands), and Max Bet Limit (maximum bet limit). Performance Tracking To analyze results, I implemented graphs and text displays showing key metrics, such as wins, losses, betting trends, and the performance of different strategies. This allows for comparing approaches and studying the effectiveness of the AI under various conditions.