v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Talk:Creature token

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Types?[edit]

There seem to be three types in use creature, Caste, or special. What does that mean? For example, why NAME is creature type but its DESCRIPTION is a Caste type. --Jan (talk) 16:25, 24 December 2022 (UTC)

Creature-level tokens apply to the whole creature, while caste-level tokens can be different for each caste. Special has to do with creature variations, these tokens act on some meta-level (before the others?) and decide how/which other tokens are loaded. --Voliol (talk) 00:49, 26 December 2022 (UTC)

So, caste-level tokens CAN be applied to the entire creature, but are also individually applicable to each caste. I think I was also misinterpreting the phrase "Caste-specific" in some of the notes. So yeah, that makes much more sense now. Qeveren (talk) 00:54, 26 December 2022 (UTC)

NO_EAT Token[edit]

According to this page, the creature token [NO_EAT] "seems to cause worldgen crashes if it is part of an entity with [PERMITTED_JOB:FISHERMAN]". However, the raws for version 50.11 appear to disagree. In creature_standard.txt, goblins have [NO_EAT], and in entity_default.txt, [ENTITY:EVIL] has [CREATURE:GOBLIN] and [PERMITTED_JOB:FISHERMAN]. Maybe the [NO_EAT] Token works here because goblins also have [BONECARN]? --Bigjetman (talk) 18:33, 7 February 2024 (UTC)

[LARGE_ROAMING] Pool biome bug.[edit]

Felt the need to mention it, as future modders might be unaware of it.

~Avenkyr Pakacit

Frequency token description[edit]

It seems to me that the first frequency token usage is not correct for this version (or any v53.X version for that matter). Ie. when initializing the variable total to zero and then iterating over all regions in df.global.world.world_data.regions and doing the following: 1. looping over all population entries in the region and if the type is an animal (or vermin) then looking at the corresponding creature raw (in df.global.world.raws.creatures.all), if it ie. has the flag "LARGE_ROAMING" set to true and if it is true, further checking whether it is also a LARGE_PREDATOR or not and if it is not a large predator (only a large roaming). Depending on the outcome, ie. if it is only a large roaming (but not a predator) then incrementing variable large_roaming for that region by one and if it is a large_predator incrementing the variable large_predator for that region instead by 1. 2. If the region is neiter evil or good and the sum of large_roaming and large_predator for that region is more than 14, then adding the difference to total (otherwise do nothing). 3. After finishing the iteration over all regions and then doing a small quick iteration over df.global.world.raws.creatures.all to determine, how many large roaming (without a predator) and how many large roaming (with large predator) there are. 4. Then, when comparing the value of total with the number of all large roaming and all large predators, I do (for all worlds looked at so far) end up with a result where the total (calculated in the region loop) is much higher then the total number of large roaming (and large predators) in the raws combined - eventhough for the region-loop I do not count good/evil regions but for the second loop (over the raws) I do count the corresponding animals (like unicorns) and even cavern only creatures, allthough they do not never appear in any above ground region.

Conclusion the first usage of frequency is no longer correct. Of course, I would do a few more checks, if the term "sub-region" is interpreted somewhat differently and ie. means that any region in df.global.world.world_data.regions corresponds to a number of sub-regions equal to the number of biomes in that region or even to the number of region tiles. But I guess such an interpretation of "sub-region" would need a little explanation as what the term really means in the explanation in the article itself.

ps. In the regions there were no UBIQUITOUS large roaming creatures (world with vanilla raws).91.49.245.123 18:43, 28 June 2026 (UTC)

