DNA Civ v10: Biological Edition RESEARCH READY

Computational Platform for Evolutionary Dynamics Research
Abstract

DNA Civ v10 is a browser-based agent-based modeling platform implementing evolutionary genetics, horizontal gene transfer, adaptive immunity, predator-prey dynamics, and emergent deme formation. The platform employs standard biological terminology throughout, mapping directly to vocabulary used in peer-reviewed population genetics and evolutionary ecology literature. Version 10 introduces Closed System Mode for controlled experiments with defined founder populations, complementing the automated batch experimentation system with headless execution. The platform features deterministic seeded random number generation for full reproducibility, comprehensive data export (JSON/CSV), and statistical summary generation.

1. System Overview

1.1 Research Applications

DNA Civ v10 provides a platform for investigating:

  • Population genetics: Allele frequency dynamics, genetic drift, selective sweeps
  • Host-pathogen coevolution: Arms race dynamics, virulence evolution
  • Immunology: Innate vs. adaptive immunity, herd immunity thresholds
  • Horizontal gene transfer: Viral integration, endogenous retrovirus formation
  • Social evolution: Deme formation, kin selection, cooperation
  • Predator-prey dynamics: Trophic interactions, niche partitioning
  • Speciation: Reproductive isolation, hybrid zones

1.2 Version History

VersionMajor Additions
v5Core genetics, DNA lab, microorganisms, demes
v6Epistasis, predation, speciation, environmental zones
v7Microbe evolution, adaptive immunity, HGT
v8Seeded RNG, run metadata, data export
v9Batch experiment runner, headless mode
v10Biological terminology, Closed System Mode

2. Terminology Mapping v10

Version 10 replaces all game-style terminology with standard biological vocabulary suitable for peer-reviewed publication.

2.1 Core Gene Names

PreviousBiological TermDefinition
SpeedMotilityMovement velocity
SocialSocialityGroup affinity
AggroAggressionPredation tendency
MetabolMetabolismEnergy efficiency
FertilFecundityReproductive rate
LongevLifespanMaximum longevity
CuriousExplorationDispersal drive
HardyHardinessPathogen resistance

2.2 Latent Gene Names

PreviousBiological TermEffect
CamoCrypsisDetection evasion
ToxicToxicosisAnti-pathogen defense
TeleChemosenseResource detection
MorphPlasticityPhenotypic drift
PsiQuorumGroup awareness
RegenRegenerationSelf-healing
ImmortSenescence⁻Reduced aging
TranscendApexGeneUltimate evolution

2.3 Social & Environmental Terms

PreviousBiological TermStandard Usage
TribeDemePopulation genetics (Wright)
Sun Clan, Moon FolkDeme-α, Deme-β, Deme-γSystematic naming
OasisNutrient⁺High resource density
DesertNutrient⁻Low resource density
TundraLow-StressReduced metabolic cost
VolcanicMutagenMutagenic zone

3. Genetic Architecture

3.1 Genome Structure

Each organism carries a 64-bit binary genome organized into 16 loci of 4 bits each (values 0-15, normalized to 0.0-1.0).

Bit Position:  0         16        32        48        64
               |----+----|----+----|----+----|----+----|
               [ ACTIVE GENES  ]   [   LATENT GENES    ]
               Loci 0-7 (express)  Loci 8-15 (require unlock)

3.2 Active Genes (Loci 0-7)

Motility
Bits 0-3
Movement velocity
Sociality
Bits 4-7
Deme affinity
Aggression
Bits 8-11
Predation tendency
Metabolism
Bits 12-15
Energy efficiency
Fecundity
Bits 16-19
Reproduction rate
Lifespan
Bits 20-23
Maximum longevity
Exploration
Bits 24-27
Dispersal drive
Hardiness
Bits 28-31
Pathogen resistance

3.3 Latent Genes (Loci 8-15)

Latent genes require activation via mutagen exposure. Once unlocked, they are heritable with 70% transmission probability.

GeneBitsActivation Effect
Crypsis32-3570% microbe/predator detection evasion
Toxicosis36-3980% kill chance on infection attempt
Chemosense40-43Up to 2.5× resource detection range
Plasticity44-47Phenotypic drift every 50 ticks
Quorum48-51Enhanced group awareness (reserved)
Regeneration52-55+0.5 × trait value energy/tick
Senescence⁻56-59Lifespan × (1 + trait value)
ApexGene60-63Virus immunity, +0.3 energy/tick

3.4 Genetic Operators

Crossover (Meiotic Recombination)

