Skip to content
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

Merged
merged 13 commits into from
Jul 14, 2020

Conversation

Ramza13
Copy link
Contributor

@Ramza13 Ramza13 commented Jul 6, 2020

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.

@John-Candlebury
Copy link
Member

Could you add the ability for weather to randomly spawn fields in outside tiles?
If its not much bother.

Anyhow this is great thanks for doing it!

@Ramza13
Copy link
Contributor Author

Ramza13 commented Jul 7, 2020

Could you add the ability for weather to randomly spawn fields in outside tiles?
If its not much bother.

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.

@John-Candlebury
Copy link
Member

I was thinking of the simpler "fields spawning everywhere outside at random intervals"

@nexusmrsep
Copy link
Contributor

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.

@mlangsdorf mlangsdorf added the Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics label Jul 7, 2020
Copy link
Contributor

@mlangsdorf mlangsdorf left a 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.

tests/vehicle_power_test.cpp Outdated Show resolved Hide resolved
@Ramza13 Ramza13 force-pushed the weather_effects branch from cf2cf9d to 47ad0aa Compare July 7, 2020 21:55
@Ramza13
Copy link
Contributor Author

Ramza13 commented Jul 7, 2020

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.

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.

@Ramza13
Copy link
Contributor Author

Ramza13 commented Jul 7, 2020

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.

@nexusmrsep
Copy link
Contributor

nexusmrsep commented Jul 8, 2020

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.

@Ramza13 Ramza13 force-pushed the weather_effects branch from 09456cf to b367c97 Compare July 8, 2020 14:34
@kevingranade kevingranade merged commit 3cb4015 into CleverRaven:master Jul 14, 2020
@Ramza13 Ramza13 deleted the weather_effects branch July 14, 2020 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants