# Big Map Build Plan

## Recommendation

Build the first map as a medium-sized handcrafted tile world, not a procedural infinite map. The game needs discovery, zones, enemy pressure, and prizes, so a designed map gives better control while the core loop is still being built.

Use Godot 4 `TileMapLayer` nodes for the tile world, `Camera2D` for player follow, `Area2D` zones for discovery/spawn logic, and tile collision/navigation data for blocking and pathfinding.

## Target For The First Map

- World size: start around 4096x4096 pixels.
- Tile size: 32x32 or 64x64. Prefer 32x32 if we use simple pixel-art tiles.
- Viewport: 1280x720.
- Zones:
  - Start Meadow: safe-ish learning area.
  - Forest: basic monsters and common prizes.
  - Ruins: tougher monsters and better score items.
  - Cave Edge: narrow paths, obstacles, stronger enemies.
  - Danger/Boss Area: highest reward, highest pressure.

This is big enough to explore while still simple enough to tune.

## Scene Structure

World scene:

- `World` (`Node2D`)
- `GroundLayer` (`TileMapLayer`)
- `DetailLayer` (`TileMapLayer`)
- `ObstacleLayer` (`TileMapLayer`)
- `NavigationRegion2D` or navigation-enabled tile data
- `Zones` (`Node2D`)
- `Pickups` (`Node2D`)
- `EnemySpawners` (`Node2D`)
- `Player` (`CharacterBody2D`)
- `Camera2D` under `Player`
- `CanvasLayer` HUD

The player should own the `Camera2D` at first because that is the simplest reliable follow setup. Later, if we need cinematic camera behavior, we can move camera logic into its own controller.

## Tile Layers

Use separate layers so each job stays clean:

- Ground: grass, dirt, stone, cave floor.
- Decorations: flowers, bones, broken pillars, grass clumps.
- Obstacles: trees, rocks, walls, water edges, cliffs.
- Overlay/Canopy later if needed.

Obstacle tiles should own collision shapes in the TileSet so the player and enemies cannot walk through them.

## Camera

Add `Camera2D` as a child of `Player`.

Initial settings:

- enabled/current: true
- position smoothing: on
- limit_left/top/right/bottom matching the map rectangle

Camera limits matter because the map is larger than the screen, but the camera should not show empty space outside the designed world.

## Zones

Use `Area2D` rectangles or polygons for zones.

Each zone should have:

- zone id
- display name
- enemy spawn table
- prize spawn table
- danger level
- discovery score
- optional music/ambience later

When the player enters a zone:

- update active zone
- spawn or enable that zone's enemy pressure
- reveal the zone if undiscovered
- award discovery points once

## Spawns

For the first version, avoid a complicated global spawn manager. Use simple zone-based spawn points.

Each zone can have several `Marker2D` spawn points. The game manager chooses spawn points near but not on top of the player.

Rules:

- Do not spawn inside the safe start radius.
- Do not spawn directly on camera center.
- Limit active enemies per zone.
- Increase enemy pressure in harder zones.

## Pickups And Prizes

Use `Area2D` pickup scenes.

Pickup types:

- Score prize
- XP
- Health
- Rare charm/luck prize
- One-time landmark discovery reward

Charm can later affect rare prize chance, pickup magnet radius, or bonus score.

## Navigation

Start simple:

- Direct chase enemies can move toward the player.
- Collision keeps them from walking through solid obstacles.

Then add pathfinding:

- Use `NavigationAgent2D` for enemies that should navigate around walls.
- Use `NavigationRegion2D` or tile navigation data for walkable areas.

This avoids overbuilding pathfinding before the map and enemies are fun.

## Implementation Order

1. Create `World.tscn` or evolve `main.tscn` into a world scene.
2. Add a larger map rectangle with placeholder tiles or colored blocks.
3. Add boundary collisions.
4. Add `Camera2D` follow with limits.
5. Add three rough zones.
6. Add prize pickups and XP pickups.
7. Add zone spawn points.
8. Add basic enemy spawning by zone.
9. Add stronger enemies in deeper zones.
10. Replace placeholder visuals with real tiles/art.

## Research Sources

- TileMapLayer: https://docs.godotengine.org/en/stable/classes/class_tilemaplayer.html
- Camera2D: https://docs.godotengine.org/en/stable/classes/class_camera2d.html
- Area2D: https://docs.godotengine.org/en/stable/classes/class_area2d.html
- 2D navigation overview: https://docs.godotengine.org/en/stable/tutorials/navigation/navigation_introduction_2d.html
- NavigationAgent2D: https://docs.godotengine.org/en/stable/classes/class_navigationagent2d.html
