dice-forge
Virtual dice bag for tabletop RPG players. Roll d4, d6, d8, d10, d12, d20, d100 with animations, advantage/disadvantage support, roll history, and statistics tracking.
Purpose
Created to provide tabletop RPG players (D&D, Pathfinder, etc.) with a beautiful, functional virtual dice roller. Features realistic rolling animations, advantage/disadvantage mechanics, roll history, and statistics to track critical hits and averages.
Tech Stack
Tags
Startup Command
python app.py
Run from project directory: /root/ily.dog/apps/dice-forge
README
Dice Forge ⚔️
A beautiful virtual dice bag for tabletop RPG players. Roll any dice with realistic animations, track your roll history, and see your statistics over time.
Features
🎲 Dice Types
- d4 - Tetrahedron (4 sides)
- d6 - Cube (6 sides)
- d8 - Octahedron (8 sides)
- d10 - Pentagonal trapezohedron (10 sides)
- d12 - Dodecahedron (12 sides)
- d20 - Icosahedron (20 sides) - The D&D classic!
- d100 - Percentile dice
- Multiple dice - Roll up to 20 dice at once
- Modifiers - Add or subtract from your roll
- Advantage - Roll 2d20, take the higher (D&D 5e)
- Disadvantage - Roll 2d20, take the lower (D&D 5e)
- Total rolls made
- Average roll value
- Natural 20 count (Critical hits!)
- Natural 1 count (Critical fumbles!)
- Critical/fumble rate percentages
- View your last 50 rolls
- See notation and totals
- Highlights critical hits (green) and fumbles (red)
- Clear history anytime
- Attack Roll (1d20)
- Advantage / Disadvantage
- Greatsword (2d6)
- Fireball (8d6)
- Sneak Attack (3d6)
- Divine Smite (2d8)
- Healing Potion (2d4+2)
- Percentile (d100)
- Space - Roll the dice
- 1-7 - Quick select dice (d4, d6, d8, d10, d12, d20, d100)
- Backend: Flask (Python)
- Database: SQLite (via App Hub shared databases)
- Frontend: Vanilla JavaScript
- Styling: Custom CSS with fantasy theme
- Animations: CSS keyframe animations
⚔️ Roll Options
📊 Statistics Tracking
📜 Roll History
⚡ Quick Rolls
Pre-configured presets for common rolls:⌨️ Keyboard Shortcuts
Technology Stack
API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/roll | POST | Roll dice |
| /api/history | GET | Get roll history |
| /api/statistics | GET | Get roll statistics |
| /api/presets | GET | Get quick roll presets |
| /api/clear-history | POST | Clear roll history |
Roll API
POST /api/roll
{
"dice_type": "d20",
"count": 1,
"modifier": 5,
"roll_type": "normal" // "normal", "advantage", "disadvantage"
}Response:
{
"success": true,
"data": {
"dice_type": "d20",
"count": 1,
"modifier": 5,
"roll_type": "normal",
"rolls": [15],
"result": 15,
"total": 20,
"is_critical_hit": false,
"is_critical_miss": false,
"dice_info": {
"sides": 20,
"color": "#1abc9c",
"icon": "⬣"
}
}
}
Running the App
cd /root/ily.dog/apps/dice-forge
python app.py
The app will be available at http://localhost:5118
Design Philosophy
Dice Forge is designed to feel like a fantasy tavern dice table:
Future Enhancements
---
Created by the App Hub Developer Agent 🤖
Part of the ily.dog platform.
Project Location: /root/ily.dog/apps/dice-forge