Creating random weather for RTC -- Finished
Posted: Wed Nov 07, 2012 10:45 pm
I am trying to create a random events system that allows for branching events, but where only one event chain can occur at a time. What I am currently looking to use this for is to create random weather for outdoor adventures in RTC.
The problem is that I sometimes get 2 or more sequences of random events (weather conditions) happening at the same time. This is causing strange things to happen such as it there are heavy clouds and light clouds with both heavy rain and light rain falling at the same time, for instance. I have tried several ideas to prevent this and ensure only one of these events can be active at a time but so far, when I think I have it working and the weather model finished, I get the above problem rearing its ugly head again, and I'm beginning to get that banging my head against a brick wall feeling.
I will use the diagram below to illustrate some examples of both what I am looking for and what I am getting, each lettered box represents all the items associated with a single part of an event chain, and the box labeled Start represents the event checker itself, along with all items needed to make it work.

So let's say the random event checker, Start is activated, and it begins checking for the start of events A, B and C. Now, only one of these 3 events should ever start at a time, so if event A starts, then events B and C should be blocked from starting. I've tried several methods to ensure this behavior actually happens but none of them have worked.
The most recent method I'm experimenting with and which I have had the most success with so far is to associate a dummy item that can hold the states of either active or inactive and have only one of these dummies active at a time. I'll refer to these dummy items as dummy Start if its associated with the Start event, dummy A if its associated with event A, dummy B for event B, and so on. So my intentions here were to have dummy Start default to active, while all other dummies default to inactive. This allows the Start event to occur when it should and begin the testing for random events. If, at some point, both events A, and C were to pass the random activation test, each would then test if dummy Start is active. My idea here is then when event A activates, the first thing it does is deactivates dummy Start, and so when event C is tests the state of dummy Start it will find its inactive and fail to activate, because event A already deactivated it. At least that's my theory, but I really don't know enough about how RTC handles the relays and other specialty items like that to know for sure if that's really how it works, of if it tests both events A and C simultaneously, and to both would pass the test for dummy Start being active, and then it would be disabled by both events A and C, so both now end up running simultaneously, thus defeating my attempt to make only 1 of them run at a time.
In short, what I'm looking for is some way to create the behavior that when Start activates event A, event A does something to block events B and C from activating, if event A did not activate, but event B did, then event B blocks event C from activating. Then if event A activated successfully, and properly blocked events B and C from any possibility of activating, would then test for events D and E activating, and should event D activate it too would prevent event E from activating. If anyone knows a way to do this, or has any suggestions of something I might try them please share them with me, of if it is impossible with the current RTC engine than I'd also like to know so I don't keep banging my head against a brick wall trying to do something I really can't anyways.
If anyone wants to take a more detailed look into what I have and see if they can tinker around with it until it works I would be happy to release the source code for this random weather system as part of a small test dungeon. I am actually planning to release a working copy to the community anyways to other custom dungeon developers can use it in outdoor adventures, and even modify it as they see fit, to fine tune it to different climates. Once working, simple adjustment of the probabilities of the relays that handle activating a possible next step in a weather event would simply need to be adjusted to simulate anything from an arid desert to a rainforest in the middle of the monsoon season.
EDIT: Using the dummy objects system is now working. I've been testing the weather system for hours now without any double branching of the weather system, so I should be able to release this soon. I just need to test it for timing and balance the probability settings so I get a realistic looking weather system going.I hope to be releasing the source code for this system in a small test dungeon by the end of this weekend. Anyone who wants to use random weather in for outdoor adventures should be able to build a custom dungeon by modifying my test dungeon, which I will name Weather Test. I'd recommend you keep an original around as a back-up and do any experimenting, modifications and dungeon building under a different file name. I plan on balancing this for a temperate climate, but if you want to simulate another climate, all you need to do is adjust the probabilities of the relays that control the weather progression to make rain less likely and any rain storms that do occur more likely to break up quickly, or do the opposite to simulate a wetter climate such as a rainforest.
I'll post some directions on how to use this weather system in your dungeons later.
EDIT: I've finished the system and have been testing it for the last few days without any errors. So I'm posting the download link:
Random Weather Starter Kit
Alt link: http://dmweb.free.fr/Stuff/files/Random_Weather.zip - b.
This file includes the text file RTC needs for editing and compiling, a readme file with credits, version info and detailed instructions on how to use this system in your own custom RTC dungeons and some sound files I used to add sound effects to the weather, like the sound of wind, and falling rain, and some extra thunder effects.
The problem is that I sometimes get 2 or more sequences of random events (weather conditions) happening at the same time. This is causing strange things to happen such as it there are heavy clouds and light clouds with both heavy rain and light rain falling at the same time, for instance. I have tried several ideas to prevent this and ensure only one of these events can be active at a time but so far, when I think I have it working and the weather model finished, I get the above problem rearing its ugly head again, and I'm beginning to get that banging my head against a brick wall feeling.
I will use the diagram below to illustrate some examples of both what I am looking for and what I am getting, each lettered box represents all the items associated with a single part of an event chain, and the box labeled Start represents the event checker itself, along with all items needed to make it work.

