-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add json controlled weather effects #41905
Conversation
Could you add the ability for weather to randomly spawn fields in outside tiles? Anyhow this is great thanks for doing it! |
I haven't touched fields at all but it sounds like a good idea so I will take a stab at it. Just to clarify do you want fields spawning everywhere outside at random intervals or fields spawning in random tiles? If its the random tiles one I would just need a little more info on what kind of patterns or shapes or ability to control them you would want. |
I was thinking of the simpler "fields spawning everywhere outside at random intervals" |
I have this idea rattling in my head for months so I'm putting it on a table, as you might be interested in adding it too, before I ever take a stab at it. Weather 'daemon' can perform a calculation every x hours of average air temperature for last y hours and if it hits certain threshold convert it to one or more boolean variables accessible from outside named is_shallow_water_frozen, is_deep_water_frozen. Plus variations for salt water, moving water, thin or thick ice etc. Following to that interactions with water terrain could then be adjusted to accounted for surface ice. Think using bashing weapon to bash frozen puddle of water in a swamp, or crossing a shallow river on foot during frosty winter. Not to mention the possibility of adding different tiles for frozen bodies of water. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed over this and it looks good. Thanks for doing this.
So that would be cool but weather isn't quite the spot for that I think. I think you would want to make that a property of each tile, temperature is already stored for each point. My take would be to somehow go to tiles and make them able to be transformed based on criteria and add temperature as one of them. I'm not totally sure about what is involved though. |
I've just added fields. They can be set to be only outside, and will spawn in a radius around the player that by default is everywhere. |
This is not the place for this discussion, so I'll only say that while I agree that conversation from water tiles to ice tiles is something for the map generation, that would have to rely on weather to supply it with temperature. For the ice to form on large bodies of water average temperature should be below zero Celsius for a given amount of time. For performance reason this retroactive calculation cannot be done for each tile or even for each map every single time you move or travel. It has to be done periodically by the weather system. And stored there as simple boolean to be checked by map transformers as easily as is_warm_enough_to_plant() does. To my understanding weather is capable of doing retroactive calculations - like one used to create a weather debug log. If not it can still collect data on the fly to calculate this average temperature. Furthermore this weather feature can be provided separately, without designing a map transformer, that is more tricky part if it. |
Summary
SUMMARY: Infrastructure "Adds more control and new options to weather json effects"
Purpose of change
Part of setup for #41067
Adds new effects weather can cause via json. No functional changes other than minor tweaks to make a few things more consistent.
Describe the solution
Requires/Contains #41617
Via json weather effects can now be customized.
Available weather effect options:
All weathers can have any number of effects
All effects can happen with either a chance to occur or a time period in between.
Messages can be customized for seeing or hearing and sound effects specified.
Rain proof gear can be made to prevent effects.
Effects can cause pain, radiation, wetness, health changes, any effects for any duration or bashing damage.
Effects can spawn monsters, either hallucination or real, you can either specify a target or have it choose a nearby monster to copy.
Fields can be spawned either everywhere, only outside or in a radius around the player.
Traits/mutations can be added or removed
Describe alternatives you've considered
Testing
Additional context
Next pr planned is to make weather requirements more powerful to allow weather happening based on random chance or time intervals.
If you have any requests for other things weather can do let me know.