Increasing long term stability/Timeout for entities
Posted: Thu Apr 28, 2016 9:55 am
Short version: Many biters that have to be calculated decrease the performance of ANY computer/server over time depending on it's individual hardware setup.
This is not considered to be a new observation, it's just for clarity. The question is, what leads to those many (unneeded) biters. My observations on daniel34's server (viewtopic.php?f=53&t=20025) are the following:
1) Once a new and fresh map is started everything is fine related to performance (few chunks unveiled -> few biters to calculate). Just by playing new chunks are unveiled and more and more bases are affected (=they are getting activ, new biters are calculated). It's just like an empty red balloon. The radius of that ballon is increased while blowing in (polluted) air. An increased radius leads to an exponential touched surface of the outer boarders where the game routine of biters rallying up for attack kicks in (see Native Life https://wiki.factorio.com/index.php?title=Pollution). This is rather ok since it's the game mechanic and usually they would attack and get killed/vanish somehow or kill the polluters and decrease the spawning of themselves over time.
2) A major problem is related to the pathfinding if there is water inbetween. They get stuck on the coastal line (see https://imgur.com/mquhquG). Imagine this all over the map, where the way between the player/s and the biters are blocked. -> decrease in performance
3) Another idea are the many many bases that are unveilled but NOT touched by pollution. They produce their basic amount of biters that are idling most of the time without the ability to flow off at any time. Many unpoluted bases -> many "basic-idling" biter -> decrease in performance.
The last observation is not related to biters at all, but to entities on the ground like alien artefacts (in general: any uninstalled item on the floor) and it's just a guess, I haven't tested it so far. Many items on the ground could reduce the performance over time while they are not picked up?! On the previous map we had around 50k alien artefacts in chests and an estimated 150k lying around since we where to lazy at some point to pick them up because there was no need to.
Some possible solutions could be:
- Biter could time out and vanish after an acceptable amount of time (> their time they would need for a regular attack) to prevent them to rally up in blocked situations
- Biter bases(including the thought of vanishing) that are NOT touched by pollution only creates biter when a player is close inbetween n-chunks. (=inactive bases till the player get's close)
- (minor due untested) Items on the ground vanish after n-minutes, since they most likely never ever will be picked up (maybe after 1 hour? idk)
Both could be done either by giving every biter or items on the map an exclusive timestamp (entity created at playtime 1:30:45 -> vanish after n-minutes) or by pooling them up and make the pool as a total vanish after n-minutes, whatever is better to performance.
This is not considered to be a new observation, it's just for clarity. The question is, what leads to those many (unneeded) biters. My observations on daniel34's server (viewtopic.php?f=53&t=20025) are the following:
1) Once a new and fresh map is started everything is fine related to performance (few chunks unveiled -> few biters to calculate). Just by playing new chunks are unveiled and more and more bases are affected (=they are getting activ, new biters are calculated). It's just like an empty red balloon. The radius of that ballon is increased while blowing in (polluted) air. An increased radius leads to an exponential touched surface of the outer boarders where the game routine of biters rallying up for attack kicks in (see Native Life https://wiki.factorio.com/index.php?title=Pollution). This is rather ok since it's the game mechanic and usually they would attack and get killed/vanish somehow or kill the polluters and decrease the spawning of themselves over time.
2) A major problem is related to the pathfinding if there is water inbetween. They get stuck on the coastal line (see https://imgur.com/mquhquG). Imagine this all over the map, where the way between the player/s and the biters are blocked. -> decrease in performance
3) Another idea are the many many bases that are unveilled but NOT touched by pollution. They produce their basic amount of biters that are idling most of the time without the ability to flow off at any time. Many unpoluted bases -> many "basic-idling" biter -> decrease in performance.
The last observation is not related to biters at all, but to entities on the ground like alien artefacts (in general: any uninstalled item on the floor) and it's just a guess, I haven't tested it so far. Many items on the ground could reduce the performance over time while they are not picked up?! On the previous map we had around 50k alien artefacts in chests and an estimated 150k lying around since we where to lazy at some point to pick them up because there was no need to.
Some possible solutions could be:
- Biter could time out and vanish after an acceptable amount of time (> their time they would need for a regular attack) to prevent them to rally up in blocked situations
- Biter bases(including the thought of vanishing) that are NOT touched by pollution only creates biter when a player is close inbetween n-chunks. (=inactive bases till the player get's close)
- (minor due untested) Items on the ground vanish after n-minutes, since they most likely never ever will be picked up (maybe after 1 hour? idk)
Both could be done either by giving every biter or items on the map an exclusive timestamp (entity created at playtime 1:30:45 -> vanish after n-minutes) or by pooling them up and make the pool as a total vanish after n-minutes, whatever is better to performance.