Skip to content

Instantly share code, notes, and snippets.

@zekoz
Created August 23, 2018 20:26
Show Gist options
  • Save zekoz/ce285b5bb3c09eb7b869910242c1b60f to your computer and use it in GitHub Desktop.
Save zekoz/ce285b5bb3c09eb7b869910242c1b60f to your computer and use it in GitHub Desktop.
Three state variables control climate change for each change type: current, accum, and level. At game start, current and
accum are set to 0, and level is set to map_size/500.
At each turn, current is set equal to the number of tiles that have the appropriate environmental upset effect. Accum has
current added to it and level subtracted, clipped to zero. Climate change occurs at probability 20*accum/map_size,
at which point level is incremented by map_size/1000. Accum * 5 tiles are transformed, preferring to make wet tiles wetter
and dry tiles drier.
The most simple place to put a scaling setting for climate change would be a multiplier for current. The client display
of climate change would still read correct rate and chance. An alternative way to adjust would be to initialize level to
a higher value at game start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment