Opened 11 years ago
Last modified 5 years ago
#1973 new enhancement
[PATCH] Regenerative resources — at Initial Version
Reported by: | alpha123 | Owned by: | alpha123 |
---|---|---|---|
Priority: | Should Have | Milestone: | Work In Progress |
Component: | Simulation | Keywords: | patch design |
Cc: | Patch: |
Description
Some resources such as berries and fish should regenerate food so as to be more viable long-term food sources. This patch implements an extension to ResourceSupply.js to allow for regenerative resources and modifies the fish and berry templates.
A resource will start regenerating several seconds (controllable in the template) after its number of gatherers reaches 0. After that it regenerates at either a linear rate or using a population growth formula. Currently the way the formula works is that if you overfish and the amount of resources reaches 0, it will not regenerate. I couldn't tell if that was a bug or a feature, so I left it. ;P If it is a feature the fish should be removed from the map (currently regenerative resources are never removed).
Techs are supported, but in a rather unusual way: since the player is researching techs that apply to entities they don't own (gaia does) I had to implement it in a slightly roundabout way (thanks to leper on IRC). Basically, regenerative entities apply the techs of whatever player's territory they are currently in. This works fine for fruit, but not for fish since they won't usually be in anyone's territory. There are two tech modifiers: ResourceSupply/Regeneration/Rate and ResourceSupply/Regeneration/Delay.