# Quick Start Guide

## Prerequisites
- PHP 7.4 or higher
- A web server (Apache, Nginx, or PHP built-in server)
- SQLite3 support in PHP

## Setup

### Option 1: Using PHP Built-in Server (Development)
```bash
cd tribegen
php -S localhost:8000 -t public/
```
Then navigate to `http://localhost:8000` in your browser.

### Option 2: Apache/Nginx
Configure your web server to serve the `public/` directory as the document root.

## First Run

1. The database will be automatically created on first access
2. Register a new account with your email
3. Create a new tribe
4. Begin playing!

## Game Mechanics Quick Reference

### Kobold Stats
- **Vitality**: Health and resistance to injury/disease
- **Intelligence**: Problem-solving and learning
- **Tinkering**: Crafting and repair ability
- **Medicine**: Healing and medical knowledge
- **Crafting**: Creation of items and goods
- **Personality**: Social interactions and morale
- **Will**: Mental fortitude and determination

All stats range from 0-100 and are displayed as text descriptions rather than numbers.

### Age Tiers
- **Egg** (age < 0): Surprise births
- **Baby** (age 0-3): Reduced stats
- **Adult** (age 4-34): Full potential
- **Old** (age 35-59): Reduced stats, potential old-age injuries
- **Very Old** (age 60+): Limited capability

### Injuries
- Each injury has a severity (1-10)
- Total injury severity ≥ Kobold's vitality = Death
- Injuries can be treated with medicine
- Old-age injuries cannot be cured

### Items
- Items can modify stats (+1, -1, etc., never multipliers)
- Items are stored in tribe storage
- Kobolds can equip items for stat bonuses
- Items don't disappear when Kobold dies

### Events
- Player-initiated events (hunting, exploration, farming)
- Automatic month-progression events
- Events can kill, injure, or add Kobolds
- Events can find or create items

## Expandable Systems

### Adding Events
Events are easily expandable. Create a new file in `src/Events/` extending the `Event` class and register it in `EventManager`.

### Adding Injuries
Add new injury types by creating them in events. Each injury has a category and severity.

### Adding Items
Items can have any combination of stat modifications and are created through events or game setup.

## Troubleshooting

### "Database is locked"
- Ensure the `data/` directory exists and is writable
- Close any other instances of the game accessing the same save

### PHP errors
- Verify PHP 7.4+ is installed: `php -v`
- Ensure SQLite3 extension is enabled
- Check web server error logs

### Game not loading
- Clear browser cache
- Check JavaScript console for errors (F12)
- Verify all files are in the correct directories
