Badassanimal Tag

Started by Valor, July 08, 2018, 02:52:13 PM

Previous topic - Next topic

Valor

Hello,

I am wondering how exactly does <li>BadassAnimal</li> work in terms of  carnivore hunting. My rough estimate is that it doubles animal Bodysize for purpose of being hunted, but I could not find any reasonable explanation anywhere.

Thank you!


Karthas077

BadassAnimal is just a tag applied to certain animals that allows the game to determine if an NPC will trade it. It has no mechanics relating to hunting/being hunted whatsoever.

Valor

Very well and what does determine if animal gets hunted or not? For examaple how does the game know that boomalopes are not to be hunted?

Karthas077

#3
FoodUtility.cs checks a combination of "canBePredatorPrey", "maxPreyBodySize", and prey.kindDef.combatPower to determine if it's a valid hunting target.

Edit: Apparently the program I was using to search the contents of the XML files couldn't find canBePredatorPrey in any of them, but that flag is set to false for boomalopes.

Valor

Thanks!
Few more questions:
How do younger life stages fit into the formula? Do non-adult animals have reduced combat power? If so by how much?
How is the bodysize of prey utilized in the formula? Is just simple comparison to "maxPreyBodySize"? Or something more convoluted?

Karthas077

LifeStages.xml gives details about how bodySize is affected by age. Combat power is not directly affected by age, but bodySize does affect health. maxPreyBodySize is a binary check limiting the maximum size of an animal that predator will hunt (If it's greater than that size, isAcceptablePreyFor() immediately returns false). The last thing the utility checks is the relative fitness of the potential prey vs itself (taking into account both combatPower and SummaryHealthPercent). A simplified version of the formula is approximately: is the predator's combatPower*health at least 85% of the potential prey's combatPower*health.