Body / Vehicle Cleanup
|Target version:||0.4||Estimated time:||2.00 hours|
When units and vehicles die, they should be removed from the battlefield after a set delay, after the total 'threshhold' number of dead units has been reached. Eg, after there are 20 dead infantrymen, once the 21st dies, the 1st one will be deleted after a 3 minute wait. This allows for a map setting to control how 'fast' the battlefield cleans itself up.
Updated by kju over 6 years ago
I would combine FIFO and delay different.
FIFO - once full first gets removed immediately.
At the same time give dead units a standard delay of x minutes
before getting removed.
So both system runs at the same time and how ever comes first,
does the job. Only need to make sure to keep the other system
- Essentially you want to have dead lying around for a while,
- Yet more importantly you want to avoid FPS issues.
- So as long as not too much lying around, they may do for a while,
yet once dead become too numerous, reduce/keep the numbers at bay.
Updated by TheCaptain over 6 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Body and unit removal implemented. When server is notified a player has deployed, it adds all units to an array of living units. Every two seconds or so, the server checks the living units to see if any have died. If they have, it adds them to an array of dead units, which is also checked every two seconds for being over the maximum. Once over the maximum, units are deleted after one minute. 'hideBody' appears not to work on the server for units that are/were local to a client, so deletevehicle is used instead. Units and vehicles are tracked separately by the implementation.
Currently the default values are 5 units dead for every player slot in the map, and 1 vehicle per slot.