OpenClonk Bugtracker - OpenClonk
View Issue Details
0001698OpenClonkObjectspublic2016-03-03 15:152017-08-20 12:12
ReporterZapper 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version9.0Fixed in Version 
Summary0001698: New rule: population control
DescriptionIt would be cool to have a (self-contained) population control rule for animals that integrates smoothly with the current (and future) stuff.

I imagine it to work approximately like that:

* remember the number of each animal type on startup
* if the current amount of animals is lower, do the following:
    * call animal->Place(1)
    * check if the newborn animal can be seen by a player
    * if so, remove it and try again later
    * otherwise, let the animal live

This would not force us to make up new spawn rules for every animal (aka "Birds fly in from the sides", "Fishes swim in from the background"), which would be required so that players who observe a respawn are not pulled out of the immersion.

This would lead to animals having a higher chance to be spawned in placed where players do not frequently go. This is imo not necessarily a bad thing.

It would require minimal (if any) overhead, because animals need to implement a Place() function anyway.

The proposed solution would then be a very lightweight (in lines of code) solution.
TagsScript
Attached Files

Notes
(0005023)
Sven2   
2016-03-03 20:37   
This is already done in Deep Sea Mining. All non-piranha-fish usually end up in a corner (not sure if they spawn or swim there). It's probably better than nothing though.

Issue History
2016-03-03 15:15ZapperNew Issue
2016-03-03 20:37Sven2Note Added: 0005023
2017-08-08 15:37FulgenTag Attached: Script
2017-08-20 12:11ZapperTarget Version8.0 => 9.0