Real Bug Evolution


Biologically accurate evolution of bugs, they can evolve to build new nests, gather armies, smarter behavior, grow into higher tiers.

Content
7 days ago
2.0
83
Combat Enemies
Owner:
DjSapsan
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
9 days ago
Latest Version:
1.0.1 (7 days ago)
Factorio version:
2.0
Downloaded by:
83 users

Bugs that actually evolve. Every nest has its own genome and produce waves of bugs, most with mutations. Over time they learn to build new nests, gather armies, behave smarter and move up to higher tiers. The most important part: the bugs are HIGHLY ANNOYING.

Best played on a DEATH WORLD. Be ready for bugs to attack non-stop from the start, but they usually stay at their weakest form for a long while, so you have time to get your defenses up before they evolve into something worse.

Easiest way to deal at the start is to create a circle of defense around polluted areas and with constant supply of ammo. Basic ammo will defend you forever, just need a constant supply... unless higher tiers evolve!

Major Features:
- Every biter and spitter carries a genome: a program of genes for an 8-bit stack machine that decides what it senses, where it goes, what it attacks and when it builds. It thinks once per second, 128 instructions per think (16 for bugs of a nest with no pollution in its chunk).
- Nests are queens: each holds a master genome and spawns mutated copies of it (point changes, inserts, deletes, gene duplication, creation, deletion, merge, split, shuffle). New map setting: mutation rate multiplier.
- Lineages: a nest and every nest its bugs found share one food pool. Bugs feed it by killing anything (its max HP) and a player (10 000), a player who dies of anything else feeds the lineage of the nearest nest. Polluted nests feed their lineage log(pollution) per second, and every lineage eats 1 food per second. A lineage with neither nests nor bugs left goes extinct.
- BUILD (opcode 67): an even value turns the bug into a new nest for 100 food, replacing nests it overlaps, without food the lineage's oldest nest is removed instead (never its last). Half the time it first mixes genes with the nest nearest to a random point within 100 tiles, and such a nest founds a new lineage. An odd value builds a worm of the bug's tier on a 3-tile grid, the bug survives and the worm's kills feed its lineage.
- Development at birth: higher tiers (GROW), biter or spitter (FORM), and armor (ARMOR: 10-100% resistance against one damage type), granted while the lineage's pool holds their cost and delaying the next spawn as much.
Features:
- Instructions: math and logic, memory (a gene is its own RAM and can rewrite itself), gene calls, absolute and relative jumps (81-86, excess-128 offsets that survive inserts and deletes around them).
- Senses: HP, food, age, tier, local pollution, darkness, group size, the result of the last command (DONE), lineage alarm (ALARM: a nest was damaged in the last 5 seconds), and directions to allies, enemies, buildings, turrets, players, home and the most polluted nearby chunk, plus own position.
- WHO (78): whether the focus is nothing, neutral, an enemy, another lineage or its own. WHAT (79): the focus's group (logistics, production, combat, enemies, environment, ...). PICK (80): focus on the object at any point.
- Actions: every unit command (go to, move exactly, attack, attack area, flee, wander, stop), unit groups that act as one organism (only the leader thinks), AI settings, METAB (its own instruction budget per think).
- No gene is special: a bug starts at gene 0, any gene calls any other, running off a gene's end loops it, and return with no caller ends the think. New random genes end with return.
- Bugs start dying of old age after 10 minutes, losing 16 health per second, so higher tiers live longer.
- Vanilla spawning, expansion and attack groups are replaced: nests spawn evolution-0 bugs below the pop cap, and existing biters and spitters are adopted by the nearest nest. The evolution factor and enemy map settings other than base frequency and size are ignored.
- Settings: bugs per nest, bugs moving at once (1000, further moves are refused), mutation rate multiplier.
- Bug debug shortcut: counts of bugs, nests and lineages, expand a lineage, select a bug to highlight it and see its DNA.
Optimizations:
- Genes are compiled to Lua functions, slow world queries are cached per chunk and run at most once per think, at most one nest is built per 10 ticks world-wide, compact storage keeps saves small.