If you're looking in DFHack, every entry in world.world_data.regions is a "subregion" (within DF's actual code, that list is named world.region.subregion). --Quietust (talk) 12:55, 29 June 2026 (UTC)
OK, thanks for the info. Then there is definitly something wrong with the frequency description (for the creature lists). But I will need more tests (and more elaborate lua-scripts).91.49.245.123 13:35, 29 June 2026 (UTC)
Now a preliminary result of my analysis is, that the original placement algorithm might be correct, but the sub-lists ie. vermin_grounder etc. are most certainly not correct (ie. the vermin_grounder sub-list is probably split, ie. in adultsize==1 and ones with bigger adult size or a split in hateable vermin_grounder and not hateable vermin grounder). It is also unclear, whether the ubitiquous effect is correct. Furthermore in all worlds analysed so far - including a certain world, which was uploaded to the dffd by someone else - Dingos, but also Dingo Man and Giant Dingos, are much more frequent (we are talking about an amount of regions, where one might think that Dingos, but in some cases also Dingo Man and Giant Dingos, do have the ubiquitous creature token) then the frequency value suggests, which seems to imply that it is deterministically always chosen the same creature (if only the distance to epicenter or nearness matters but nothing else) not yet in the sub-list, even if for more than creature the distance to epicenter or nearness is the same, so that randomly picking one of the creatures would probably be better, but then again having a percentage of 16% or more of all aboveground animal people populations being Dingo mans and Dingos appearing in almost all regions (where they are supported by biome) does has some charm of its own. I am probably ready to post a complete analysis in the next few days, but then I am currently hesitating to put it on the wiki, as the number of characters of that post might be 100,000 or more.
ps. There are currently some difficulties in computing the maximum number of biomes a creature can appear in in a given world, if the supported biomes contain any pools (as no region tiles will ever be considered to have a pool biome type).91.49.245.123 20:55, 29 June 2026 (UTC)
While it seems, that the (x,y)-coordinates of the epicenter for a creature, can not be easily found out (if it is stored anywhere). There usually is often one region for some creatures, which has not one, but two population entries for that creature. Also interestingly all four vermin_soil_colony creatures do have the same region (which has size==2) as epicenter (at least in one world) - not that such an elaborate algorithm (involving epicenters) might (at least currently) be unnecessary for placing the four vermin_soil_colony creatures in all regions, they can appear in, regardless of where the epicenter is. This might also point to a possible issue (in the algorithm) concerning the choosing of the epicenter locations for each creature. edit: it is not the epi center of animals, just one weird region per world, where all occuring animals (of that region) are added twice, the second time in the reverse order of first order, so that the first and last etc. are the same.91.49.245.123 11:26, 30 June 2026 (UTC)
If instead of the regions entries we do count the number of biomes (ie. the number of entries in biomet_tile_counts with non-zero entries) as the number of sub-regions (for which lists are created), then the numbers can possibly add up, ie. if a named region has region tiles with temperate conifer and temperate broadleaf, then there are two instances of the sub-lists created, with creatures, which are allowed in both or all biomes, not getting added another time (to the region.population), but if a creature is only allowed in some of the sub-lists of a type, then another creature is added to region.population (if any is found, which fits the requirements). It should be noted that especially ocean regions, forest regions and plains can have multiple biomes (ie. a forest biome can potentially have temperate confier, temperate broadleaf, tropical dry broadleaf, tropical wet broadleaf, tropical conifer, but presumably also taiga and mangroove, depending on how big the region is, and an ocean can contain arctic, temperate and tropical ocean tiles).91.49.245.123 13:52, 30 June 2026 (UTC)

Now even if we keep for each sub-region (aka named region) separate lists for each biome, then the numbers still do not add up, for vermin_grounder, for large roaming non-large_predators and also - to some degree - for large_predators. In the following a partly output of some lua-script as a table. The first line of each entry has 1. region-index, 2. name of the region type (here always Ocean), 3. the number of different biomes (number of entries in biome_tile_counts which are non-zero), 4. and 5. denote whether the region is good or evil, 6. (after the two semi-colons) we have, separated by a comma, the number of different vermin-grounders in the region, the number of large_predators and then the number of large_roaming non-large predators. And the last entry is the size of the region in world map tiles. After the first line we do have for each biome in the region the following: 1. an index donating the biome, 2. (after the ":") we do have the number of vermin_grounders, which appear in the region and are supported by the biome and do not have the savage flag, between "(" and ")" the number of savage vermin_grounders (in the region and suppored by the biome) is listed, 3. the same for large_roaming non-large-predators, 4. the number for the large_predators. 5. after the two semi-colons we have the maximum possible number for vermin_grounders supported by the biome (the number of savage ones are between "(" and ")") and then the same for large_roaming non-large_predators and lastly for large_predators.