CONFIG.CROSSOVER_POINTS = 2

Parent A: 1111000011110000111100001111000011110000111100001111000011110000
Parent B: 0000111100001111000011110000111100001111000011110000111100001111
                    ↑              ↑
            Crossover points (random)
                    
Child:    1111000011001111000011110000111100001111000011110000111100001111

Point Mutation

MUTATION_RATE = 0.02 (2% per bit)
Expected mutations per offspring: 64 × 0.02 = 1.28

4. Environmental Systems

4.1 Resource Dynamics

ParameterDefaultDescription
RESOURCE_CLUSTERS6Number of food zones
RESOURCE_BASE_RICHNESS1.2Maximum richness value
Depletion rate0.001/tickWhen organism forages
Regeneration rate0.002/tickPassive recovery

4.2 Seasonal Modulation

SeasonResource ModifierEnergy Decay Modifier
Spring1.3×0.9×
Summer1.4×0.8×
Autumn0.8×1.1×
Winter0.6×1.15×

TICKS_PER_SEASON = 80 → Full year = 320 ticks

4.3 Environmental Zones v10

ZoneResource ModDecay ModSelection Pressure
Nutrient⁺1.5×0.7×Refuge, high carrying capacity
Nutrient⁻0.5×1.4×Resource limitation, competition
Low-Stress0.8×1.2×Reduced metabolic cost
Mutagen1.2×1.3×Mutagenic, 0.2% damage/tick

5. Microorganism Ecology

5.1 Microbe Types

☣️ Virus

Corrupts target gene locus via bit-flipping. Causes energy drain during infection. Carries 4-bit genetic payload for HGT.

⚕️ Symbiont

Temporarily boosts one trait (+0.3) while reducing another (-0.2). Models mutualistic endosymbiosis.

✧ Mutagen

Unlocks latent genes (loci 8-15). Once unlocked, genes are heritable. Models transposon activation.

5.2 Microbe Genome (v7+)

Microbes have their own heritable traits that evolve over generations:

TraitRangeEffect
virulence0.05-0.5Damage/corruption strength
infectivity0.1-0.9Base infection success rate
targetBias0-7Preferred host gene target
mutationRate0.01-0.3Offspring variation rate
payload4 bitsViral DNA for HGT (viruses only)

5.3 Horizontal Gene Transfer

When viruses infect, there is a 15% chance of HGT—viral genetic payload integrates into host genome:

if (random() < 0.15) {
    viralInsert = {
        sequence: micro.genome.payload,  // 4 bits
        insertPoint: targetGene.bits[0],
        sourceStrainId: micro.strainId
    };
    entity.viralDNA.push(viralInsert);
    entity.dna = integrateViralDNA(entity.dna, viralInsert);
}

Integrated viral DNA is heritable (80% transmission) and becomes a permanent part of the lineage—analogous to endogenous retroviruses in vertebrate genomes.

6. Immune System Modeling

6.1 Innate Immunity (Hardiness Gene)

innate_resistance = Hardiness × 0.5
// Maximum 50% resistance from genetics alone

6.2 Adaptive Immunity (Immune Memory)

Organisms build strain-specific resistance from surviving infections:

entity.immuneMemory = Map<strainId, {
    resistance: 0.0-0.9,    // Learned resistance
    encounters: count,       // Times exposed
    lastEncounter: tick,     // For decay calculation
    strainType: 'virus'|'symbiont'|'mutagen'
}>

6.3 Combined Resistance

total_resistance = min(0.95, innate_resistance + adaptive_resistance)
// 95% cap prevents complete immunity

6.4 Maternal Antibody Transfer

Offspring inherit 30% of mother's resistance for strains where maternal resistance exceeds 0.3:

for each [strainId, memory] in parent.immuneMemory:
    if memory.resistance > 0.3:
        child.immuneMemory.set(strainId, {
            resistance: memory.resistance × 0.3,
            inherited: true
        })

7. Behavioral & Social Systems

7.1 Goal-Directed Behavior

ConditionGoalBehavior
energy < 40foodSeek nearest resource
Sociality > 0.5, no demesocializeSeek other organisms
Exploration > 0.6exploreRandom destination
elseidleLocal wandering

7.2 Deme Formation v10 TERM

Deme: A local breeding population; standard term in population genetics (Sewall Wright, 1943).

Requirements:

  • Sociality > 0.4
  • ≥ DEME_MIN_SIZE (3) organisms within DEME_DISTANCE (18)
  • All unaffiliated

Demes are named systematically: Deme-α, Deme-β, Deme-γ, etc.

