# splat

A physics-first city builder for Godot 4, by Ewan Croft ([ewancroft.uk](https://ewancroft.uk)).

## Overview

Splat is a physics-first city builder where the physics engine is the simulation. Buildings have weight, traffic is physical, infrastructure bends and decays. The city's history is written in the wear patterns of its surfaces.

Built on the [Chickensoft GodotGame](https://github.com/chickensoft-games/GodotGame) template with testing infrastructure, CI/CD, and code coverage configured out of the box.

## Getting Started

### Prerequisites

- [Godot 4.7+](https://godotengine.org/download/) (Mono/C# build required)
- [.NET SDK](https://dotnet.microsoft.com/download) (8.0+ recommended)
- [Blender](https://www.blender.org/download/) (asset pipeline required)

### Setup

```bash
# Clone the repository
git clone https://github.com/ewanc26/splat.git
cd splat

# Build the project
dotnet build
```

### Development

Open the project in Godot 4.7+ (Mono build) and edit `src/Game.tscn` for game logic.

## Testing

Tests use [GoDotTest](https://github.com/chickensoft-games/go_dot_test) and run directly inside the game.

```bash
# Run tests via VSCode launch configurations, or:
dotnet test
```

### Code Coverage

```bash
# Install tools (one-time)
dotnet tool install --global coverlet.console
dotnet tool install --global dotnet-reportgenerator-globaltool

# Generate coverage report
chmod +x ./coverage.sh
./coverage.sh
```

## Project Structure

```
src/           # Game source code
  Main.cs      # Entry point (bootstrap/test handoff)
  Game.cs      # Primary game logic
test/          # Test code (excluded from release builds)
addons/       # Godot plugins
```

## CI/CD

GitHub Actions workflows handle:
- **Visual tests** on Ubuntu with Mesa software rendering
- **Spell checking** on every push
- **Dependency updates** via Renovatebot
- **Code coverage** badge generation

## AT Protocol

Splat is designed for eventual AT Protocol integration. All game data is structured to be syncable — cities are public artifacts, not private state. No sensitive data exists; citizen profiles are synthetic and anonymized.

Late-stage roadmap includes city snapshot publication, building record sync, and social features (visiting other cities via AT Protocol). The game works fully offline; sync is optional.

## Credits

### Asset Packs

Splat uses the following free/open-source asset packs:

| Asset Pack | Author | License | Source |
|------------|--------|---------|--------|
| City Builder Bits | [KayKit](https://kaylousberg.itch.io) | CC0 | [itch.io](https://kaylousberg.itch.io/kaykit-city-builder-bits) |
| Forest Nature Pack | [KayKit](https://kaylousberg.itch.io) | CC0 | [itch.io](https://kaylousberg.itch.io/kaykit-forest) |
| Free Low Poly Vehicles Pack | [RGS_Dev](https://rgsdev.itch.io) | CC0 | [itch.io](https://rgsdev.itch.io/free-low-poly-vehicles-pack) |
| Low Poly Nature Pack | [flo-bit](https://flo-bit.itch.io) | CC0 | [itch.io](https://flo-bit.itch.io/low-poly-nature-pack) |

### Plugins

| Plugin | Author | License | Source |
|--------|--------|---------|--------|
| MCP4Godot | [Smalldy](https://github.com/Smalldy) | MIT | [GitHub](https://github.com/Smalldy/mcp4godot) |

### Template

Built on the [Chickensoft GodotGame](https://github.com/chickensoft-games/GodotGame) template (MIT License).

## License

Splat is licensed under the [GNU Affero General Public License v3.0](LICENSE).

Copyright (c) Ewan Croft ([ewanc26](https://github.com/ewanc26), [ewancroft.uk](https://ewancroft.uk)).

Built on the [Chickensoft GodotGame](https://github.com/chickensoft-games/GodotGame) template (MIT License).
