# Concept

## Overview

A single-player asymmetric game inspired by DOTA's wave/tower structure, combined with a Factorio-style factory builder. The player builds a factory on an asteroid to supply shipyards that produce autonomous combat ships. Those ships fight off enemy waves advancing from the right, with tougher boss waves arriving periodically. Pushing into enemy territory and destroying their defence stations occasionally yields artifacts, which are used to upgrade the HQ; the goal is to upgrade the HQ enough to launch it into space, winning the game.

## Setting & Visuals

- Science-fiction setting on the boundary between an asteroid and space.
- 2D (or 2.5D) top-down view similar to Factorio.
- The game world has a fixed height and scrolls horizontally.
- The asteroid occupies the left portion of the world; space extends to the right.

## Game World Layout (left to right)

1. **Asteroid** — the player's factory and shipyards are built here. The HQ sits at the asteroid's right edge.
2. **Player defence stations** — automatically engage approaching enemies; can be destroyed by the enemy.
3. **Enemy defence stations** — the push target; can be destroyed by the player; mark the right boundary of the scrollable area.
4. **Enemy spawn area** — waves originate from off-screen to the right.

## Factory & Belts

- Factory buildings placed by the player are queued and constructed one at a time, each taking some time to complete.
- The crafting/production tree is defined in a config file so it can be extended without code changes.
- Materials are transported between buildings using belts (straight, curved) and splitters.
- Buildings accept any material delivered by belts feeding into them; there are no labeled input ports. Each building has one fixed output port.
- Each building's input buffer can hold up to twice the amount needed for one production cycle of the selected recipe.

## Resources & Building Blocks

Two sources feed the same production tree:

- **Mining** — the starting resource method; ores are extracted from the asteroid and smelted into basic materials.
- **Scrap** — collected by salvage ships from destroyed enemies; can be smelted into basic materials like mined ores, or processed in a **Reprocessing Plant** to extract higher-level intermediate products (fixed probabilities per product type).

**Building blocks** are the only globally shared resource. An assembler recipe produces them from materials; they are transported via belts into the HQ, which adds them to the global stock. Building blocks are spent to place factory buildings and to unlock additional asteroid columns.

## Buildings

| Building | Size | Description |
|---|---|---|
| **HQ** | 4×3 | Pre-placed. Accepts building blocks via belt and adds them to the global stock. |
| **Miner** | 2×2 | Player selects which ore type to extract. Ore never depletes. |
| **Smelter** | 2×2 | Converts ore or scrap into basic materials. No recipe selection needed. |
| **Assembler** | 3×3 | Player selects a recipe. Produces building blocks or intermediate/advanced products. |
| **Reprocessing Plant** | 3×3 | Converts scrap into higher-level products with fixed probabilities per product type. |
| **Shipyard** | 4×2 | Player selects a schematic. Produces that ship type when required materials are available. |
| **Belt** | 1×1 | Transports materials. Comes in straight and curved variants. |
| **Splitter** | 1×1 | Splits a belt's flow into two outputs. |

## Ships & Shipyards

- Shipyards are built at the asteroid's right edge.
- The player clicks a shipyard to assign a schematic; the shipyard then automatically produces that ship type whenever the required materials are available.
- New schematics are unlocked as loot from destroyed enemy defence stations.
- Ships are fully autonomous. Known roles:
  - **Combat ships** — travel right and engage enemies.
  - **Salvage ships** — fly out, collect scrap from destroyed enemies, and return; vulnerable while operating.
  - **Repair ships** — fly out and repair damaged player defence stations and ships.

## Enemy Waves & Difficulty Scaling

- Waves consist of a single enemy ship type whose stats scale with difficulty.
- Waves spawn over several seconds; a gap follows before the next wave begins spawning. The previous wave may still be approaching or fighting during the gap.
- A tougher **boss wave** spawns periodically on its own countdown, on top of normal waves.
- Enemy strength increases gradually over time and with each boss wave that occurs.

## Push Mechanic

- The player must push — destroying enemy defence stations is the only way to earn artifacts, which are required to win.
- Destroying a set of enemy defence stations advances the boss countdown (bringing the next, stronger boss wave sooner), extends the scrollable area, and places a new (stronger) set of stations at the new boundary.
- Destroyed enemy defence stations drop either a ship/module schematic or, occasionally, an artifact.

## Win Condition

- Artifacts are gathered by defeating enemy defence stations instead of taking a schematic reward.
- Artifacts are used to upgrade the HQ. Once the HQ is upgraded enough, the player can launch it into space — this is how the game is won.

## Starting Conditions & Game Over

- The player starts with the HQ and player defence stations pre-placed and a stock of building blocks; no other buildings are pre-placed.
- There is a grace period before the first wave to allow initial setup.
- If all ships and player defence stations are destroyed, enemies attack the HQ. The game is lost when the HQ is destroyed. Factory buildings are never targeted.
- The game is won when the player launches the HQ into space (see Win Condition).

## Asteroid Expansion

- The asteroid has a configurable number of columns at game start.
- Additional columns are unlocked by spending building blocks (cost per column to be tuned).
