PhysDice — Physics Dice Framework
A complete physics dice game you can drop into any level. Shake, roll, score — with AI, custom rules, and camera system included.Supported Engine Versions:UE5.6~UE5.7
Real Physics Dice — No probability tables. Dice use Unreal's physics engine to roll, bounce, and settle naturally. Face detection uses axis-aligned mapping that works with any custom dice mesh.
Physics Cup System — Players shake dice in a physics cup controlled by mouse movement. The cup uses invisible colliders for physics simulation while supporting any custom cup mesh for visuals. Configurable bounce animation, wall physics, and table margins.
Flexible Scoring System — Define any scoring rules through the editor: single-face values, N-of-a-kind, straights, N-groups, and custom exact combos. Rules are matched by priority and support partial/full-set modes. Includes Farkle and Hot Dice rules.
AI Opponent — Built-in AI with 3 difficulty levels. AI shakes the cup, evaluates dice, makes keep decisions using expected-value calculations, and banks strategically.
Camera System — 5 camera modes: seat overview, finger/selection view, palm tracking (follows cup), free look, and dice inspection. All offsets are Pawn-relative — just place and rotate the Pawn to define the player's seat.
Full Game Flow — Complete turn cycle: pick up cup → shake → throw → select scoring dice → bank or roll again → switch turns → detect winner. Includes forfeit support.
Base UI Widgets — HUD showing both players' scores, turn indicators, center messages. Game over screen with rematch. Forfeit confirmation dialog.
Dice Trait System — 32 predefined passive traits across 5 categories: Physics (bounce, damping, mass), Scoring (bonus points, multipliers), Protection (Farkle immunity, auto-reroll), Pressure (debuff opponents), and Strategic (gold bonuses, intel). Assign traits to dice by star/rarity level (0-5). Data structures are fully included — implement your own trait processing logic to create unique dice abilities.
Audio System — Per-material collision sounds on dice. Collision sound components for table and cup surfaces. Centralized audio settings data asset.
Designed for Extension — Every class is built for inheritance. Override virtual functions to add your own game rules, settings integration, AI profiles, dialogue, progression systems, and custom UI.