Aug 29, 2016

Dynamic weather system

Ohai. I've been working on a weather system. It's just a proof of concept right now. There's still lots of values needed to be tweaked and tested and the event itself still need some more optimization before pushing it into the main build. Lots of math involved here, but the way it works is something like this, for every 60 frames or every second, a value will be randomly added or subtracted to what I call a rain threshold. When the rain threshold exceed a certain value (and increasing threshold level), the game will start calculating a rain chance. If the rain chance doesn't proc, the rain threshold will keep increasing or decreasing until it reaches another threshold level. The higher the rain threshold, the heavier the rain will be and the longer it'll continue to rain. If and when the rain chance procs, it'll start raining, and the rain threshold will start decreasing at a random value. If the rain proc'd at threshold level 4 for example, it'll keep decreasing and when it reaches level 3, the rain will grow lighter and lighter. Once it goes down below threshold level 1, there's another chance for it to stop immediately or until the rain threshold reaches 0.

This means that the rain value and rain chance is almost completely RNG based and fully dynamic. Since it calculates every 60 frames, save scumming will either be a hindrance or a benefit to you. And as I said, it's still a proof of concept. I still need to tweak the values so it doesn't either rain too quickly, rain chance proc too consistently or whatever. I also need to work thunderstorms, cloudy weather and fog into this system. So there's still lots of math involved.

Are there any other kinds of weather you'd like to see? Maybe an extremely sunny weather? That'll probably work well during the summer. But yeah, lemme know if there's any other kinds of weather you'd like to see in the comments! (Oh also, I disabled anonymous comments until the character submissions event is over to prevent spam. Check that out if you haven't yet.)

No comments:

Post a Comment