Dynamic weather!

#1
Hello,

I'm currently learning C++ and I would like to create a dynamic weather system in cryengine.
I would like to know if it 's possible to modify "the time of day" options (skybox, fog, light intensity,...) using C++ and if yes how hard is it ?
Like randomly switching the normal parameters to a "rainy template" and return to normal after 3 or 4 mins.


Thanks and sorry for my english !

Re: Dynamic weather!

#2
It is most certainly possible. It has been done in the past and even as a tool for others (https://www.cryengine.com/news/communit ... her-system).
However you might want to do it all yourself and burn yourself out before making any content for your game. To quote Ruan from the community forum archive:
Snow and rain are just a a combination of particle effects and material settings, all of which can be changed at runtime. New time of day files can also be loaded during gameplay, so yes, dynamic weather is completely possible.
For dynamically changing lighting, you'll want to look at this post: https://www.cryengine.com/community_arc ... 3&t=106366
Basically, I have found that the documentation is still quite sparse and the best way to learn how to do something is either to see how those noobs at Unreal do it (with their fancy tutorials) and then work backwards and tinker in CRYENGINE, or look at someone who already did it and pick apart their code (in this case code for CryEngine 3.# and how they programmed their flow nodes to do just the stuff you need. The code can't be too different from CRYENGINE V, right? lol).
You should look for both the dynamic lighting and the material changes (when it is wet).

If someone else has a better solution (as in the actual code we should spelunker in and the professional way to do it), I implore you to answer.

Re: Dynamic weather!

#3
Alright thank you for your answer. It helps a lot.
As you said, we could save Time of day presets so I guess it's quite easy to load a Rainy preset, etc
But, the problem is that most of the forum posts about the dynamic weather tool for CE3 are no longer availaible. So indeed, I should try to look at how people do this with other Engine.
Other than that, do you think I could load a preset but slowly? In other words, to create a transition between 2 presets?

Thank you!

Re: Dynamic weather!

#4
You mean like a blendspace for lighting, particles, and materials? Sure, why not?
I would make a function that changes the number of particles (rain, snow, fog), lighting (darkened by rainclouds), and possibly materials (wet clothes drying up) that takes in two weather states (or even just the final weather state) and a blend time. You shouldn't have too many types of weather, but if you do (say an infinite amount), then you should be able to just have that blend function take the individual inputs (final particle number, lighting, material dryness, etc) and slowly add or subtract to them until you reach the final particle number/lighting/intensity/whatever. You might also want a blend type to define if you want the change to be exponential, log, linear, ramp, or whatever.
I would also keep to just a handful of weather patterns to keep things simple. To do this, I would make another "presets" function that simply takes a string or integer (whatever you want) and have a couple if or case statements to define your specially crafted weather types by calling the original blend function with your predefined inputs. It all sounds nice writing it out like this, but a thunderstorm without lightning is weak, and clothes that dry immediately when it is sunny (or when your clothes are wet inside somewhere because it is raining outside) is kinda weak also, so the little things may take quite a bit of time to hash out.

In all honesty, I would have a separate method/function for defining materials that is only called when a material is exposed to the sun and it is raining (but I'm a noobie, so probably not the best way). Finally, for sounds, I would have conditional statements set up within the blend function for the number of particles (rain, snow, whatever) such that there would be sputtering, drizzling, rain, heavy rain, etc, and have a function that is called that changes the sound type based on the range of particles (and of course, that can also be improved by whether or not you want the sounds to be defined as globally (while you're outside) or defined as coming from the ground or objects around you as water hitting metal is very different than it hitting concrete or ground or a treehouse.)

Let us know what you come up with! Azura's wisdom to you.

Who is online

Users browsing this forum: No registered users and 2 guests