7.3 Predator-Prey System

// Trigger: Aggression > 0.4, random check passes
hunt_chance = Aggression × 0.02

// Target selection: Nearest non-deme member
target = nearest(entities.filter(e => e.deme !== predator.deme))

// Attack roll
attack_power = Aggression × phenotype_bonuses
defense = target.Hardiness + target.Motility × 0.5
success = random() < (attack_power / (attack_power + defense))

// Energy transfer on successful kill
if success:
    damage = 10 + attack_power × 15
    energy_gained = damage × 0.4

7.4 Speciation

hamming_distance = count_different_bits(dna1, dna2)
can_mate = hamming_distance <= SPECIATION_THRESHOLD (20)

// Exception: Hybridizer phenotype bypasses threshold

8. Epistasis & Phenotype Expression

Gene-gene interactions produce emergent phenotypes when trait thresholds are met:

🧭 Disperser
Exploration≥0.6, Motility≥0.6 → +50% resource range
🐺 Cooperative Hunter
Aggression≥0.5, Sociality≥0.6 → +30% attack with deme
🛡️ Armored
Hardiness≥0.7, Metabolism≥0.5 → Virus corruption immunity
⚔️ Hyperpredator
Aggression≥0.8, Motility≥0.5 → 2× attack damage
🔮 K-Strategist
Exploration≥0.7, Lifespan≥0.7 → Faster latent unlocks
💪 Stress-Tolerant
Hardiness≥0.6, Lifespan≥0.6 → 30% reduced decay
🤝 Hybridizer
Sociality≥0.8, Exploration≥0.5 → Ignores speciation barrier
👑 Apex Predator
Aggression≥0.7, Hardiness≥0.7, Motility≥0.6 → 1.5× attack

9. Closed System Mode v10

Closed System Mode disables primordial emergence, creating a controlled experimental environment where populations can go extinct.

ModeSpontaneous GenerationExtinction PossibleUse Case
Open (default)✅ YesNo (life re-emerges)Ecological observation
Closed❌ No✅ YesControlled experiments

9.1 Experimental Applications

  • Founder effect studies: Start with specific genotypes, observe drift
  • Competition experiments: Two defined lineages competing
  • Lineage tracking: Follow descendants of specific individuals
  • Extinction dynamics: Identify conditions causing population collapse

9.2 Workflow for Lab-Created Populations

1
Enable CLOSED_SYSTEM in Config panel
2
Reset simulation (clears existing population)
3
Open 🧬 Lab
4
Create/edit specimens with desired genotypes
5
💉 Inject designed organisms into simulation
6
Observe competition and selection
7
Export data for analysis

10. Batch Experiment Runner

10.1 Configuration Options

SettingDescriptionExample
Variable to TestCONFIG parameter to varyMUTATION_RATE
Values to TestComma-separated values0.01, 0.02, 0.05, 0.1
Runs per ValueReplicates for statistics25
Ticks per RunSimulation duration5000

10.2 Testable Variables

  • MUTATION_RATE (0.005 - 0.1)
  • ENERGY_DECAY (0.1 - 0.5)
  • SPECIATION_THRESHOLD (10 - 40)
  • INITIAL_POPULATION (3 - 50)
  • RESOURCE_CLUSTERS (3 - 12)
  • MICROBE_SPAWN_CHANCE (0.001 - 0.01)

10.3 Headless Execution

tickHeadless() runs full simulation logic with zero rendering—10-100× faster than visual mode. Browser remains responsive via chunked execution yielding every 50ms.

11. Data Formats & Export

11.1 Export Buttons

ButtonOutputUse
📊 JSONFull run dataComplete analysis
📈 CSVTime seriesSpreadsheet/statistics
💾 SaveSave fileResume later
📂 LoadImport saveRestore state

11.2 JSON Export Structure

{
  "meta": {
    "id": "run-m4k7x2-a3b9c",
    "seed": "experiment-42",
    "configHash": "3f8a2b1c",
    "version": "10.0.0"
  },
  "config": { ... },
  "summary": {
    "finalPopulation": 45,
    "totalBorn": 523,
    "demes": 3
  },
  "timeSeries": [ ... ],
  "genePoolHistory": [ ... ],
  "events": [ ... ],
  "finalCensus": [ ... ],
  "microbes": [ ... ]
}

11.3 Batch Summary CSV

variable_value,runs,avg_final_pop,std_final_pop,avg_max_gen,extinction_rate
0.01,25,45.30,12.40,8.50,0.04
0.02,25,42.10,15.60,9.20,0.08
0.05,25,38.40,18.20,11.30,0.12

