Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Animal Population Modding Science  (Read 668 times)

blapnk

  • Bay Watcher
    • View Profile
Animal Population Modding Science
« on: September 08, 2017, 03:27:54 pm »

I wanted to test some of the exact mechanics of how animal populations are spawned in the world, how they arrive at your fortress, and check some of the speculation I've only been able to find in old forum posts based on previous versions.

Basic set up: All creatures removed except Dwarves, Elves, Humans, Kobolds, Goblins, and Horses (Modded to not appear in the wild). No megabeast, no titans, and a world designed to create small isolated pockets of temperate grassland in a sea of shrubland and savanna. An empty world

Experiment 1
20 creatures, copied from a llama, with [BIOME:GRASSLAND_TEMPERATE] [POPULATION_NUMBER:1000:1000] [FREQUENCY:100]. Named CREATURE_GRASSLAND_TEMPERATE_00 to CREATURE_GRASSLAND_TEMPERATE_20

Site 1

This is pretty much what I was expecting. I wanted to check that a specific biome will only populate with a certain number of creatures. In this case, it's picked seven out of twenty creatures from the pool of available creatures. The population of 1117 is roughly what I'd expect, it's not exactly 1000 but they're all the same. I kill several of the creatures with dfhack to confirm that only those seven reported from region-pops list-all arrive on the map.

Site 2

This is the second site and it sure has thrown a curve ball! We have 19 out of the 20 available creatures (05 confirmed to exist elsewhere in the world so it's not a bugged creature). Killing them with dfhack confirms all the creatures listed will enter the map. And there are only 28 of each species listed despite a POPULATION_NUMBER of 1000. I didn't have the patience to see if I could bring any to extinction so I cheated a little and decimated every population except for CREATURE_GRASSLAND_TEMPERATE_00 using the command region-pops boost <token> 0.01. This did cause only CREATURE_GRASSLAND_TEMPERATE_00 to show up on the map until they too stopped entering the map even though region-pops listed a few survivors out there. The Field of Excavation is an exceptionally large region that contains very little grassland, my first speculation is that each subregion will generate their own list of creatures which are shared with the whole region and then divided by the percentage that biome makes of the region as a whole.

Site 3

This time we have 11 different species and only 42 of each. The Bright Hills is a much smaller region than Site 2 and probably a higher proportion of grassland to non-grassland. Either way, I cannot understand why there are such low numbers.

Some incidental proof that there is a limit to the number of species types that will spawn in a particular location is the overall world population numbers. Despite all creatures having the same biome token and an exact [POPULATION_NUMBER:1000:1000] there is plenty of variation in overall numbers. They are definitely been spawned in units of 1000 and must be then distributed across the world map in some way. It's likely that each subregion or biome or world map tile, something, picks a certain group of creatures out of the possible selection and then spawns 1000 of them.

[spoiler:world population]
1. Grassland Creature 17: 90000
2. Grassland Creature 03: 89000
3. Grassland Creature 20: 86000
4. Grassland Creature 06: 86000
5. Grassland Creature 19: 82000
6. Grassland Creature 16: 81000
7. Grassland Creature 12: 73000
8. Grassland Creature 10: 70000
9. Grassland Creature 04: 69000
10. Grassland Creature 18: 65000
11. Grassland Creature 08: 61000
12. Grassland Creature 05: 61000
13. Grassland Creature 14: 53000
14. Grassland Creature 13: 53000
15. Grassland Creature 09: 53000
16. Grassland Creature 07: 53000
17. Grassland Creature 02: 53000
18. Grassland Creature 01: 53000
19. Grassland Creature 15: 52000
20. Grassland Creature 0: 52000
21. Grassland Creature 11: 51000[/spoiler]

Experiment 2: Confirming a maximum of 7 creatures per spawnpoint

Reducing the number of potential creatures to 8 gives almost identical world populations of 19000, except for creature 6 (13000) and creature 0 (6000) which together add up to 19000


Reducing the number further down to 7 creatures and all populations are exactly the same with no variation. Repeating the experiment for the mountain biome came up with the same number 7, other biome may still be different.


Further experiments show large creatures with the [UBIQUITOUS] tag still count to the limit but vermin do not (they may have similar limits within their own catagory).




Further testing seems to show that [FREQUENCY] does not have an effect on overall world populations even having to select from more than 7 creatures (tested by giving creature 8 [FREQUENCY:1], still showed up in large numbers in the world population). Using just two creatures, giving one [FREQUENCY:1] will still list them as having the exact same number in region-pops list-all.

Giving creature 0 [FREQUENCY:1] [POPULATION_NUMBER:1000:1000] and creature 1 [FREQUENCY:100] [POPULATION_NUMBER:1:1] would cause creature 1 to Always appear first onto the map with creature 0 only appearing after creature 1 has been killed. This could be used to create a horrible menace that only appears if you manage to drive the mundane creatures to extinction (note, need to check the behavior of [FREQUENCY:0]

Giving creature 0 [POPULATION_NUMBER:1000:1000][FREQUENCY:100] and creature 1 [POPULATION_NUMBER:250:250][FREQUENCY:100] still meant that both creatures had the same chance to appear on the map. At least until creature 1 was driven away after 15 kills and creature 0 was driven away after 35 kills. Note that region-pops list-all still showed some population left somewhere. Note also that despite [POPULATION_NUMBER:1000:1000] was still possible exhaust the local animal population. I am still not sure what causes this and don't want to add too much speculation but these are creatures exclusive to a specific biome which isolated and surrounded by other biomes. A long term fort in such a case might be interesting to see if the animals return.

In the future, I want to perform some similar experiments on the cavern regions

I don't know what to conclude from these yet or full understand what they mean for modding, but they're sure to have an effect on mods that add a lot of creature or do something special with wild animal populations. I'm sure some of this is already know, I've read enough unconfirmed speculation but I haven't been able to find enough solid information myself
Logged