caveman2cosmos / Caveman2Cosmos

The most expansive mod for Civilization IV: Beyond the Sword.
https://forums.civfanatics.com/forums/civ4-caveman-2-cosmos.449
59 stars 46 forks source link

Assert: plot improvement progress < 0 #290

Open billw2012 opened 4 years ago

billw2012 commented 4 years ago

IMPROVEMENT_DEPLETED_MINE has negative progress per turn?

raxo2222 commented 4 years ago

Yes, because its part of "Resource Depletion " (BUG option) mechanic - when resource runs out mine gets replaced with depleted mine. Those progresses can be set to 0 though, as mines usually have much more commerce and production.

Toffer90 commented 4 years ago

I believe the logic behind negative yield values there is that it is hard to use the plot efficiently when there's a large unusable mining complex there, thus a plot without a depleted mine would be more fruitful than one with a depleted mine. Though I wonder what the point of a depleted mine improvement is to begin with, we can have mines on plots without resources, It would be strange to have to replace the depleted mine with a mine after the bonus is used up.

Though some plots, like flatland, only allow the mine improvement to be built there if there's a bonus there that can be extracted by a mine. So I guess it only makes sense for such plots as a regular mine would no longer be valid for a flatland plot when the resource is depleted. In that case I think automatic removal of the mine might be a more rational way to go than replacing it with a useless depleted mine improvement.

raxo2222 commented 4 years ago

So depleted mine can be deleted them

raxo2222 commented 4 years ago

It looks like this improvement is referenced in cpp too

Toffer90 commented 4 years ago

It is, it is dll code that places the improvement on a depleted mine. As for removing it, would need to tweak the code to remove the mine after resource depletion if the mine is not valid for the plot anymore instead of replacing it with a depleted mine. I can investigate it further, but it should wait in a PR untill after v40.1 release.

Toffer90 commented 4 years ago

Actually, I see several small improvements that can be made to the resource depletion mechanic. There are some oversights and over-complications in its code.

Toffer90 commented 4 years ago

The RESOURCE_DEPLETION option actually can deplete a mine on a plot without a bonus too, marking the hill/peak plot as permanently depleted and thus making it impossible to ever build a new mine there. Mines are the only improvement that can become 100% depleted on a plot, quarries for example never deplete completely like that.

Question is, do we want the resource depletion option to not only remove bonuses from the map, but also remove the ability to build a mine on a plot permanently too.

Just to be clear: If there's a bonus then the mine will not do a depletion random roll, but the bonus will potentially removing the bonus, when there's no bonus then the mine will do a random roll each turn to completely deplete the plot and place a depleted mine imp on the plot, it will then never be possible to build another mine there for any player ever again. (I think this may confuse players that there are hills around where it's not possible to build mines) Mines have the ability to discover bonuses, but the depletion mechanic can make it so that you won't be able to have a mine on the plot that can discover a new bonus for you there.