0:Ocean, 3; false, false;;25, 23, 97;32789

28: 11; 58, 22;; 13 (0), 29 (30), 16 (7)

29: 17; 61, 20;; 19 (0), 30 (32), 14 (7)

30: 7; 59, 6;; 9 (0), 23 (37), 5 (2)

So the above means, the region-index is 0, the type is Ocean, the number of biomes is 3 (so arctic, temperate and tropical oceans), the region is neither good nor evil and 25 vermin_grounders, 23 large_predators and 97 other large_roaming creatures are in the region, which has 32789 map tiles big. Furthermore one biome has 11 supported vermin_grounders, 58 large_roaming (which are non-large predators) and 22 large_predators, where the maximum number of supported vermin_grounders is 13 (and 0 savage vermin_grounders), maximum number of large_roaming non-large predators is 29 (and 30 savage large_roaming), furthermore a maximum of 16 large_predators (and an additonal 7 savage large predators) are supported by that biome.

Now the other oceans in the world have the following numbers: 510:Ocean, 1; false, false;;5, 7, 8;304

29: 5; 8, 7;; 19 (0), 30 (32), 14 (7)

692:Ocean, 2; false, false;;7, 7, 14;578

28: 5; 13, 6;; 13 (0), 29 (30), 16 (7)

29: 4; 11, 5;; 19 (0), 30 (32), 14 (7)

751:Ocean, 2; false, false;;5, 7, 9;157

28: 4; 8, 6;; 13 (0), 29 (30), 16 (7)

29: 2; 6, 4;; 19 (0), 30 (32), 14 (7)

1284:Ocean, 1; false, false;;3, 7, 8;260

28: 3; 8, 7;; 13 (0), 29 (30), 16 (7)

1358:Ocean, 1; false, false;;3, 7, 7;266

28: 3; 7, 7;; 13 (0), 29 (30), 16 (7)

1895:Ocean, 1; false, false;;2, 7, 7;156

29: 2; 7, 7;; 19 (0), 30 (32), 14 (7)

Now the world was created with real_world_extinct = 4 and has a 100 year history.

The maximum number of different vermin grounders, which are supported by any ocean biome, are 27 (0) (savage number between "(" and ")"). For large_roaming non-large_predators the numbers are 47 (51) and for predators it is 17 (7).

Comparing these numbers with the first ocean, we see that already 25 of 27 vermin grounders, 97 of 98 large_roaming non-large_predators and 23 of 24 large_predators appear in the first ocean. So we must assume, that the epicenter of nearly all vermin_grounders, large_predators and large_roaming, non-large predator creatures is somewhere in the region with index 0. But then some of these creatures, can also appear in non-ocean biomes. But if we now look at the other ocean regions, it seems that the epicenter of at least two large_roaming non-large_predators are in some other ocean (with region-index 510 and region index 1284).

Also the vermin_grounder values for the oceans are usually lower than 7 (even the ones with multiple biomes in the region), so this implies that to the sub-list for vermin_grounder are not necessarily - if the inital placement yields less than 7 in the vermin_grounder sub-list - added vermin_grounder (which can appear in one of the corresponding biomes of the region), until the sub-list has seven entries.

Something similiar, allthough not in that extreme (with one big ocean having about all creatures), can be seen for most region types.

Only for regions with size one (and thus with exactly one biome, discounting pool biomes and river biomes) and for regions, which are Mountains, Glacier or Tundra, the numbers might add up, but then again for vermin_soil and vermin_soil_colony the numbers always add up (due to the low numbers of vermin_soil and vermin_soil_colony vermin).

So in conclusion the placement algorithm for creatures presented in the frequency description is no longer correct. But what now is the case, is open/unknown. Still the used placement algorithm for creatures, especially large predators, usually result in some creatures being very, very common, which interestingly is about always the Dingo (and its variations) and some creatures, whith a high frequency value (if they belong to the vermin_grounder or are large_roaming non-large_predators), might appear in a few regions.

ps. If everything is as intended, is for Toady to decide. pps. I end my analysis, allthough probably premature, with this post.91.49.245.123 16:47, 1 July 2026 (UTC)