Cohorta - what it is and what it is responsible for
Cohorta is a reusable population asset. The starting problem is simple, it is a world that needs people who live somewhere, work, eat, consume resources and respond to changing times, they are composed of various age groups, hold different beliefs and consider themself different group of people or consider themself belonging to various groups of population. The hardest part is making those systems consistent and prevention of tying them to one game map or other characters.
First thing I did was to audit the existing systems and planned features in the project and decided which system should own which fact and function and how they should be structured.
Cohorta owns population, its accounting and a development processes. It is configured demographic, economic and community processes. The game itself owns political control, combat outcomes and game specific rules and subsystems.
Segmentis supplies geography and procedural generation of world while hearsay is responsible for ai decision making and knowledge.
Such boundaries matter because two system should not independently decide the same facts, ff both an agent system and population simulation count the same person, the world would contain duplicates and if both navigation and population code advanced the same journey the people can move twice. It would cause desync, bugs and inconsistencies of game and its rules.
Because of it I made a choice to start simulation outside Unity. Cohorta libraries target .NET standard 2.1 and use C# UNITY 8 which unity can compile as package, but the simulation also runs in small console application and neither runtime assembly references UnityEngine, hearsay or segmentis.
Which lets me exercise the rules without loading a scene and village's population, should have the same results regardless whether it appears as a number in a terminal or in settlement on game map or in Unity systems.
At this stage it is audited workspace and a set of ownership decisions. It is not yet a living population nor village and integration with other system still require thoughtful implementation and communication layers.
