LifeFrontier / README.md
npc0's picture
Update README.md
6caf003 verified

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
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

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