Disease transmission, epidemic spread, quarantine mechanics, immunity tracking, and population-level infection modelling.
Disease modelling is entity-level: each entity carries an activeDiseases array and an immunity record. Spread is computed pair-by-pair using proximity and transmission route. A full population simulation is driven by the host iterating over entity pairs each tick.
Entity lifecycle for the selected disease. Width proportional to duration.
Illustrative day-by-day infection spread in a population of 100 entities. Based on common_fever parameters with ~50% close-contact pairs per day.
Define a custom disease profile and save it to localStorage, download it as a TypeScript snippet, or import one from JSON. To add it to the codebase, export the snippet and open a pull request.
To add a custom disease to the codebase: download the .ts snippet, add it to src/sim/disease.ts, write a test in test/sim/disease.test.ts, then open a pull request ↗ with the title feat: add [NAME] disease profile.
exposeToDisease(entity, 'common_fever'). Returns true if exposure succeeded (not immune, not already infected).stepDiseaseForEntity(entity, delta_s, worldSeed, tick). Returns events (onset, death, recovery).spreadDisease(entityMap, pairs, worldSeed, tick) per tick with an array of entity-pair objects.MARSH_FEVER for vector-borne disease (triggered by MUSTARD_GAS-style hazard zone with diseaseExposureId).