Spaces:
Sleeping
Sleeping
| title: LifeFrontier | |
| emoji: π₯ | |
| colorFrom: pink | |
| colorTo: red | |
| sdk: gradio | |
| sdk_version: 5.49.0 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| short_description: Couple game | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
| # π Life Frontier: Partner's Concerto | |
| A turn-based strategy game for couples built with Gradio. | |
| ## Quick Start | |
| ### Local Development | |
| ```bash | |
| pip install gradio | |
| python app.py | |
| ``` | |
| Open: http://localhost:7860 | |
| ## How to Play | |
| ### Setup | |
| 1. **Player 1**: Click "Create Room", get Room ID | |
| 2. **Player 2**: Enter Room ID, click "Join Room" | |
| 3. **Game starts** automatically when 2 players join | |
| 4. **Others** can join as spectators | |
| ### Gameplay | |
| - **Goal**: Achieve highest QoL score after 8 rounds | |
| - **Resources**: Time (24h/turn), HP, CP, Money, Stress | |
| - **Actions**: Rest, Execute Tasks, End Turn | |
| - **Turn-based**: Players alternate taking actions | |
| - **Elimination**: Stress β₯ 20 = game over | |
| ### Rest Actions | |
| - **Quick Nap (3h)**: Roll dice, recover 2Γ HP | |
| - **Full Sleep (9h)**: Recover to HP=8, CP=4, -1 stress | |
| - **Deep Rest (12h)**: Full recovery, -2 stress | |
| ### Tasks | |
| - **Work (W)**: Earn money | |
| - **Domestic (D)**: Reduce stress | |
| - **Health (H)**: Upgrade stats | |
| - **Relationship (R)**: Bond + reduce stress | |
| - **QoL (Q)**: Convert money to points | |
| ### Winning | |
| ``` | |
| Final QoL = Base QoL + Health Bonus - Stress | |
| Health Bonus = (HP max - 10) Γ 2 + (CP max - 5) Γ 3 + Reputation | |
| ``` | |
| ## Features | |
| β Turn-based gameplay with SQLite state | |
| β Real-time spectator mode | |
| β Public rankings system | |
| β Persistent game history | |
| β Single Docker container | |
| β No WebSocket complexity | |
| ## Game State Management | |
| All state stored in SQLite: | |
| - `rooms`: Game rooms and status | |
| - `players`: Player resources and stats | |
| - `spectators`: Viewers list | |
| - `rankings`: Leaderboard | |
| - `game_history`: Completed games | |
| ## Architecture | |
| ``` | |
| app.py (Single File) | |
| βββ Database Layer (SQLite) | |
| βββ Game Logic (Turn-based) | |
| βββ Gradio UI (3 tabs) | |
| βββ Session Management | |
| ``` | |
| **No server, no WebSocket** - just simple turn-based updates! | |
| ## Tips | |
| - **Refresh** button updates game state | |
| - **Rankings** show top players by average QoL | |
| - **Spectators** can watch live but can't play | |
| - **Room IDs** are permanent until game ends | |