|

🌱 Post #7: Resources, Reactions, and Definition-Driven Simulation

Genesis of Infrastructure — Entry #7
By Emergent Dynamics, building Colonies: Genesis of E.D.E.N.


Colonies isn’t just a game. It’s a living system.

Everything that exists—from plants and planets to factories and factions—is made possible through emergent resource dynamics and reaction-driven change.

This post covers how we built a definition-based simulation core that turns JSON into life: resources that flow, react, and evolve across a modular, scalable architecture.


🔁 Simulation is Change Over Time

At its core, simulation is this:

🧠 Something exists → something acts on it → it becomes something else

We call these steps:

  • Resources: Things that exist
  • Reactions: Rules that transform those things
  • Definitions: JSON declarations of what can happen and how

🧪 Resources: The Atoms of Simulation

Resources are the raw materials of reality—literal or abstract.

Examples:

  • H2O
  • CO2
  • Biomass
  • Heat
  • Labor
  • Knowledge
  • SiliconIngot

Every resource is defined in the ResourceDefinition catalog:

{
  "Id": "Biomass",
  "DisplayName": "Biomass",
  "Unit": "kg",
  "Tags": ["Organic", "EnergyStorage"],
  "DensityKgPerM3": 1050
}

Resources are not just inventories.
They power everything: growth, decay, technology, warfare, diplomacy.


⚗️ Reactions: Transformation Engines

Reactions define what can happen to resources.

They are the simulation’s chemistry, biology, economy, and physics.

Example — Photosynthesis:

{
  "Id": "Photosynthesis",
  "Reactants": [
    { "Resource": "CO2", "Rate": 1.0 },
    { "Resource": "H2O", "Rate": 1.0 },
    { "Resource": "SolarIrradiance", "Rate": 1.0 }
  ],
  "Products": [
    { "Resource": "Biomass", "Rate": 1.0 },
    { "Resource": "O2", "Rate": 1.0 }
  ],
  "Tags": ["Biological", "Autotroph"]
}

These definitions live in ReactionDefinition, and can be chained, throttled, and even conditioned by capabilities or environments.


🧠 The Power of Definitions

By externalizing simulation logic into JSON, Colonies gains:

  • 🔄 Hot reloading of simulation behavior
  • 🧩 Modular extensibility by designers or AI
  • 🔬 Testability of individual reactions or flows
  • 🛠️ Scripting of progression, technology, and emergence

🧱 The Core Interfaces

Every definition implements the IDefinition interface:

public interface IDefinition
{
    string Id { get; }
    void Validate();
}

These definitions are loaded via a DefinitionResolver:

var biomass = DefinitionResolver.Get<ResourceDefinition>("Biomass");

This keeps everything:

  • Serializable
  • Moddable
  • Sharable
  • Traceable

🌐 Emergent Behavior through Composition

Let’s take an example:

  1. A tile receives sunlight (SolarIrradiance)
  2. It has access to H2O and CO2
  3. The tile includes a PhotosyntheticOrganism capability
  4. This enables the Photosynthesis reaction
  5. Over time, Biomass and O2 accumulate

That’s how a tile becomes alive.

And this behavior isn’t hardcoded—it emerges from data + environment + capability.


🔥 Reactions Drive Every System

It’s not just biology.

  • Refining ore: input IronOre, output IronIngot
  • Smelting: Heat + IronOreMoltenIron
  • Cooking: Meat + HeatCookedMeat
  • Recycling: ScrapMetalIronIngot + Carbon
  • Cognition: Experience + ObservationKnowledge

Simulation is transformation.


🏗️ Capabilities Bind Entities to Simulation

Each simulation entity (tile, facility, faction, unit) has capabilities that declare:

  • What reactions they can run
  • What resources they accept or produce
  • How they interact with the world

Example: A Firepit facility might implement BurnsFuel, HeatsNearbyTiles, and CooksFood.

These are composable—you can simulate tribal tech, modern factories, or alien biotech using the same system.


🧬 Why This Makes Colonies Different

Most games simulate with hardcoded rules.

Colonies uses:

✅ A unified resource graph
✅ A data-driven reaction engine
✅ A modular capability system
✅ Cross-cutting definitions to drive emergent behavior

The game doesn’t simulate what happens.
It simulates why it happens—and lets that propagate.

This opens the door to climate systems, evolution, economics, AI memory, diplomacy, and more.


🛠️ Next Up: Facilities, Land Use, and Infrastructure Lifecycles

Now that we have flowing resources and dynamic reactions, the next step is infrastructure.

In Post #8, we’ll cover:

  • How tiles host multiple player- or AI-owned facilities
  • How land usage and surface area are simulated
  • How infrastructure decays, is maintained, and evolves

This is where Colonies starts to feel like a civilization simulation—not just a sandbox.

Stay tuned.

Similar Posts

Leave a Reply