planetsim/docs/fauna_generation_plan.md
Jonas Reith 53e371bb2f Add Biota stage: flora, fauna & funga (density + slot/point population)
World-Creation stage after biomes. Two layers (raylib-free engine):
- Per-cell density scalars (flora/fauna/funga in [0,1]) derived from the
  climate fields each tick (drive color modes 8/9/0). Flora = Liebig-min of
  temp & moisture; fauna ~ flora with carnivores gated on local prey; funga =
  moisture/organic-matter-led + cold-tolerant. Zero on water/ice.
- On-demand discrete population (key L, saved as v7): each land cell draws
  broad archetypes from a comprehensive table into a per-kind slot cap +
  density-scaled point budget (size -> cost), weighted by biome/climate
  suitability and a regional bonus for same-biome neighbours. Separate RNG
  seeded from cfg.seed so generating biota never perturbs tectonic determinism.

Organisms are labelled by taxonomy (Family + Size + role, e.g. "Felidae
(Big, Carnivore)") with the full Class > Order > Family tree stored, never an
informal common name. Cell-info panel word-wraps + aggregates duplicates so the
lists no longer get cut off.

New: src/sim/PlanetBiota.{hpp,cpp} + PlanetFlora/Fauna/FungiGen.cpp, color
modes/colors, bio* config knobs, save v7 (older saves load with empty
population), test_biota.cpp (densities, fauna<=capacity, carnivore gating,
slot/point budgets, determinism + RNG isolation, v7 round-trip). Docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 13:56:03 +02:00

2.6 KiB

Fauna Generation Plan

For fauna, I want the system to handle animals in broad ecological groups: predators, herbivores, and animals that fall somewhere in between.

  1. Basic Animal Types

First, we should define basic animal types that can exist in many different environments. These are not specific species, but general animal categories.

For example:

Rodents
    Desert rodents in desert regions
    Swamp rodents in swamp regions
    Forest rodents in forest regions

The same approach should be used for other common animal groups that can appear across many biomes. 2. Animal Classification

For regional animals, we should describe them more by broad biological classification and size rather than by exact genus or species.

The classification should use something like:

Class
Order
Family
Size category

Example: text

Animal: Cat-like predator Class: Mammal Order: Carnivora Family: Felidae Size: Small

A tiger-like animal would use the same family but have a larger size: text

Animal: Tiger-like predator Class: Mammal Order: Carnivora Family: Felidae Size: Big

Size categories could be:

Tiny
Small
Medium
Big
Huge

If more biological information is needed, please ask me. You can also look up general classification information if needed. 3. Cell Population System

Each map cell should be populated using a slot and point system.

For example:

Each cell has 10 fauna slots
Each cell has 20 fauna points

Every animal takes up a certain number of points depending on its size: Size Point Cost Tiny 1 Small 2 Medium 3 Big 4 Huge 5

Animals are added to the cell until either:

All slots are filled, or
All points are used

Once one of these limits is reached, the system stops adding animals to that cell. 4. Regional Distribution

To create a more homogeneous and natural distribution, the system should check neighboring cells when populating fauna.

The rules could be:

If neighboring cells have the same climate, there is a high probability that the same or similar animals appear there.
If neighboring cells have a different climate, it is more likely animals should be generated instead.
Similar biomes should share more fauna.
Very different biomes should have more distinct fauna.

This should help avoid every cell feeling completely random while still allowing variety between different regions. 5. Overall Goal

The goal is to create a fauna system that feels natural, biome-based, and regionally consistent, without needing to define every animal as an exact real-world species. Animals should be generated from broad biological groups, ecological roles, and size categories.