12. Experimental Protocols

12.1 Protocol: Mutation Rate Effect

Hypothesis: Higher mutation rates increase steady-state genetic diversity but may reduce population stability.
VARIABLE: MUTATION_RATE
VALUES: 0.005, 0.01, 0.02, 0.04, 0.08
RUNS_PER_VALUE: 30
TICKS_PER_RUN: 5000
MEASUREMENTS:
  - Final genetic diversity
  - Extinction rate
  - Average max generation
ANALYSIS:
  - One-way ANOVA for diversity
  - Chi-square for extinction rate

12.2 Protocol: Founder Effect (Closed System)

Hypothesis: Small founder populations exhibit reduced diversity and increased drift-driven trait fixation.
VARIABLE: INITIAL_POPULATION
VALUES: 3, 5, 10, 25
SETUP: CLOSED_SYSTEM = true
RUNS_PER_VALUE: 50
TICKS_PER_RUN: 4000
MEASUREMENTS:
  - Time to first extinction
  - Diversity at tick 2000 vs 4000
  - Trait variance reduction
ANALYSIS:
  - Survival analysis
  - ANOVA for diversity

12.3 Protocol: Speciation Threshold

Hypothesis: Lower thresholds lead to more species but reduced within-species diversity.
VARIABLE: SPECIATION_THRESHOLD
VALUES: 10, 15, 20, 25, 30, 40
RUNS_PER_VALUE: 25
TICKS_PER_RUN: 6000
MEASUREMENTS:
  - Reproductively isolated clusters
  - Within-cluster diversity
  - Hybridizer phenotype frequency
ANALYSIS:
  - Cluster analysis on final DNA
  - ANOVA for species count

13. Glossary

Adaptive immunity

Learned resistance from surviving infection; strain-specific

Chemosense

Latent gene enabling enhanced resource detection (analogous to chemotaxis)

Closed System

Experimental mode disabling primordial emergence; population can go extinct

Crypsis

Latent gene providing camouflage/detection evasion

Deme

Local breeding population; standard term in population genetics (Wright, 1943)

Epistasis

Gene-gene interaction producing emergent phenotypes

Fecundity

Reproductive capacity; affects offspring probability

Hardiness

Innate pathogen resistance; contrasts with adaptive immunity

HGT

Horizontal Gene Transfer; genetic material moving between organisms outside reproduction

Hybridizer

Phenotype enabling mating across speciation barrier

K-Strategist

Phenotype emphasizing longevity and exploration over reproduction (r/K selection theory)

Motility

Movement velocity trait

Plasticity

Latent gene enabling phenotypic drift over lifespan

Senescence⁻

Latent gene reducing aging effects (negative senescence)

Sociality

Trait governing deme affinity and group joining behavior

Toxicosis

Latent gene enabling toxic defense against pathogens

14. Configuration Reference

CONFIG = {
    // World
    WORLD_WIDTH: 280,
    WORLD_HEIGHT: 200,
    
    // Population
    INITIAL_POPULATION: 25,
    MAX_POPULATION: 150,
    
    // Time
    TICK_INTERVAL: 120,
    TICKS_PER_SEASON: 80,
    
    // DNA
    GENOME_LENGTH: 64,
    MUTATION_RATE: 0.02,
    CROSSOVER_POINTS: 2,
    
    // Survival
    BASE_ENERGY: 80,
    MAX_ENERGY: 120,
    REPRODUCTION_THRESHOLD: 60,
    REPRODUCTION_COST: 30,
    ENERGY_DECAY: 0.25,
    
    // Resources
    RESOURCE_CLUSTERS: 6,
    RESOURCE_BASE_RICHNESS: 1.2,
    
    // Microorganisms
    MAX_MICROBES: 20,
    MICROBE_SPAWN_CHANCE: 0.003,
    
    // Social (Demes)
    DEME_DISTANCE: 18,
    DEME_MIN_SIZE: 3,
    
    // Predation
    PREDATION_ENABLED: true,
    PREDATION_ENERGY_TRANSFER: 0.4,
    
    // Speciation
    SPECIATION_ENABLED: true,
    SPECIATION_THRESHOLD: 20,
    
    // Environmental Zones
    BIOMES_ENABLED: true,
    
    // System Mode (v10)
    CLOSED_SYSTEM: false,
    
    // Research
    SEED: null,
    TIME_SERIES_INTERVAL: 10,
    GENE_POOL_INTERVAL: 100,
}