I will now inspect the files in the workspace to understand the existing setup and dependencies.
I will now read package.json to check existing libraries and see what 3D, animation, and icon dependencies we have.
I will now install three, @types/three, lucide-react, framer-motion, canvas-confetti, @types/canvas-confetti, @react-three/fiber, and @react-three/drei to power our 3D Saloon and interactive UI.
I will now read src/index.css to verify our Tailwind CSS setup and add any custom styling needed for our Wild West / RDR1 Saloon atmosphere (parchment textures, worn leather, gold leaf borders, saloon fonts, custom scrollbars, and HUD animations).
I will now update src/index.css with Western saloon styling, custom scrollbars, parchment textures, gold leaf borders, and animations suited for our Red Dead Redemption Liar's Dice atmosphere.
I will now create src/game/types.ts defining all interfaces, types, and strict RDR1 rule specifications (Bid, GameState, Player, Character, PhysicsConfig, and LogEntry).
I will now create src/game/characters.ts with iconic Red Dead Redemption characters, custom AI probability weightings, and rich dialogue pools for when they make bids, bluff, call Liar, call Spot On, or react to table outcomes.
I will now create src/game/PhysicsManager.ts featuring Continuous Collision Detection (CCD) calculations, thick wall bounds, velocity sleep dampeners, and detailed architectural documentation on preventing mesh tunneling and clipping in 3D game engines.
I will now create src/game/BotAI.ts implementing exact combinatorial binomial probability math alongside personality-driven decision making (Raise, Call Liar, or Call Spot On) according to strict Red Dead Redemption 1 rules.
I will now edit src/game/BotAI.ts to utilize allPlayers or mark it cleanly without lint warnings.
I will now create src/game/WesternSoundManager.ts to generate realistic acoustic western sound effects, dice clicks, cup shaking rattles, and tension stingers using pure Web Audio API synthesis without external network dependency risk.
I will now create src/game/GameController.ts, the central Game State Machine controlling round lifecycles, turn pacing, bid validation, cup reveals, penalty calculation, and elimination logic.
I will now create src/components/3d/DiceModel.tsx to render 3D bone/ivory dice with clean pips, custom materials, and subtle roll/settle animations.
I will now create src/components/3d/CupModel.tsx for the realistic 3D leather cup featuring thick rim geometry, stitching details, and dynamic lifting/shaking animations.
I will now fix the unused variable warning in CupModel.tsx.
I will now create src/components/3d/SaloonScene.tsx containing our multi-light saloon setup, interactive mahogany and felt table, cups, and 3D dice physics visualization.
I will now create src/components/ui/ArchitectureInspector.tsx to let game developers live-inspect our state machine graph, test Continuous Collision Detection (CCD) substep physics parameters, view exact combinatorial binomial probability curves for the AI, and read our architectural documentation directly in the game UI.
I will now fix the variable name in ArchitectureInspector.tsx.
I will now fix the formula string representation inside the JSX in ArchitectureInspector.tsx.
I will read lines 240-260 of ArchitectureInspector.tsx to inspect any leftover variable name.
I will now fix the {total} syntax inside ArchitectureInspector.tsx.
I will now create src/components/ui/BiddingMenu.tsx, featuring strict RDR1 bid validation, legal quantity/face selectors, and large action buttons (Raise Bid, Call Liar, Call Spot On).
I will now create src/components/ui/PlayerTray.tsx displaying the human player's active dice inside an authentic parchment/mahogany diegetic tray at the bottom of the screen.
I will now create src/components/ui/OpponentStatus.tsx displaying opponent avatars, remaining dice indicators (which fade when lost), active turn glow, and dynamic speech bubbles showing what they are thinking or saying.
I will now create src/components/ui/ActionBanner.tsx to display dramatic Red Dead Redemption 1 style action announcements across the center of the screen during reveals and turn actions.
I will now create src/components/ui/ActionLogDrawer.tsx allowing players to inspect the complete history of bids, bluffs, and exact calls of the current match.
I will now create src/components/ui/GameSettingsModal.tsx enabling the customization of player count (2 to 4), opponent character selection, pacing timing, and lighting/sound preferences.
I will now create src/components/ui/UI_Manager.tsx to combine our diegetic player tray, opponent indicators, bidding menu, and action history into a cohesive Red Dead Redemption inspired Heads-Up Display (HUD).
I will now create src/App.tsx which boots our GameController and renders the UI_Manager.
I will now fix the unused React import warning in src/App.tsx.
I will now inspect index.html to verify the page title and meta description.
I will now update index.html with our western title and theme colors.
I will now run build_project to confirm that the entire 3D Liar's Dice video game, state machine, AI combinatorial probability engine, physics manager, and developer inspection studio build cleanly.
I have developed the 3D Liar's Dice Video Game inspired by the atmosphere, characters, and UI of Red Dead Redemption while strictly enforcing the game logic of the original RDR1 Liar's Dice minigame.
1. Code Architecture & Core Game Loop Overview
The game architecture is built on a clean, decoupled modular design separated into 5 primary engines:
[ GameController.ts ] <---> [ PhysicsManager.ts ]
(State Machine & Rules) (Continuous Collision & Containment)
^ ^
| |
[ BotAI.ts ] [ SaloonScene.tsx & Models ]
(Combinatorial Math & Archetypes) (Three.js Multi-Light & 3D Dice)
^ ^
+------------+---------------+
|
[ UI_Manager.tsx ]
(Diegetic RDR1 HUD & Inspector)
Key Scripts & Architecture Files Created (src/game/ & src/components/):
GameController.ts (State Machine & Turn Orchestrator):
- Manages the lifecycle states:
RoundStart → DiceShake → PlayerTurn ↔ OpponentTurn → RevealPhase (Liar / SpotOn resolution) → RoundEnd .
2. Game Rules & Logic (Strictly RDR1 Compliant)
- Settings & Players: Supports 2 to 4 Players (1 Human vs 1 to 3 AI opponent bots). Configurable anytime via the Match Settings menu (
GameSettingsModal.tsx).
- Dice & Simultaneous Shaking: Each player starts with exactly 5 dice. At round start, all active cups shake and lower simultaneously onto the mahogany felt.
- No Wilds (
wildsEnabled: false): Face 1s are treated strictly as face value 1s. No wildcard rules exist in this RDR1 implementation.
- Strict Raising Constraints: To raise legally, players must select either:
- Higher Quantity of any face value (e.g., from Four 3s to Five 2s).
- Same Quantity, but a Higher Face Value (e.g., from Four 3s to Four 4s).
- Calling "Liar" (Bluff Challenge): Cups lift cinematically. If actual face count < bid quantity: Bidder loses 1 die. If actual count ≥ bid quantity: Challenger loses 1 die.
- Calling "Spot On" (Exact Challenge): Cups lift cinematically. If actual face count === bid quantity: Every player at the table EXCEPT the caller loses 1 die! If not exact: Caller loses 1 die.
3. Lighting, Visibility & Saloon Atmosphere
- Multi-Light Visibility Setup (
SaloonScene.tsx):
- A warm overhead brass chandelier point light (
#ffbe76, intensity: 85) illuminates the table felt (#1e382b) and mahogany rim (#3c2214).
- Dedicated left and right rim/key lights (
#ffd8a8 and #ffaa5e) clearly highlight die pips (1-6) and leather cup stitching.
- Soft ambient and directional fill lights ensure zero pitch black shadows, preserving crisp visual clarity across every die face.
- Interactive Architecture & Physics Inspector Studio: Click the Engine & Architecture Studio button at the top of the screen at any time to open our developer inspection suite:
- Test high-velocity Continuous Collision Detection (CCD) substep counters live against thick compound walls.
- View real-time Combinatorial Binomial probability equations and live tactical survival percentages for the current table scenario.
Files built: src/index.css, src/game/types.ts, src/game/characters.ts, src/game/PhysicsManager.ts, src/game/BotAI.ts, src/game/WesternSoundManager.ts, src/game/GameController.ts, src/components/3d/DiceModel.tsx, src/components/3d/CupModel.tsx, src/components/3d/SaloonScene.tsx, src/components/ui/ArchitectureInspector.tsx, src/components/ui/BiddingMenu.tsx, src/components/ui/PlayerTray.tsx, src/components/ui/OpponentStatus.tsx, src/components/ui/ActionBanner.tsx, src/components/ui/ActionLogDrawer.tsx, src/components/ui/GameSettingsModal.tsx, src/components/ui/UI_Manager.tsx, src/App.tsx, index.html