Aggression and Performance Issues

This weekend, I implemented an algorithm to incentivize tribal and unorganized band migration due to aggression, so that more aggressive tribes/bands feel a higher pressure to invade lands occupied by more passive ones. Though I quickly ran into performance problems. Taking into account the aggression preference of each involved party to calculate migration pressure made every cell update 10 times slower than it used to be. To tackle this problem I started working on some performance improvements by making some basic code changes and applying some algorithmic shortcuts.

So far, it looks like the performance improvements might work. The new migration pressure function is faster than even the original one that didn't take into account tribal aggression. The downsize is that the resulting migratory behavior looks more chaotic. Inner "burst" migrations are now happening much much frequently than outward expansion migrations. This is not necessarily unrealistic. But it really drags the simulation down and makes it way less interesting to look at. So I will need to spend a couple of weekends tweaking the migration pressure algorithm to curb the undesired migratory behavior and get it back to what it was.

Get Worlds - History Simulator

Download NowName your own price


Log in with to leave a comment.


Very nice.
I only recently discovered the game, so maybe this is a dumb idea, but could there be "contested" or "mixed" territories ? What I mean is that when a territory changes owners, it takes some time to change the local population to the new ruler's culture. During this time, the territory would be in a intermediate state.
This could make the transitions more fluid after a burst, maybe ?
I'm not an expert on how the simulation run, so I might not realize how hard it is to make or if it would resolve the problem.


At this point, territories are not 'politically' defined. Instead, each cell on the map is assigned to the territory of the tribe who has more 'prominence' on it (where prominence is just a percentage of population that has allegiance to the same tribe). Prominence is gained or lost through demographic changes and acculturation.

That said, my intention is that, as tribes become more politically complex and new forms of government appear, then territories will start to become less fluid and they will no longer change hands simply due to demographic changes. In this sense, tribes might need to start laying claims in order to acquire new lands, and these claims might overlap with competing claims. Though there will always be a polity or tribe who has de-facto control over a piece of land regardless of how many claims exist over it. But, like I said, I will need to work on more advanced forms of governance before I can add territorial claims.


Oh I think I understand.

Concerning your intentions, this would make the chaotic behaviour of the tribes an interesting transition before a more complex form of government, so the simulation will become interesting after that. It's very interesting and I can't wait to see more, thank you for your answer ! :3