WEATHER managing plug-in

  • A plug-in to customise the probabilities of the various types of weather.


    Version 0.1.1 Experimental!


    - Features:


    *) Probabilities of the 10 types of weather supported by RW.
    *) An in-game year is split in 25 periods, each of which can have different probabilities.
    *) Rate of change.
    *) 'master' setting to reduce variability from full use of all weather types progressively toward more favourable types, down to default weather only (good weather with some clouds).


    - Commands


    There is no command, as the plug-in is intended as "fire-and-forget": just configure it as you prefer and run it. As there is no user interface, there is also nothing to localise.


    Installation


    *) Extract the files in the ZIP placing the whole weather folder into the plugins folder of RW (if the plugins folder does not exist, just create one). The resulting hierarchy shall be:


    Code
    ── RisingWorld
    ├── plugins
    │ ├── weather
    │ │ ├── settings. properties
    │ │ └── weather.jar


    Notes and open points


    *) The provided settings are aimed at a nice, Mediterranean / temperate kind of weather. Play with settings to achieve different types of climate.


    *) As in R.W. the weather is global, all biomes share the same settings.


    *) The whole thing is experimental: it should not crash, but the actual results are yet to fine tune.


    *) Some of the settings are not obvious: please read the explanatory comments in the settings.properties file carefully, before modifying them!


    *) Transition form one weather type to another may take up to 60 / 65 seconds. As I have no idea if starting a new transition before the previous is completed may adversely affect the system, a minimum limit of 70 seconds has been put on the weather cycles; if the changesPerDay setting is set to a too high value resulting in too fast weather cycles, a minimum delay of 70 seconds is forced between transitions.


    *) Feedback is welcome!

  • I think the idea is good. It is perhaps a little complicated to understand [...]

    Well, it is intended mostly for server owners (or local play); interaction is also limited to setting 'tuning' with the documentation right in sight. So, there is nothing really complex to remember or to understand.


    If the explanations in the settings.properties file need improvements, please let me know.


    Also, I noticed that, as everything is probabilistic, most changes are observable over some time of play (some hours), rather than immediately.

  • This sounds interesting... Going to give it a try.


    Dumb question... How do you find out what the time of year is in RW time? I found it in the F3 info. Is this the only spot.


    So if any of the numbers in the "Seasons" matrix are "0.0" then that weather will not happen?


    Another dumb question.. What is the difference between "Defualt" and "Clear" weather?

  • Ok.. Tried this on my SP world.


    According to the logs, the plugin loaded successfully, however I get no weather changes at all.


    I used the attached settings.properties file. I set:
    settings.properties


    changesPerDay=48.7 Which, if I understand this setting, should mean changes in weather every 1/2hr or so game time (just for testing)
    master=1.0 Use all weather types per probabilities.


    See file for periods-probabilities, but basically a "linear" distribution favoring default/Clear (with little dense-fog) for all periods (no seasons for testing).


    I would have expected changes in weather every 1/2hr or so of RW time, but it just stayed on "default" (used F3 to monitor).


    Still not sure I understand "default" versus "clear" weather?

  • Ok ran things for a while with a debug log running... Still seeing no weather changes.


    I get lines like:
    Client sync weather: 0 -1 0.0 true
    and
    Client sync weather: 0 0 0.0 false


    Could these lines indicate why I'm not seeing any weather changes?

  • @Jon_miner: thanks for your testing! In fact, I accidentally removed some lines while 'cleaning' the code (too aggressively, it seems!).


    I have uploaded a 0.1.1 version which corrects the bug.


    I have also noticed that, with your test settings.properties file, new transitions were started (once the bug corrected) before the previous one could complete. I have added a minimum weather cycle duration of 70 seconds (for the record, your setting had a weather cycle of about 52 seconds).


    P.S.:


    *)The difference between "default" and "clear" seems to be that "default" is the weather used before weather changes were implemented: nice weather with a few clouds; "clear" is 0 clouds.


    *) If a probability value is set to 0, that weather type should not occur for that year period.

  • Thanks Miwarre! The new version definitely acts as I would have expected.


    I would have thought that my setting for changesPerDay of 48.7 would mean 1440 mins/day x 1.75 sec/min (game_time_speed) / 48.7 changes/day x 60 sec/min = 36.4 sec/change (RW time).


    I love your plugin here, but I must say that with RW not having separate weather patterns per biome and/or latitude and biomes are not in any particular latitudes, having "seasons" don't really make sense to me. It is easy enough here to set the probabilities the same for all periods of the year and this configuration allows for a lot of possibilities.


    Great job!

  • BTW The settings that I was testing with are NOT settings I would use in the game normally. Weather should not change every 30-50 secs. I was even testing with game_time_speed set to .25 (~ 4secs/min) to speed up the testing.


    This makes me wonder... Do you know what the "changesPerDay" and "Probabilities by type" are for the game normally (without the plugin running)?

  • @Jon_miner:


    Glad to know it now works as 'expected' (between quotes, as even I, I am not sure what to expect!).


    Calculations: unless I am severely mistaken:
    1.75 real secs per in-game min * 1440 mins per day = 2520 real secs per in-game day
    2520 real secs per in-game day / 48.7 changes per in-game day = 51.745379877 real secs per change


    (and, yes, I imagined there were testing settings, not to use on a 'production' environment!)


    Seasons: it is surely a matter of taste and personal preferences. I like to have some variation along the (in-game) year, as it gives some impression to be in a more 'living' environment.


    For instance, with the default 1.75 time speed, one in-game year = 2520 * 365 = 919800 real secs = 10d : 15h : 30m (real time). If one connects to a given server regularly every day at approx the same time, he will find the server advancing of slightly more than one month every time and a different combination of weather types every time.



    The limitations you quote are true, though.


    'Vanilla server' settings: no idea, but I suspect that, without any manual alteration, there are 4 - 5 weather changes per day. Distribution seems more or less the same across all types, as I usually find very little 'good' weather. But these are pure speculations...

  • Yup... your math is right. I was confusing RW minutes and real world seconds. Gets confusing :)


    See your point on seasons. I hadn't done the math but 10days (real time) per RW year is shorter than I had guessed.


    Thanks and nice job here!

  • Question: If one were to set "changesPerDay" to something like 0.25 so that there are only changes to the weather every 4 days. Would the duration of any change/event also be 4 days long? Would it be possible to set the maximum (or a random duration between a min - max) duration for each of the weather events/types (default, clear, overcast, etc.)?

  • Question: If one were to set "changesPerDay" to something like 0.25 so that there are only changes to the weather every 4 days. Would the duration of any change/event also be 4 days long?

    I didn't try, but I expect them to be 4 days long. We are speaking of in-game days, though, not real-time days.

    Would it be possible to set the maximum (or a random duration between a min - max) duration for each of the weather events/types (default, clear, overcast, etc.)?

    In principle, it would be possible, but it is not implemented (yet?). I assume this would override the common duration set via "changesPerDay".


    I.e.: if the duration of a certain type of weather is set to, say, 0.5 days (fixed) or 0.25-0.75 days (range), that weather type would last the given amount of time (or a random value within the range), regardless of the duration set bu "changesPerDays". If all weather types have each a specific duration, the "changesPerDay" setting would become ineffective.

  • @Miwarre I think the point is that we (users of your plugin) don't care so much about the number of changes per day as to how long these weather events will actually last (having bad weather is not a problem so long as it lasts 1/5 the time of good weather or something similar. If you could reconfigure the plugin with a second table like your existing one for weather events with a structure like:


    Event typeMinimum time lengthmaximum time length
    Rain1min4min
    Clear10min20min


    and so on for all events (which table we will be able to custom edit). And then after the weather event is chosen by your other probability table a second uniformly distributed random number between 0 and 1 would be chosen with 0 signifying minimum duration and 1 maximum duration (and scale in between by mintimelength +rand*(maxtimelength-mintimelength)). I would think you can easily implement a second table like this since you have already done that harder job creating the base plugin.

  • If all weather types have each a specific duration, the "changesPerDay" setting would become ineffective.

    Yes, this would be true. But I think this would give better control as weather events would not be a fixed duration and the probabilities table provides for the "seasonal" control. But I would not use "fixed" durations but rather a random duration within a range. (like Minotorious described).

  • Event typeMinimum time lengthmaximum time length
    Rain1min4min
    Clear10min20min

    It makes sense and it would be not very difficult to implement.


    Question: Am I correct in assuming that you think in terms of real time duration ranges, rather than game time duration ranges? The implementation is practically the same -- there is only one scale factor not used or used --; the main difference would be that, in the first case, the timings would not be affected by the simulation rate, while in the second case they would. I believe that either choice is going to suit someone and not someone else...


    Any explicit preference?

  • I meant real world time, imo it is easier to estimate how long I want something to last in real life than game time and get confused by conversion factors :D

  • LOL You are right about " I believe that either choice is going to suit someone and not someone else..."


    Although I agree that it is easier to "estimate how long I want something.." in Real Life Time, I also think that the simulation rate SHOULD affect everything, including weather and therefore these should be in Game Time. The conversion is not that difficult for those who prefer Real Life time.

  • I meant real world time, imo it is easier to estimate how long I want something to last in real life than game time and get confused by conversion factors :D


    LOL You are right about " I believe that either choice is going to suit someone and not someone else..."


    Although I agree that it is easier to "estimate how long I want something.." in Real Life Time, I also think that the simulation rate SHOULD affect everything, including weather and therefore these should be in Game Time. The conversion is not that difficult for those who prefer Real Life time.

    In fact, the difference between the two possibilities is just one multiplication to do or to skip; it is easy to make it a setting choice.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!