So let's say the random event checker, Start is activated, and it begins checking for the start of events A, B and C. Now, only one of these 3 events should ever start at a time, so if event A starts, then events B and C should be blocked from starting. I've tried several methods to ensure this behavior actually happens but none of them have worked.
The most recent method I'm experimenting with and which I have had the most success with so far is to associate a dummy item that can hold the states of either active or inactive and have only one of these dummies active at a time. I'll refer to these dummy items as dummy Start if its associated with the Start event, dummy A if its associated with event A, dummy B for event B, and so on. So my intentions here were to have dummy Start default to active, while all other dummies default to inactive. This allows the Start event to occur when it should and begin the testing for random events. If, at some point, both events A, and C were to pass the random activation test, each would then test if dummy Start is active. My idea here is then when event A activates, the first thing it does is deactivates dummy Start, and so when event C is tests the state of dummy Start it will find its inactive and fail to activate, because event A already deactivated it. At least that's my theory, but I really don't know enough about how RTC handles the relays and other specialty items like that to know for sure if that's really how it works, of if it tests both events A and C simultaneously, and to both would pass the test for dummy Start being active, and then it would be disabled by both events A and C, so both now end up running simultaneously, thus defeating my attempt to make only 1 of them run at a time.
In short, what I'm looking for is some way to create the behavior that when Start activates event A, event A does something to block events B and C from activating, if event A did not activate, but event B did, then event B blocks event C from activating. Then if event A activated successfully, and properly blocked events B and C from any possibility of activating, would then test for events D and E activating, and should event D activate it too would prevent event E from activating. If anyone knows a way to do this, or has any suggestions of something I might try them please share them with me, of if it is impossible with the current RTC engine than I'd also like to know so I don't keep banging my head against a brick wall trying to do something I really can't anyways.
If anyone wants to take a more detailed look into what I have and see if they can tinker around with it until it works I would be happy to release the source code for this random weather system as part of a small test dungeon. I am actually planning to release a working copy to the community anyways to other custom dungeon developers can use it in outdoor adventures, and even modify it as they see fit, to fine tune it to different climates. Once working, simple adjustment of the probabilities of the relays that handle activating a possible next step in a weather event would simply need to be adjusted to simulate anything from an arid desert to a rainforest in the middle of the monsoon season.
EDIT: Using the dummy objects system is now working. I've been testing the weather system for hours now without any double branching of the weather system, so I should be able to release this soon. I just need to test it for timing and balance the probability settings so I get a realistic looking weather system going.I hope to be releasing the source code for this system in a small test dungeon by the end of this weekend. Anyone who wants to use random weather in for outdoor adventures should be able to build a custom dungeon by modifying my test dungeon, which I will name Weather Test. I'd recommend you keep an original around as a back-up and do any experimenting, modifications and dungeon building under a different file name. I plan on balancing this for a temperate climate, but if you want to simulate another climate, all you need to do is adjust the probabilities of the relays that control the weather progression to make rain less likely and any rain storms that do occur more likely to break up quickly, or do the opposite to simulate a wetter climate such as a rainforest.
I'll post some directions on how to use this weather system in your dungeons later.
EDIT: I've finished the system and have been testing it for the last few days without any errors. So I'm posting the download link:
Random Weather Starter Kit
Alt link: http://dmweb.free.fr/Stuff/files/Random_Weather.zip - b.
This file includes the text file RTC needs for editing and compiling, a readme file with credits, version info and detailed instructions on how to use this system in your own custom RTC dungeons and some sound files I used to add sound effects to the weather, like the sound of wind, and falling rain, and some extra thunder effects.