2,148 Commits over 822 Days - 0.11cph!
Merge from livestock_animals
Merge from livestock_animals
Make cpu affinity a warning instead of an error
Fix "death while running" anim never playing because speed was measured after stopping
Reduce the amount and size of comments in livestock fsm, instead move them to a separate document file
Fix agent velocity not always being accurate
Merge from livestock_hotfixes
Fix a few allocs caused by unconditionnal string.format, and a boxed action
Add a deterministic mode to NPCs for tests:
- one rng generator per npc, use it everywhere there is a random draw
- infinite budget and fixed time step during AI test
- fix warp causing an agent speed spike
- fix melee / voice sens lookups not checking their age
- fix tiger / croc / grenade using deltaTime instead of fsm time, or not respecting timescale
Prevent cows from picking destinations where they will clip with each other
Partial fix for cows not eating properly at trough or grass in a pen, full fix is a bit riskier and for next patch potentially
Fix broken livestock sleep test
Fix livestock age regressing when calf grows up into adult, and age being more and more incorrect over time because of the random variance
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