2,134 Commits over 822 Days - 0.11cph!
Increase livestock lead break distance from 7 to 15m, show familiarity and gender by default
Rework livestock personal space
- free range cows stop reproducing even if fully bonded when herd reach a cap
- indoor / pen cows, navmesh flood fill to get their exact area in m2, and derive the need directly off that, so that all cows shows the same thing and it's stable / reacts directly to players doing building changes (it's also cheaper that what we are doing now, as we don't need to re-query just check the cache)
- this gives fast feedback and stays stable over time, so players get a better idea of if something they are doing is working or not
Make cows actually line up with troughs to eat + play the correct animation
Make a system so that we can align any animal with props without turn in place (maybe handy for cars mounting/unmounting?)
Optimize path following further following Daniel's leads:
- support full batching, serial path no longer needed even if some NPCs can swim or open doors, move requests are queued for next batch
- better use of unity's TransformAccessArray to avoid native overhead (don't set to null, do not re-build every batch instead persistent w stable identities)
- iterate forward instead of backward (ListHashSet is slower backward, + has RemoveUnordered so iterating backward to delete is not really needed)
- skip IsUnityNull checks that's no longer needed
Cows outside of navmesh kill themselves like other AIs
Fix blue particles when shearing sheep
Merge from livestock_hotfixes
Fix broken test, fix cow unfreezing its needs / aging when bonded not being saved
Merged to main > Fix livestock breeding out of control in the wild:
- Full bond is now 15min not 5min, reproduction can't happen before (can still lead from 5min like before)
- Curious cows don't bond twice as fast anymore
- If a calf is born in the wild somehow, it will age as soon as it's born, and won't be able to reproduce (eg won't be born bonded like the mom)
- Server cap on livestock population of 300 "livestock.maxPerSpecies"
- Command to kill off excess livestock, prioritizing not tame > far from TCs > bad genes / old to avoid hurting farms, "livestock.cullexcess"
- Add "livestock.breedOnlyAtHome" convar, 0 by default, 1 means livestock can only breed near their top bonded player TC
Hook sheep shaving vfx, and tint vfx properly
Reduce livestock clipping when leading multiple, and at trough
Fix livestock attacking players in vehicles
Fix lamb and calf colliding with travelling vendor
- fix bull still sometimes spamming headbutting on unreachable players
- fix bull sometimes stopping entirely and getting stuck when charging a close player
- fix rams not aiming their headbutt and charging in random directions
- fix rams using the wrong stomp anim
- fix procedural look at not being enabled for most anims, which looks off especially with stomp being aimed at the void instead of the target
Potential fix for cows sliding (suspected pregnant flag)
Prevent livestock in safe zones from being damaged
Fix garage doors blocking navmesh above them when closed
Rebalance how much food livestock needs (stomped Jarry halving the amount with a previous fix)
Prevent wild livestock from dying from hunger etc
Prevent wild livestock from dying from unmet needs (floor to 50% hp)
Fix wild livestock being passively tamed and then breeding out of control
Decay livestock taming if not full bond, don't allow sleepers to tame passively, give calves a start bonus to familiarity but don't max it out.
This is to avoid wild cows being accidentally tamed by passer bys and starting to breed and fill the server.
Potential fix for animals not eating from troughs
Potential fix for cows dying of hunger in a well setup farm
Fix lead breaking easily, show sheep genes, fix tests
Fix failing tests, some setups were fragile / incorrect, one regression now fixed
Show genes on sheep only (didn't have time to make them show up in appearance)
Make livestock match the player speed when being led, avoid annoying lead breaks / having to wait for them all the time
Fix floating animals, improve idle performance
Fix look rotation viewing vector zero when bull loses its target mid observe
FIx weird animal behaviours around food, and disable food sensing for all animals and critters that don't need it
Makes livestock docile in safezones to prevent griefing, make npc livestock buyer react properly if livestock dies / flees during conversation
Prevent cows grazing on ice / sand
Streamline NPC team system, merges the competing systems into one
Fix junkpiles not rebuilding their navmesh tiles on spawn / despawn
Fix navmesh not building properly on player roofs / conditional roof models
Fix navmesh building on top of player boats
Fix navmesh not baking properly graveyard fence and frontier bar doors
- Fix livestock and old animals going underwater
- Fix bull stuck forever in charge mode when you move to its side
- Fix bull trying to headbutt even if target is unreachable
- Fix curious cow being so curious it lets itself starve
- Reduce bull damage
- Livestock leads now behave more like horse leads, slows down the player and break around 7m
- Fix cow sometimes snapping back to idle after a graze instead of playing the exit anim
Fix TestSheepShearing.BlowBesideWool_ShearsRatherThanCuts being broken after shearing changes
Update rust native libs for all platforms
- Move navmesh save to background thread (260ms -> 0.8ms for large map)
- Instead of re-saving all tiles, append only dirty tiles at end of save, and only do a full resave when the size cap is blown