Search Unity

[RELEASED] UniStorm 5.2 - AAA Volumetric Clouds, URP Support, Weather, Sky, Atmospheric Fog, & More!

Discussion in 'Assets and Asset Store' started by BHS, Jan 27, 2012.

  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The time can be adjusted, altered, or accessed with the startTime variable.

    Yes, UniStorm can access everything from time, sunlight, precipitation, non-precipitation, temperature, weather, and pretty much anything you can think of.

    One way you can do sunlight is have a threshold where if the sun is past a certain intensity, then it will affect the plants.

    All this is done efficiently because it's only accessing numbers and doesn't require any complex calculation.

    We have done growing plants before, just using the UniStorm time, but growing plants is a very cool feature.

    If you have anymore questions, just ask. We'd like to see the progress of your implementation of UniStorm in your project. Feel free to post some of your progress here.
     
  2. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    Using Unistorm over a network.

    I've seen this asked a fair bit but I've never seen anyone answer the question so I thought I'd set an hour or so aside to figure it out.
    If anyone has any suggestions to improve this please feel free to let me know :)

    Here is how I have Unistorm hooked up using Photon.
    Making the following changes will allow the master client to set the time of day and weather forcast on each client system.

    Please note, This is using version 1.8.3 of Unistorm. I haven't upgraded to 1.8.4 yet so I have no idea if any changes have been made which will break this.


    We need a script first of all to attach all of the Unistorm weather systems to our player game object. at this point none of the weather effects should be parented to anything.
    The following script will parent them to our player and set their positions relative to it:

    Code (CSharp):
    1. /// <summary>
    2. /// Adds all Unistorm components to the local players camera
    3. /// written by Paul Tricklebank
    4. /// Twitter: https://twitter.com/bigfiregamesuk
    5. /// Facebook: https://www.facebook.com/bigfiregames
    6. /// Facebook: https://www.facebook.com/aftersanctuary
    7. /// </summary>
    8.  
    9.  
    10. using UnityEngine;
    11. using System.Collections;
    12.  
    13. public class AS_UnistormNetworkHelper : MonoBehaviour {
    14.  
    15.     //drag this script onto your local player
    16.     // and drag the camera into the slot in the inspector.
    17.     private GameObject RainParticles;
    18.     private GameObject Butterflies;
    19.     private GameObject LightningPosition;
    20.     private GameObject Snow;
    21.     private GameObject SnowDust;
    22.     private GameObject Leaves;
    23.     private GameObject RainStreaks;
    24.     private GameObject RainMist;
    25.     public Camera FPCamera;
    26.  
    27.  
    28.     void Start () {
    29.         //find our unistorm weather systems and attach them all to the camera.
    30.         //you may ned to play with the local positions depending on your
    31.         //level.
    32.         RainParticles = GameObject.Find ("Rain New");
    33.         Butterflies = GameObject.Find ("Butterflies");
    34.         LightningPosition = GameObject.Find ("Lightning Position");
    35.         Snow = GameObject.Find ("Snow New");
    36.         SnowDust = GameObject.Find ("Snow Dust");
    37.         Leaves = GameObject.Find ("Fall Leaves");
    38.         RainStreaks = GameObject.Find ("Rain Streaks");
    39.         RainMist = GameObject.Find ("Rain Mist");
    40.  
    41.         if (RainParticles != null) {
    42.             RainParticles.transform.parent = FPCamera.transform;
    43.             RainParticles.transform.localPosition = new Vector3 (0, 17, 0);
    44.         }
    45.         if (Butterflies != null) {
    46.             Butterflies.transform.parent = FPCamera.transform;
    47.             Butterflies.transform.localPosition = new Vector3 (0, 12, 0);
    48.         }
    49.         if (Snow != null) {
    50.             Snow.transform.parent = FPCamera.transform;
    51.             Snow.transform.localPosition = new Vector3 (0, 17, 0);
    52.         }
    53.         if (SnowDust != null) {
    54.             SnowDust.transform.parent = FPCamera.transform;
    55.             SnowDust.transform.localPosition = new Vector3 (0, 12, 0);
    56.         }
    57.         if (Leaves != null) {
    58.             Leaves.transform.parent = FPCamera.transform;
    59.             Leaves.transform.localPosition = new Vector3 (0, 12, 0);
    60.         }
    61.         if (RainStreaks != null) {
    62.             RainStreaks.transform.parent = FPCamera.transform;
    63.             RainStreaks.transform.localPosition = new Vector3 (0, 12, 0);
    64.         }
    65.         if (RainMist != null) {
    66.             RainMist.transform.parent = FPCamera.transform;
    67.             RainMist.transform.localPosition = new Vector3 (0, 12, 0);
    68.         }
    69.         if (LightningPosition != null) {
    70.             LightningPosition.transform.parent = FPCamera.transform;
    71.             LightningPosition.transform.localPosition = new Vector3 (0, 12, 10);
    72.         }
    73.     }
    74.  
    75.  
    76. }
    77.  
    Next we need to edit the Unistorm system script.
    First, add a photon view to the unistorm system game object and then declare a photon view at the top of the script.
    Don't drag a component into the observe slot of the PhotonView component.

    Code (CSharp):
    1.     //added by BigFireGames
    2.     private PhotonView myPhotonView;
    next, add an RPC near the bottom of the script:

    Code (CSharp):
    1. [RPC]
    2.     public void ChangeWeather(int weatherType, float mytime, int minute, float day, float month){
    3.         if (!PhotonNetwork.isMasterClient) {    
    4.             weatherForecaster = weatherType;
    5.             startTime = mytime;
    6.             minuteCounter = minute;
    7.             dayCounter = day;
    8.             monthCounter = month;
    9.             Debug.Log ("Weather changed to weather type " + weatherType);
    10.         }
    11.     }
    12.  
    then add this underneath your RPC so that when a new player joins the room the RPC is sent to him or her to update the current time and weather.

    Code (CSharp):
    1. public void OnPhotonPlayerConnected(){
    2.         this.myPhotonView.RPC("ChangeWeather", PhotonTargets.All, weatherForecaster,startTime, minuteCounter, dayCounter,monthCounter );
    3.     }
    4.  
    NOTE: The only values we need to sync as a bare minimum are startTime and weatherForcaster.
    The other values are synced incase you wish to display the date/time etc in your UI.

    next, go through the code and find where the weather changes.

    My first change was at around line 1557 and looks like this:

    Code (CSharp):
    1. //If staticWeather is true, the weather will never change
    2.         if (staticWeather == false) {        
    3.             if (PhotonNetwork.isMasterClient) {
    4.                 //20% Chance of weather change
    5.                 if (weatherOdds == 20 && weatherChanceSpring == 20 || weatherOdds == 20 && weatherChanceSummer == 20 || weatherOdds == 20 && weatherChanceFall == 20 || weatherOdds == 20 && weatherChanceWinter == 20) {
    6.                     //Controls our storms from switching too often
    7.                     if (stormCounter >= 13) {
    8.                         weatherForecaster = Random.Range (1, 13);
    9.  
    10.                         this.myPhotonView.RPC ("ChangeWeather", PhotonTargets.All, weatherForecaster, startTime, minuteCounter, dayCounter, monthCounter);
    11.  
    12.                         weatherOdds = 1;
    13.                         stormCounter = Random.Range (0, 7);
    14.                     }
    15.                 }
    16.             }
    There are 6 changes to make in all,
    Once you have made the changes the weather will only ever change on the master client.
    When that happens the RPC is sent to all the other clients to change the weather.
    This will not change the weather or time on other clients if you ust the Time bar or WCPS feature.
    It will only send the RPC when the weather changes dynamically on its own.

    You'll be able to see this in action here https://www.facebook.com/aftersanctuary
    once we actually get around to releasing out multiplayer demo.


    If anyone has any questions then please feel free to ask :)

    @BHS if you're unhappy with the amount of Unistorm code I've posted above please let me know and I will remove this post.
    I tried to keep it to the bare minimum.
     
    Last edited: May 18, 2015
    Deleted User likes this.
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Everything you posted is fine.

    We really appreciate the tutorial and help with the UniStorm community. We will also give this a try and make the necessary changes to be compatible with UniStorm 1.8.4.

    If it's okay, we'd like to add this to the UniStorm Wiki. We would state that you, a UniStorm member, made the tutorial. This shall surely be helpful to many UniStorm customers.

    Thanks again.
     
    sheffieldlad and Deleted User like this.
  4. thomokon2014

    thomokon2014

    Joined:
    Oct 13, 2014
    Posts:
    14
    Unistorm lowers frame rate in game play dramatically ((i use Unity statistics).When in game play i change in UnistormSystemEditor, a parameter, frame rate raises 2 or 3 times. But when build up scene, frame rate in game is very low. Any suggestion? (Unistorm Ver. 1.8.1)
     
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    We have never experienced any frame rate lost due to UniStorm. We have had customers say that they haven't noticed any impact on frame rate while using UniStorm.

    Any Editor will cause a frame rate lost while using an editor while in play mode. I think it's a Unity thing.

    Your loss in frame rate is most likely due to a missing reference of your script that's trying to access UniStorm. If you are having a null reference, meaning your script isn't properly accessing UniStorm, hen you will see a loss in frame rate. This isn't a UniStorm issue, but a scripting issue.

    How are you trying to access UniStorm's variables?
     
    sheffieldlad likes this.
  6. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    Sure, feel free to post it to the wiki.
    The more people it helps the better as far as I'm concerned.
     
  7. thomokon2014

    thomokon2014

    Joined:
    Oct 13, 2014
    Posts:
    14
    Thanks for the reply. It is script problem, finally, and I can fix it.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Okay, we'll work on adding it to the wiki today.



    Good to hear you figured it out.
     
  9. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    @BHS If it will make it easier for you pm me an email address and I'll send over the scripts I created/changed.
    You'll have to be careful with the rain streaks. I think my script I added to my player runs just before unistorm turns the streaks on so you get a null reference if you remove the if(RainStreaks != null) bit. you might have to play with the compile order.
     
    Last edited: May 18, 2015
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Alright, will do. We will also see if we can give this a shot later today to further test it.
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This video demonstrates just a few variables you can access to help promote player immersion and dynamic gameplay. There are 3 player vitals, Food, Warmth, and Dryness. If any reach 0 the player will die. Seeking shelter, in the small wooden shack in the video, will help renew your vitals, except for food.

    Food is based off of the time. For every UniStorm hour, the player's food goes down by 1.

    Dryness is based off the UniStorm weather. If it is raining, and the rain strength is greater than 50, the player's dryness is decreased by 0.5 per second.

    Warmth is based off the UniStorm temperature. If the temperature is less than 50 degrees, the player's warmth is decreased by 1 per second. However, if it is raining, you will be more vulnerable to to the temperature and will still be affected negatively, even if the temperature is greater than 50 degrees.

    If people are interested, we can post a playable webplayer demo of this.

     
    Last edited: May 18, 2015
  12. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    The video is set to private :)
     
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, I mistakenly uploaded the wrong video. So, I'm reuploading it.
     
    thenamesace likes this.
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The video is now live again.
     
    sheffieldlad and thenamesace like this.
  15. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    BHS, thanks for all the help. Unistorm has been working great.

    I recently updated to Unity 5 and now my backgrounds aren't black anymore for indoor zones. I'm wondering what is the best way to make certain things "invisible" whenever a player goes into a building. My game is at a 3/4 view like Diablo, so most of the time the player can't see the sky. Before updating to Unity 5, I would simply disable the cloud object and set the background to black. This doesn't work now.

    However, I figure it would be a good idea to ask to find out what would be the best way. If I can't simply turn off the gradient object as the system turns it back on every frame. As I said before I don't want to mess around with editing the Unistorm code, so any help on how to handle this would be greatly appreciated.
     
  16. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    Have you tried rendering "Solid Color" on your camera? (I think it's depth clearance or something.)
     
  17. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    This is what I did before Unity 5 and it worked great. Now that doesn't work. The Gradient background gets rendered anyway so the background is this whiteish/gray color. I guess I could put the gradient object on it's won layer and stop rendering that layer whenever the player enters a building. I'm just hoping for a simpler solution before I start messing around with that.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    What version are you using? The gradient sphere shouldn't be rendered and should get disabled at start in version 1.8.4.
     
  19. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    I'm using whatever the latest version was as of a week ago. I'll install again in case something wonky went on.
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This should already be there, but add this at in the Start function:
    Code (CSharp):
    1. gradientSphere.SetActive(false);
    This will stop the gradient dome from rendering.
     
  21. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Thanks, I was able to get this fixed. Whew.

    I have another question. How can I tell what weather is active? Like if it's raining, snowing, lightning, etc.? I want to add some events that happen if it starts raining, snowing or something. I'd like for it to send an event when it starts lightning so that inside buildings the lights change to correspond to the lightning outside. It doesn't mean anything in the great scheme of the cosmos, but I think it would have a nice feel to it.

    Also, what's the deal with length of day? It used to be I had it set to 360 minutes = 1 full day (24 hours). Now there's a set "day" length and a "night" length. Is this a combined day/night thing, so I would need to make my "day" length 180 minutes and "night" 180 minutes? I'm a little confused since my new time setup doesn't divide the two.

    *EDIT* After messing around with this for a while, I've found that setting the time will cause it to default to the night time start time. For example (Nighttime start time is 18:00):

    I set the time to 19:00, it starts at 18:00. If I set the time to 1:00, it sets the time to 18:00. If I set the time to 7:00, it sets the time to 18:00. Strangely enough, if I set the time to 9:00, it always starts at 10:00. However, starting at 10:00 starts at 10:00. From 10-18, everything works fine. After that all times start at 18:00, with the strange 9:00 exception. Before I upgraded today, everything worked fine.

    One more thing, trying to sync minutes with my own clock is a lesson in frustration. Unistorm simply refuses to sync the minutes and every time I tell it to set the correct minutes, it won't do it, or it randomly assigns some time (this was true with the last version as well).
     
    Last edited: May 19, 2015
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You would use the weatherForecaster variable to check the weather. For the Lightning flashes, I'd have to check the UniStorm script, but there is a variable that indicates a lightning flash.

    If you wanted to have a 360 minute day, you are correct, it would be 180 for the day and 180 for the night. It's still based on minutes. How many minutes it takes to complete.

    We're working on redoing the time system so it's easier to to choose a start time based on the hour for UniStorm 1.8.5.

    We'll see if we can find a working around if you need an exact start time.
     
  23. March_of_the_Ents

    March_of_the_Ents

    Joined:
    May 20, 2015
    Posts:
    5
    Hello! I have recently made the commitment to purchasing Unistorm and i like the results in my game, unfortunately, i am struggling integrating the time change mechanics into my RPG framework so that it can affect the NPC's behavior/actions.

    Is there anyway Unistorm is compatible with Plygame?
    https://www.assetstore.unity3d.com/en/#!/content/9694
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Integrating NPCs to react to time is simple. We have a code example here that shows how to access the time.

    http://unistorm-weather-system.wikia.com/wiki/Example_Scripts#Have_an_Event_Happen_at_a_Certain_Time

    You would do the same thing as above but change the navmesh destination based on the time.

    If you need any help just ask.
     
  25. March_of_the_Ents

    March_of_the_Ents

    Joined:
    May 20, 2015
    Posts:
    5
    Sadly to say, i know little code which is why i must resort to using an asset store framework and weather system.

    With that being said, are you familiar with plyGame? If so, how would one go about having UniStorm talk to the plyGame AI?

    Or would this be a question to ask the creator of plyGame? I just naturally assumed you would know more about integration into other kits.

    Thank you for any help in advance.
     
  26. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Hi there. I put Unistorm in my game and have it set for night for when it starts. I'm trying to play around with the settings because my terrain looks too bright in the scene. I can figure out if it is a Unistorm setting or what. I am also using rtp for the terrain textures.
    Any ideas on this? I'm stumped and been playing around for a couple of days with no luck.
    thanks.
     
  27. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    Play with the ambient settings at the top of the lighting window
     
  28. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Hmm I have been. The scene gets darker but the terrain doesnt. And I don't have a screen shot with me at work. Will have to post it later.
     
  29. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    months releasing updates here and zero for the mobile version. You sure ripped people off on that one.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    We will try to put together an example for you when we get a chance.


    This is a Unity thing. You need to change it to Ambient lighting color or add a reflection sphere to your scene.

    If you're having troubles at night you need to go to Window>Lighting and the add the sun_moon object to the Sun component within the environmental settings.


    We are currently working on the update for UniStorm Mobile.
     
  31. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Ok because currently I believe it just has the sun in the lighting settings. Will check and confirm after work tonight.
    Thanks.
     
    sheffieldlad likes this.
  32. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    You've said exactly the same thing 3 months ago. Meanwhile updates has been coming here constantly. Your promise was that you write one update here and then update mobile. For those that bought the mobile version the reality is that you fix here asap and months (and even years!) later, the mobile.

    Get that one fixed please. We paid for the package!
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It takes quite a bit of work to fully rewrite a system to be fully compatible and efficient with mobile. We're doing some major rewrites, which is why we have delayed the update. There's no need to rewrite multiple systems multiple times. I apologize for the delay, but the wait will be well worth it.

    We have trimmed off about 3,000 lines of code. This makes our future updates much easier due to the rewrite. Now that we have finished with the rewrite we will make UniStorm Mobile equivalent to UniStorm 1.8.5.
     
  34. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    I thought it was the same system. That's what you posted long ago on the mobile thread... that you took so long to release the last update because you merged both packages into a single one so updates were faster... :?
    How long until 1.8.5 for mobile then?
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    UniStorm Mobile 1.8.5 will be released within the next few weeks. We are finishing up with UniStorm 1.8.5 Desktop. After that, we will rewrite UniStorm 1.8.5 for mobile. This what allows it to perform so well is that it's exclusively optimized, rewritten, and designed for mobile devices.
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    With UniStorm 1.8.5, we have added the highly requested feature to allow exact starting time of day both Hour and Minute. This allows allows the time to be saved and accessed if needed. An example of this could be something like Skyrim or Oblivion or if your player quits, they can pick up right where they left off.

    If anyone wants this early, we will be adding it to the UniStorm Wiki so you can have the exact starting time of day.

    This is just one of the many new features for UniStorm 1.8.5. We also have improved lighting, colors, time of day, clouds, editor features, and more.

     
    Last edited: May 21, 2015
  37. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Thanks very much for the info. I'm looking through UnistormWeatherSystem_C right now, trying to get a handle on startTime.

    And I would be quite happy to make note here of using Unistorm for in-depth game/engine systems, though I will warn that I'm not very far into it yet and this is simply a hobby for me, something I'm working on in spare time. So I may not have particularly advanced features anytime soon, though I will attempt to get the basic functionality (having a game element react to rain for example) down.

    I'll scour that script to get a handle on how to start using those variables.
     
  38. March_of_the_Ents

    March_of_the_Ents

    Joined:
    May 20, 2015
    Posts:
    5
    @BHS Ok, thank you for looking into this!

     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    If you want script referencing help with UniStorm you can use our UniStorm Wiki. It contains tons of examples and code references.

    http://unistorm-weather-system.wikia.com/wiki/Code_References
     
  40. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
  41. thomokon2014

    thomokon2014

    Joined:
    Oct 13, 2014
    Posts:
    14
    It is possible to change temperature during game?
    (For example slightly reduced temperature to snow instead of rain)
    Thanks for all the help.
     
  42. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    just a thought...
    I once had the same issue as you and it was because I hadn't deleted the dynamic light that unity adds by default to every new scene...
    it took me about half an hour to realise my mistake :rolleyes:
     
  43. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Lol think I deleted it but will double check. Do have the sun-moon set in the lighting parameter.
     
    sheffieldlad likes this.
  44. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    also make sure you set it to use color or gradient not skybox. I prefer color.
    you'll also want to lower ambient intensity. mine is set at around 0.18
     
  45. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    forgot to add, I never use the baked gi only the real time.
    these are the settings which give good results for me :)
     
  46. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    s
    orry, missed the question :) yes I have the sun_moon set in the lighting parameter.
     
  47. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Ah. Now I want to be home trying these instead of being at work lol.
    Gonna be a long day :(
    Thank you very much sheffieldlad.
     
    sheffieldlad likes this.
  48. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    ha ha, I know that feeling.
    no problem and good luck with your game :)
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
  50. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Just so you know, on the wiki you sent me to, in the initial steps it tells you to declare the GameObject variable named "UniStormWeatherScript," but the next step, which accesses the GameObject, calls the variable
    "UniStormWeatherSystemScript." Not a big deal, I figured it out, but it could cause confusion.
     
    Last edited: May 22, 2015