Animal spawn config should be per-animal instead of per-interface
nthSonata opened this issue ยท 2 comments
I was looking through the animal code the other day, and noticed a number of inconsistencies. Pheasants implement ILivestock
, which means they cannot respawn, and should probably be huntable instead (this is likely due to copying the code from chicken). Initial spawning rarity (but not respawning, which is handled in worldgen) is set directly on every animal entity, but I feel it would be better to set it in the animal type interfaces, as all animals except wolves and ocelots (and technically pheasants due to the above bug) use the correct spawn rarity for their type (wolves and ocelots can still have it easily overridden). Also, since there are now two "tameable"/"pet" animals which hunt other animals (wolves and ocelots), you could maybe create a new interface to share between them instead of making them special exceptions to rules like spawning and interaction (and possibly make adding new similar animals easier). Alpaca are intended to be the "colder" variant for sheep, however, unlike sheep, they do not drop sheepskin upon being killed (this may very well be intentional, I just wanted to check). Lastly, polar bears currently use the default food of grain, unlike other predators, which use meat and/or fish (though I'm not sure if this affects anything at the moment, as you cannot feed predators).
- TFC Version: 1.0.6.133
Yeah, answers:
- Pheasants being
ILivestock
is my mistake on some copy-paste, sorry - The spawn rarity thing is intentional, the interface is there to be used not only in base TFC but also by addons which can handle their spawn any way they like it. It just so happens that our config is already very big and could very much have a little cleanup / separate the config file in other parts, then we could make every animal spawn rarity configurable.
- Now the thing about wolves and ocelots hunting some animals should be carefully designed, probably config/json I guess, because interfaces / enum would be a limit to interactions and potentially open some weirdness (a big herbivore being hunt by a lone wolf?)
- Predators are not affected by food currently, at least until someone code a way to give food to predators so they will let you live for a little time ๐