Act as an Expert 3D Game Developer and UI/UX Designer. Your task is to develop a 3D Liar's Dice video game. The game's atmosphere, UI, and logic must be heavily inspired by the Red Dead Redemption franchise. (Note: While inspired by the RDR universe, the game rules and logic must exactly follow the Liar's Dice minigame from the original Red Dead Redemption 1).
I want you to provide the overall code architecture, the core game loop, and the specific scripts (e.g., GameController, Player, BotAI, UI_Manager, PhysicsManager) to build this in [INSERT YOUR GAME ENGINE HERE, e.g., Unity, Godot, Unreal, or WebGL/Three.js].
1. Game Settings & Player Count
Players: The game must support a minimum of 2 players and a maximum of 4 players (1 Human player vs 1 to 3 AI opponent bots).
Dice: Standard 6-sided dice. Each player starts with exactly 5 dice.
2. Game Rules & Logic (Strictly RDR1 Rules)
Objective: Be the last player remaining with at least one die.
The Roll: At the start of each round, all players roll their dice simultaneously and keep them hidden under a leather cup. Only the human player can see their own dice.
No Wilds: Face value 1s are simply 1s. There are NO "wild" dice in this version.
Bidding:
The starting player makes a bid guessing the total number of a specific die face on the table across ALL players' cups (e.g., "Four 3s").
Play moves clockwise. The next player MUST take one of three actions: Raise the Bid, Call "Liar" (Bluff), or Call "Spot On" (Exact).
Raising the Bid:
To make a new, legal bid, the player must either:
Bid a HIGHER quantity of ANY face value (e.g., raising from "Four 3s" to "Five 2s").
Bid the SAME quantity, but a HIGHER face value (e.g., raising from "Four 3s" to "Four 4s").
(Logic constraint: You cannot bid a lower quantity of dice, and you cannot bid the same quantity with a lower or equal face value).
Calling "Liar" (Bluff):
If a player believes the current bid is higher than the actual number of dice on the table, they call "Liar".
All cups are lifted, and the dice are counted.
If the total count of the bid face is LESS than the bid: The player who made the bid loses one die.
If the total count of the bid face is EQUAL TO OR GREATER than the bid: The player who called "Liar" loses one die.
Calling "Spot On" (Exact):
If a player believes the current bid is the EXACT number of dice on the table, they call "Spot On".
Assistant
I'll build this as a full 3D Liar's Dice game using React Three Fiber (R3F) + Three.js since we're in a Vite/React environment. Let me start by exploring the project structure.
Now let me install all the necessary 3D dependencies.
Excellent! Now let me build the complete game. I'll create the architecture systematically - types, game logic, AI, state management, 3D scene, and UI components.
Now let me create the Bot AI logic with probability calculations.
Now let me create the game state store with zustand - this is the central controller.
Now let me create all the UI and 3D components. I'll start with the main App and the 3D scene components.
Now create the 3D scene with the saloon table and dice.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
If the count is EXACTLY the bid amount: Every player at the table except the player who successfully called "Spot On" loses one die.
If the count is NOT exact: The player who called "Spot On" loses one die.
Round End & Elimination: The player who loses a die starts the bidding in the next round. If a player reaches 0 dice, they are eliminated.
3. UI/UX, Lighting, and Visual Clarity
Lighting & Visibility: While the game should have a gritty, immersive Wild West saloon vibe with warm lantern lighting, the visibility must be excellent. Use a good multi-light setup (rim lights and soft fill lights) so that the player characters, the table, and the dice are always clearly illuminated and easy to see. Do not let the scene get too dark.
Action Visibility & Pacing: Every call in the game must be crystal clear to the player. When an AI bot makes a move, implement a UI speech bubble or a large cinematic text prompt on the screen stating exactly what they did (e.g., "Arthur bids Five 4s" or "Dutch calls Liar!"). The pacing must allow the human player time to read and process these actions—do not let the AI turns fire off instantly.
Diegetic UI: Display the human player's active dice at the bottom of the screen. Show the "Current Bid" prominently. Show opponent dice counts using visual indicators (e.g., 5 small die icons next to their avatar that fade out when lost).
Bidding Menu: A clean selector for Dice Quantity and Face (1-6). The UI must strictly validate and disable illegal bids so the user can only select legal raises.
4. Physics & Performance Optimization
Strict Physics (No Leaking): The dice physics must be flawless. When the dice are shaken or dropped under the cup, they MUST remain strictly inside the cup. Ensure there is zero mesh leaking or clipping. Instruct me on how to set up Continuous Collision Detection (CCD), appropriate physics iteration counts, and thick colliders for the cup mesh to prevent physics tunneling.
Optimization: The game needs to be well-optimized to run smoothly. Implement best practices for the engine:
Put rigidbodies to "sleep" once the dice have settled.
Bake static lighting where possible, reserving dynamic shadows only for the moving cups and dice.
Write garbage-free, highly performant code for the core loop and UI updates.
5. Code Architecture & Bot AI
State Machine: Create a robust Game State Manager for RoundStart, PlayerTurn, OpponentTurn, RevealPhase, RoundEnd, and GameOver.
AI Logic: Bots should use probability math to calculate if a bid is likely true based on their own hand and the total dice left in the game. They should occasionally bluff, call "Liar" if the probability is very low, and raise logically.
Please acknowledge these instructions and output the foundational code structure, physics setup tips, and the first set of core scripts to get this game working.
Now let me create the 3D Dice and Cup components, and all UI components.
Now let me create the Cup 3D component and all UI components.
Now let me create all the UI components.
Now let me create the Player Hand component, Bidding Panel, and other UI pieces.
Now let me create the Main Menu screen.
Now let me create the main App component that integrates everything.
Now let me update the main.tsx and index.html.
Let me try to build the project now.
Build succeeded! Now let me enhance the 3D scene to show interactive dice and cups on the table based on game state. Let me create a table scene component.
Now let me update Scene.tsx to use the TableScene component.