Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[70% OFF!] 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,760
    We will talk to the developers to see if we can get it working. It should work though. I'm assuming they use 2 cameras like the UFPS system.


    Like we have previously stated, these issues will be fixed as of 1.8.1.

    The UniStorm wiki is far from sparse. It contains tons of example scripts, code references, tutorials, and documentation. We said that it's a work in progress so there's tons more coming. We feel getting UniStorm 1.8.1 finished is a little more important.

    UniStorm works with multiplayer. We have had several customers use UniStorm for MMOs. Providing an example for this is though due to the many options of online systems available. Like others have suggestion you need to store the startingHour variable. You also need to store weatherForecaster variable. Each player will have their own particle systems that will display the precipitation effects.

    The moon issue has been addressed and will be fixed with 1.8.1. We have reflections on the water so I'm not sure why they aren't working for you. With the new horizon system you will see a nice improvement with the way the horizon blends with the sky.

    We are also working on a new moon shader and textures to better blend with the sky while transitioning between different times of day.

    We try to respond as often as possible. We rarely go a week without responding. We will usually respond within 1 day if not within a few hours. The delayed response is usually due to holidays or that we're busy working on finishing 1.8.1.

    I'm sure 1.8.1 will exceed you expectations.
     
    Last edited: Dec 13, 2014
  2. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    195
    @wendymorrison

    Setting up RFPS with unistorm is pretty easy. This is from fading memory so you may need to read the manual if it does not work)

    Here is the easy way I did it.

    Install Unistorm
    Install RFPS
    Install ImageFX again if they are messed up for any reason

    Open the demo scene
    Move you RFPS player to into the scene (near the demo player)
    Disable the other demo player once you are finished the other steps (but don't delete him yet)
    Move all the particle effects (butterfly , rain , leaves ect from the demo player to the RFPS Player. (most of these will be around 20 Meters above your player - see the demo player for positioning - you may have to experiment a bit)

    Now copy all the components (Sunshafts,contast etc) from the demo player camera to the RFPS Main Camera. (Use copy and paste as new component) - (more details in manual if needed)

    VERY IMPORTANT - You need to set the far view distance of your RFPS players Main Camera to around 16000. (does not seem to hurt performance surprisingly)

    I had to play with the positioning of the unistorm system a bit to get the horizon to line up. The other issue had was caused by using the sun flare. If it still doesn't work - check the unistorm editor and make sure all your particle systems are linked correctly.

    Hopefully I did not forget anything. It does look really nice once its working.

    I would make a full video but I am getting kinda pissed at RFPS developer for lack of updates.

    Unistorm is a great asset and does get regular updates.

    good luck
     
  3. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Thankyou so much i must have done somethink wrong yesterday but now i have got it working thankyou again just have to fiddle with the settings now
     
  4. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    I have found after testing that the rain and snow etc don't really follow i mean i can just walk out from underneath the particle of course i probably havent set it properply. A proper manual would be helpful because the wiki don't have much info at all.
     

    Attached Files:

  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I can assure you it does. You just have to make sure you have attached the particles to your player game object. The particles can't follow your player of they aren't a child of your player.
     
  6. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    T
    They are a parent of the player but realistic fps prefab goes like this
    -!!!FPS Player Main-!!!FPS camera(cam has others parented as well)-!!!FPS Effects(effects have others parented as well)-!!!FPS Player-!!!FPS Weapons(weapons has others parented as well), I parented the particles under !!!FPS Player Main but they don't seem to move with player or should i parent them to another one

    I solved the problem now i had to actually parent them to the actual camera not the main player
     
    Last edited: Dec 9, 2014
  7. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    121
    If I delete Image Effects and re-import it for 4.6 it gives an error that TiltShift doesnt exist, and maybe TiltShiftHdr was intended. Im guessing this might be 4.6 vs 4.5 change, so I changed them to TiltShiftHdr.

    Im using Unity Pro 4.6.0f3 and UniStorm 1.8.0.0
     
    Last edited: Dec 9, 2014
  8. Danz112

    Danz112

    Joined:
    May 20, 2014
    Posts:
    39
    No I am still using 4.5.5. I'm getting desperate, mostly because I have to disable Unistorm or I can't even play the scene at all due to that error. I guess at this point the only choice is to manually backup my project and see if it happens again but it's a shot in the dark. I just don't get it, it doesn't make any sense whatsoever that it doesn't work at all anymre in my project, not even in other scenes
    before that, I'll wait for 1.8.1 hoping that it will fix by itself :/. Is there any ETA?
     
  9. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    unty has changed all their image effects in the standard assets to csharp if your importing the standard assets
     
  10. EMINUS

    EMINUS

    Joined:
    Dec 11, 2014
    Posts:
    1
    Another question about SkyShop. When are you going to integrate? I don't mean the exact time... but you know - we already use SkyShop and now we need to choose if we buy UniStorm or we make attempt to write weather control on our own.
     
  11. diatryma

    diatryma

    Joined:
    Dec 31, 2013
    Posts:
    1
    If I choose Exp 2 fog and set Density to 0.001 my scene look really good but only if weather type is Clear. After set it to Foggy or Storm. Density is going to 0.005 and fog disapired. I suppose it might be an error - unistorm set start and end distance as well but Exp 2 uses only Density. (Unity 4.6 pro)
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    We are still talking with the developers of SkyShop.

    We would have to include an example of this on our UniStorm Wiki site due to needing to access certain scripts within the SkyShop System.

    A solution is to prebake each time of day then interpolate through each one just like we have done with things like fog, sun color, ect.


    It does appear to be a small bug. We will fix this with 1.8.1. However, we recommend using the Linear Fog as it tends to look better. The distance of this can also be adjusted making it easier to tweak.
     
  13. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    Hey, I'm almost sure someone already asked, but:

    Is it okay to use negative numbers for temperature? I would really like to have Celsius scale instead of Fahrenheit
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    We added this to UniStorm Version 1.8.1. We will be posting all of the new feature and fixes below momentarily.
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    We are excited to announce that we will be submitting UniStorm version 1.8.1 within the next couple of days. It took a little longer than expected, but we have added tons of new features, and fixes, that we've been wanting to add for quite some time. If we have missed anything, please let us know. We also want to thank everyone for the suggestions and feedback. We're sure that UniStorm 1.8.1 will meet, if not exceed, your expectations.

    After the 1.8.1 update we will start working on fully supporting Unity 5.

    UniStorm 1.8.1 Update

    New features:
    * UniStorm now has separate fog colors for precipitation weather types (storms, fog, snow, ect) for each time of day. This new transition blends nicely with your previously chosen non-storm fog colors as storms and other weather types transition. This new feature adds much more realistic storms and transitions. (No more white fog when it storms) This also allows for darker storms (if you set the storm fog to a nice dark grey) that makes storms look ominous, dangerous, and powerful.
    * Added 3 types of cloudiness levels for generated dynamic clouds (Mostly clear, Partly Cloudy, and Mostly Cloudy) The transition of this is seamless and smooth, not instantaneous.
    * Added Rain Splashes by default back to the UniStorm System.
    * Added an option to use custom rain splash textures if desired.
    * Added support to enable or disable Rain Splashes via the UniStorm Editor.
    * Added Rain Mist particle effect, and completely redid it, for rain weather types adding much greater immersion and effect to rain storms. (Brought back due to request. Rain Streaks are still available for those who choose to use them) The combination of Rain Streaks and Rain Mist make storms feel realistic, powerful, and immersive.
    * Added support to enable or disable Rain Mist via the UniStorm Editor
    * Rewrote the Rain Mist particle shader so that it blends much better with storm clouds and rain streaks. This shader is also now affected by the time of day taking fog and ambient lighting into its color. This allows for perfect and seamless shading for all times of day according to your custom color tweaks.
    * Rewrote the rain particle system shader so that it better blends with other weather effects and storm clouds.
    * UniStorm now uses Shuriken Particle System (You can easily replace any particle system with a custom on if desired, this is also available via the UniStorm Editor). This allows us to utilize all of the new Shuriken System's features to get great looking weather effects.
    * Redid all weather effects using Shuriken Particle System. Weather effects have all been greatly improved.
    * Rain will now react to movement to look more realistically rather than always falling vertically resulting in unrealistic looking rain (Ex. If your player moves horizontally the rain will slightly slant left or right)
    * New high quality rain sound effect
    * New high quality storm wind sound effect
    * New high quality thunder sound effects
    * Added an option to the UniStorm Editor to adjust the Moon's size.
    * Added an option to the UniStorm Editor to adjust the Moon's rotation allowing you to choose which way the bright side of the moon faces.
    * Added the option to choose Dynamic Clouds or Non-Dynamic clouds via the UniStorm Editor. As much as our customer like the look of the dynamic clouds, there are some who prefer the non-dynamic cloud look.
    * Added the option to choose Fahrenheit or Celsius as a temperature scale via the UniStorm Editor.
    * Brought Global Fog back to the UniStorm System and to the UniStorm Editor. The color of these can be adjusted via the UniStorm Editor under (Pro Only).
    * Added a color category for (Pro Only) that contains pro color adjustments to avoid confusion
    * Added a new horizon system that allows an atmospheric scattering effect that transitions nicely with the sky. The color of this can be adjusted for each time of day.
    * Much smoother transitions between weather types.

    Fixes:
    * Fixed obsolete all warning messages on both C# and JS UniStorm scripts.
    * Fixed issue related to DX11 and UniStorm's dynamic cloud shaders (both storm and regular)
    * Fixed issue related to DX11 and UniStorm's gradient sky shader
    * Fixed the sun glare's position so that it now properly aligns with the sun's secular position.
    * Fixed the Sound Manager's night sounds so that they now properly play at night.
    * Fixed the Sound Manager's names so they display the correct names.
    * Fixed a bug in temperature system that would sometimes generate the incorrect temperature for certain seasons.
    * Storm clouds will no longer (in some cases) render over billboarded trees.
    * Storm clouds will no longer (in some cases) render over Unity 3d or Triton water
    * Rewrote and fixed the weather generating algorithm as followed:
    - Weather will not longer get stuck generating endlessly when using the slider resulting in unrealistic weather generation.
    - Weather now generates properly according to each season's weather odds.
    - Weather is now generated hourly and only once per hour (Instead of endlessly in some cases, resulting in unrealistic weather generation)
    - This all allows for realistic, "dynamically consistent", and reliable weather generation.
    * Completely rewrote moon shader:
    - The dark side of the moon will now blend with the sky color and takes in the your fog color.
    - The moon will now properly render in front of stars.
    - Transitions of the moon rising has been greatly improved and no longer results in an unappealing pitch black dark side moon when it's dusk.
     
    Last edited: Dec 16, 2014
  16. tgentry

    tgentry

    Joined:
    Feb 11, 2013
    Posts:
    36
    This all looks great. And I can't wait to get into the storm, but I did not see the snow collection on the ground and other elements using Lars shader. I hope this is in there as well. Thanks BHS
     
  17. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Was dynamic snow ever added back in? The first post only shows change list up to 1.7.x (5 I think it was) and it indicates dynamic snow was to be added in 1.8 but I can find a 1.8 change list and didn't notice it in the 1.8.1 one that was just posted.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    We will be supplying a tutorial to add this to UniStorm on our wiki site. Using lar's shader requires hacking the original terrain shader. Some people were having issues in the past. This way, whoever wants to have dynamic snow, can. It only takes a couple minutes to do. We will supply everything commented out in the UniStorm system script for those who choose to use it.
     
    Last edited: Dec 16, 2014
  19. TDH_DrThirteen

    TDH_DrThirteen

    Joined:
    Jul 3, 2014
    Posts:
    42
    Thats an impressive list. This asset is in my opinion the best weather system that is available in the asset store. It definitely deserves a 5 star rating.
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thank you.
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Here's a look at the new and improved storm particle effects (using Shuriken), sounds, and fog.

    This video demonstrates a quick test storm generated with UniStorm. This video uses the standards assets that are included with UniStorm (which includes all sounds and particle effects you see and hear in the video) This video also uses UniStorm's standard demo scene. This was all done using Unity Free.

     
  22. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,
    can i create a desert (with e.g. sand storm) or winter (with e.g. snow storm) weather on the fly? (without creating additional textures, particle effects)

    Does this asset help me to create custom, e.g. post apocalyptic (e.g. lightning in desert), another planet weather system?

    Thanks for the answers in advance
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    We have already created all the weather particle effects so you don't have to worry about creating them yourself. However, you can use custom ones if desired.

    If you wanted a sand storm instead of a rain storm you could just disable the rain particle effects and change the color of the rain mist to a sand color. Then when a rain storm happens it would be a sand storm instead. For a dry lightning storm, you could just disable the rain particle effect on a thunder storm, if you don't want rain in your game. All this is possible with UniStorm.

    There are over 200 customizable components with UniStorm. You can create any environment imaginable (dessert, snowy mountains, lush rain forest, ect). You can choose every color of the sky, fog, and ambient lighting. You can adjust the weather odds. You can use customizable particle effects. The possibilities are endless.

    If you have anymore questions just ask.
     
  24. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592

    Thanks for your answer!

    This all sounds good. Just one more question (probably a stupid one), does the clouds create a shadow on the terrain?
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome.

    No the clouds do not, but I'm sure it's something we can add in a future update.
     
  26. malteins

    malteins

    Joined:
    Jan 31, 2014
    Posts:
    24
    Can't wait for this, thanks for the update BHS!!
     
  27. Alanj2007

    Alanj2007

    Joined:
    Aug 22, 2013
    Posts:
    17
    I can't wait for 1.8.1 :D
     
  28. Alanj2007

    Alanj2007

    Joined:
    Aug 22, 2013
    Posts:
    17
    Is there a way to disable cycle day? I mean for some cases, I only wants to use rain and lightning

    EDIT : This should be integrate with Adventure Creator, because the way AC spawning the player is way different, and I can't get to work with it. Hope it will update soon! :D
     
    Last edited: Dec 18, 2014
  29. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Great update but sadly i can not read anything about the now integrated mobile version that you promised first for the 1.8 and then for the 1.8.1 update. Did i miss something or can you please tell something about it?
     
  30. shwa

    shwa

    Joined:
    Apr 9, 2012
    Posts:
    461
    Video looks good.
    Not sure, but i seemed to hear some ambient sounds mixed in with the storm. Possibly a desire to create a whistling wind. Very subtle, but noticeable. I found it distracting. There was something similar to this in 1.4.

    For me, it would be helpful if there was a choice of simply a pure rain sound, pure thunder, etc.

    thanks,
    shwa
     
  31. truefx001

    truefx001

    Joined:
    Jan 30, 2013
    Posts:
    132
    I bought your asset awhile ago and now coming to the part of my game to implement it the question I have is , about implementing Unistorm 1.8 into Multiplayer where the character is being created at run time therefore doesn't exist in the Hierarchy and where can I find the functions like time of the day and rain at 10 am.
    Thank you in advance.
    Zvonko
     
  32. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    Very quick and simple question, whenever I try and set the time of day by using something such as the following:

    weatherObj.GetComponent<UniStormWeatherSystem_C> ().hourCounter = 10;

    It won't work, it just carries on resetting back to its original time and carrying on doing it's thing. How are you supposed to set the time, day, month, condition etc because directly changing/setting the values like the above doesn't work.

    It is not a prefab and has been broken (so showing black in the editor etc). Basically could you provide some c# code that sets the date to 1/1/2014 at 08:00 and a weather type of foggy (1).

    Thanks
     
    Last edited: Dec 20, 2014
  33. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    I was just about to ask the same question as auroxi. +1 for answer
     
  34. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    Please can we have an answer? It has been 3 days :(
     
  35. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Looking at your notes for 1.8.1, I noticed that you don't mention the ability to set the time upon startup or change the time in the game. Has this been scrapped for this release? I've been waiting for this feature for months now and you mentioned before it would be in this release. All the other changes sound great, though.
     
  36. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    You've pretty much answered my question, along with webik150's question. This really need to get resolved as I need to sync the time on a multiplayer game and if I can't directly set the time and conditions to match the server, this isn't going to work.

    I echo the above, will it be in 1.8.1? Also, will snow accumulation be in 1.8.1?
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Sorry everyone, we have been busy due to the holidays. We plan on submitting UniStorm the 26th. It should then be accepted within a week or less. We will be submitting UniStorm Mobile shortly after.

    Yes, you would just check Static Time in the UniStorm Editor. This will stop time from flowing.


    We are working on UniStorm Mobile as well. We plan to have UniStorm Mobile updated shortly after UniStorm 1.8.1.


    You can customize the wind sound for storms. We will supply one with a slight whistle and one without a whistle. If you choose to use custom sounds and not have any wind play when it storms you would just leave it blank. However, we can add an option to disable it before we submit it.


    If you are creating your player at runtime you would need to find and apply the UniStorm player components, all particle effects, camera, and lightning position objects, at start.

    To have rain play at 10 am you would just take a look at our UniStorm script examples here:
    http://unistorm-weather-system.wikia.com/wiki/Example_Scripts#Have_an_Event_Happen_at_a_Certain_Time

    You would then change the weatherForecaster variable to 3 (which is a thunder storm) here's a full list of all weather numbers and their weather type: http://unistorm-weather-system.wikia.com/wiki/Code_References#Weather

    Here's an example of how to change the weather by a specific time. You would just put the startingHour to 10.

    Code (JavaScript):
    1. //UniStorm Time Event Script Example
    2. //By: Black Horizon Studios
    3.  
    4. var uniStormSystem : GameObject;
    5.  
    6. var startingHour : int = 10;  //Starting hour is at 10 am
    7. var endingHour : int = 20;   //Ending hour is at 8 pm
    8. var weatherToChangeTo : int  = 3;
    9.  
    10. function Start ()
    11. {
    12.     uniStormSystem = GameObject.Find("UniStormParent_JS/UniStormSystemEditor");
    13. }
    14.  
    15. function Update ()
    16. {
    17.     if (uniStormSystem.GetComponent(UniStormWeatherSystem_JS).hourCounter >= startingHour && uniStormSystem.GetComponent(UniStormWeatherSystem_JS).hourCounter <= endingHour)
    18.     {
    19.           uniStormSystem.GetComponent(UniStormWeatherSystem_JS).weatherForecaster = weatherToChangeTo;
    20.     }
    21.  
    22.         else
    23.         {
    24.                 Debug.Log("The event has ended.");
    25.         }
    26.  
    27. }

    It's a little more complicated than that because the time needs to be calculated after start. However, it can be done and you can have instant weather on start.

    Create a script called StartingHour and paste in the code below.

    Create an empty game object and apply the script.

    Choose the starting time of day in the UniStorm Editor to Morning.

    Click play and everything should work. Your time will be 8 am on 1/1/2014 with the foggy weather type.

    We plan to implement this into the UniStorm Editor with the next version.

    Code (CSharp):
    1.  
    2. //UniStorm Starting time example
    3. //By: Black Horizon Studios
    4. using UnityEngine;
    5. using System.Collections;
    6.  
    7. public class StartingHour : MonoBehaviour
    8. {
    9.  
    10.     public GameObject uniStormSystem;
    11.     public int startingHour = 8;
    12.     public float getDayLength;
    13.     public bool startingHourReached = false;
    14.  
    15.     void Awake ()
    16.     {
    17.         uniStormSystem = GameObject.Find("UniStormPrefab_C/UniStormSystemEditor");  //Get our UniStorm Weather System gameObject
    18.         getDayLength = uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength;
    19.     }
    20.  
    21.     void Start ()
    22.     {
    23.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength = 0.1f; //Sets our dayLength fast to calculate the proper time on start
    24.  
    25.         //Sets our time variables
    26.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayCounter = 1;
    27.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().monthCounter = 1;
    28.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().yearCounter = 2014;
    29.  
    30.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().weatherForecaster = 1; //Changes the weather to foggy
    31.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().fader = 1;  //Fades in clouds instantly
    32.     }
    33.  
    34.  
    35.     void Update ()
    36.     {
    37.         if (startingHourReached == false)
    38.         {
    39.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().lightFlareObject.light.intensity = 0; //Fades out our sun glare instantly
    40.         }
    41.  
    42.         //After everything is set disable by setting startingHourReachedTo true
    43.         if (uniStormSystem.GetComponent<UniStormWeatherSystem_C>().hourCounter == startingHour && startingHourReached == false)
    44.         {
    45.             startingHourReached = true;
    46.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength = getDayLength;
    47.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().startTime = 0.3333f;
    48.         }
    49.  
    50.     }
    51. }
    52.  
    See the above for an example of how to have the time start at a specific time. We plan to implement a true start time soon.

    When we get more time we will supply more examples. The problem is that time is calculated after start so it needs to be done in an update function. We will have a fix for this within the next couple of days and we will post our solution here.

    As for snow, we will supply a tutorial and a code commented out in both UniStorm scripts with 1.8.1. It will be commented out because we don't want it to cause issues if the snow shader has bugs. It hasn't been updated in awhile and we are not the developers of it. It hacks the original terrain shader. Some people have been having problems with Unity 4.0+ versions. This way if you want to have dynamic snow, the option is there. We will also provide an tutorial to help out anyone who does.
     
    Last edited: Dec 24, 2014
  38. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    Thanks for the reply, BHS.

    I've managed to get my clients in sync with the server now anyway.
     
    Last edited: Dec 24, 2014
  39. shwa

    shwa

    Joined:
    Apr 9, 2012
    Posts:
    461
    "You can customize the wind sound for storms. We will supply one with a slight whistle and one without a whistle. If you choose to use custom sounds and not have any wind play when it storms you would just leave it blank. However, we can add an option to disable it before we submit it."

    I suggest having the ability to disable/enable wind sounds, as sometimes it's not what is required for a scene.

    thanks.
     
  40. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    when you say dynamic clouds do you mean 3d and ok for flying games and large view distances?
     
  41. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    im using now your asset for an RTS game, I follow your documentation and i adapted it in my scene. The first results are not bad, but i have still some problems.

    1.) Because i have a camera for an top-down RTS game, the camera can be moved very quickly. The bad thing is about, that some particle effects cannot follow fast enough, like the snow effects. (The rain effects are fast enough.) Also fast moving FPS games (e.g. a car) will have trouble with this. Is there any solution for that?

    2.) After the first thunder i have clearly visible black spots on the terrain. (I use the Relief Terrain Pack v3.1 solution to blend the terrain textures.) Any idea what could be the problem?

    3.) Particle effects should visualise effects like hitting the terrain or an obstacle (at raining). Probably this just possible with area (or larger area) wether effects, which needs then more CPU/GPU time. Is this feature probably available, maybe i missed somewhat?

    Thanks for your answers
     
  42. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    Hi. How would I go about changing the regular fog, sun and ambient colors through script. I am having trouble accessing them at the moment. I have several different environments in my game and would like different fog and light setting for each one. I am planning on using a basic trigger on the areas and change the colors and setting with a script but for some reason can't seem to access these public variables. Any suggestions?
     
  43. Syrath88

    Syrath88

    Joined:
    Jul 9, 2014
    Posts:
    7
    Can't wait, looks good.. looking forward to changing the temperature to Celsius. Does anyone know how much longer till it's available on the asset store? :)
     
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone,

    Sorry for the delay, but we decided to resubmit UniStorm 1.8.1 due to a little bug we found that affected UniStorm's shadow clarity, that we have now fixed. With 1.8.1 UniStorm uses should see much clearer and cleaner shadows without any flickering.

    We're sorry for any inconveniences, but we felt it was better to resubmit 1.8.1 with this fix rather than waiting.

    The clouds are dynamic, but not 3d. We have had customers use UniStorm for flying games though. The just get the height of the 2d clouds and switch to 3d clouds or particle effects when at a certain altitude. (GTA V has also done this).

    3d clouds are expensive, so it's best to use them as little as possible.


    1) With UniStorm 1.8.1, particles will use the Shuriken System system. This allows particles to better follow players and objects due to the new features with Shuriken. We have updated all of our particles to better follow players with most game types.

    2) I would talk to the developer of RTP. He said that he has UniStorm fully supported with his system. UniStorm works perfectly fine with Unity's terrains.

    3) Rain slashes and particle collisions have been redone with UniStorm 1.8.1 and can be enabled or disabled via the UniStorm Editor.


    Please use the below as a reference to accessing UniStorm's variables. You would do the same as below but it would be done with OnTriggerEnter instead.

    You can see the different variables you can access using our UniStorm Wiki here:
    http://unistorm-weather-system.wikia.com/wiki/Code_References

    Code (CSharp):
    1. //UniStorm Starting time example
    2. //By: Black Horizon Studios
    3. using UnityEngine;
    4. using System.Collections;
    5.  
    6. public class StartingHour : MonoBehaviour
    7. {
    8.  
    9.     public GameObject uniStormSystem;
    10.     public int startingHour = 8;
    11.     public float getDayLength;
    12.     public bool startingHourReached = false;
    13.  
    14.     void Awake ()
    15.     {
    16.         uniStormSystem = GameObject.Find("UniStormPrefab_C/UniStormSystemEditor");  //Get our UniStorm Weather System gameObject
    17.         getDayLength = uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength;
    18.     }
    19.  
    20.     void Start ()
    21.     {
    22.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength = 0.1f; //Sets our dayLength fast to calculate the proper time on start
    23.  
    24.         //Sets our time variables
    25.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayCounter = 1;
    26.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().monthCounter = 1;
    27.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().yearCounter = 2014;
    28.  
    29.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().weatherForecaster = 1; //Changes the weather to foggy
    30.         uniStormSystem.GetComponent<UniStormWeatherSystem_C>().fader = 1;  //Fades in clouds instantly
    31.     }
    32.  
    33.  
    34.     void Update ()
    35.     {
    36.         if (startingHourReached == false)
    37.         {
    38.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().lightFlareObject.light.intensity = 0; //Fades out our sun glare instantly
    39.         }
    40.  
    41.         //After everything is set disable by setting startingHourReachedTo true
    42.         if (uniStormSystem.GetComponent<UniStormWeatherSystem_C>().hourCounter == startingHour && startingHourReached == false)
    43.         {
    44.             startingHourReached = true;
    45.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().dayLength = getDayLength;
    46.             uniStormSystem.GetComponent<UniStormWeatherSystem_C>().startTime = 0.3333f;
    47.         }
    48.  
    49.     }
    50. }
    51.  
     
  45. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    EDIT: Updated gTime.cs for ease of Length of Day in Minutes setting.

    This is something I have been working on for quite some time. I love UniStorm but the Time Math is a bit strange and not very flexible and intuitive. I already had a Time Keeping system so I simply linked UniStorm to mine....has worked perfectly from the start.

    Free Scripts to Persistently Set Time of Day:
    - I use Easy Save 2 from the Asset Store but any Database will do.
    - I use an Empty Game Object called _GameData
    this object is placed in every scene and they all sync with each other automatically....with gTime.cs

    The data saving has been very robust. I have tried breaking it several ways and cannot seem to break it. Splitting up DBs is a simple matter as well....they are simple various TXT files. I have tried SQLite and MySQL as well....this database system simply is astounding.

    Easy Save 2:
    https://www.assetstore.unity3d.com/en/#!/content/768

    You can use the scripts how you wish. The time is currently set to a true 24hr format. Game Time to Real Time has not been implented in this script but is a simple matter to change the Seconds/Minute by 2's compliment. So making a 15min Real Time to 1hr of Real Time is simply increment the Real Time Seconds by 4 instead of 1. Tested this and works well. Not implemented in a variable at this point.

    Basically....any object that need to Sync Time need to Find _GameData.....example of a simple PCHeartbeat
    I use the setup in the Start then can nab data at will.

    Code (CSharp):
    1. // Use this for initialization
    2.     void Start ()
    3.     {
    4.         //Get Time Script in _GameData
    5.         gTime = GameObject.Find ("_GameData").GetComponent<gTime>();
    6.      
    7.         //Get Conversion Functions in _GameData
    8.         gConversions = GameObject.Find ("_GameData").GetComponent<gConversions>();
    9.      
    10.         //Get Functions in _GameData
    11.         gFunctions = GameObject.Find ("_GameData").GetComponent<gFunctions>();
    12.      
    13.         InvokeRepeating("gHB1Sec", 0, 1.0F);
    14.         InvokeRepeating("gHB5Sec", 0, 5.0F);
    15.     }
    This is a Time Keeping Script....very similar to what I made in NWN1/2
    **Also has the option to name your own language....Month, Day, Day of Week. I have provided Grey Elven and English
    Note: There are Functions and Conversions that this script is accessing. Those scripts are HUGE so I pasted just what this script is seeking.

    gTime.cs script
    Code (CSharp):
    1.  
    2. /*********************************************************************************************************************/
    3. // Time with Persistency
    4. // gTime.cs
    5. // by Olander (Don Anderson)
    6. // dandersonru@msn.com
    7. /*
    8. - 24 hour Day/Night Cycle with Persistency Option
    9. - Links to Time of Day.
    10. -
    11. */
    12. /*********************************************************************************************************************/
    13.  
    14. using UnityEngine;
    15. using System.Collections;
    16. using System.Reflection;
    17.  
    18. public class gTime : MonoBehaviour
    19. {
    20.     //Game Objects to Get Data
    21.     public gConversions gConversions;
    22.     public gFunctions gFunctions;
    23.  
    24. #region Time Variables  
    25.      
    26.     //Persistent Time
    27.     //Note: This may be turned On/Off on the fly.
    28.     //**If turned off and data is present....time will automatically revert to the database.
    29.     public int nPersistentTime = 1;//Set this to Make Time Persistent (0 is OFF)
    30.  
    31.     //Time Custom Configuration and Tools
    32.     public bool bTimeProgress = true;//Set this to Stop Time (Day/Night Cycle as well) where it is at (false is Time Stopped)
    33.  
    34.     //Minutes Per Day Setting
    35.     //Set this to how many Real Minutes = 24 Game Hours  
    36.     //Seconds and f1000ms (1/10th) sec is still kept at Frame Time reference for accuracy.
    37.     public int nMPD = 30;
    38.  
    39.     //Interval to Save Time
    40.     public int nTimeInitialized = 0; //Will be Set to 1 after data is loaded
    41.     public float fTimeSave = 30.0f;
    42.     public float fTimeSaveTimer = 0.0f;
    43.  
    44.     //Time Frame Updated Variables
    45.     public float fFrameTime;
    46.     public float fNewFrameTime;
    47.     public float fDayLengthMinutes = 0.0f;
    48.     public int nYearCurrent = 1;
    49.     public string sYearCurrent = "";
    50.     public int nMonthCurrent = 1;
    51.     public string sMonthCurrent = "";
    52.     public int nDayCurrent = 1;
    53.     public string sDayCurrent = "";
    54.     public int nDayOfWeek = 1;
    55.     public string sDayOfWeek = "";
    56.     public int nHourCurrent = 0;
    57.     public float fHourCurrent = 0.0f;
    58.     public string sHourCurrent = "";
    59.     public int nMinuteCurrent = 0;
    60.     public string sMinuteCurrent = "";
    61.     public float fSecondCurrent = 0.0f;
    62.     public string sTimeCurrent = "";  
    63.  
    64.     //::USE ONLY 1 SET OF CALENDAR LANGUAGES
    65.     /*****************************************************************/
    66.     /* <= Remove the =>  //  to NOT use this Calendar
    67.     //Month Naming For Clocks and Time Stuff (Sindarin/Elvish Provided)
    68.     public string sMonth1  = "Narwain ";
    69.     public string sMonth2  = "Ninui ";
    70.     public string sMonth3  = "Gwaeron ";
    71.     public string sMonth4  = "Gwirith ";
    72.     public string sMonth5  = "Lothron ";
    73.     public string sMonth6  = "Norui ";
    74.     public string sMonth7  = "Cerveth ";
    75.     public string sMonth8  = "Urui ";
    76.     public string sMonth9  = "Ivanneth ";
    77.     public string sMonth10 = "Narbeleth ";
    78.     public string sMonth11 = "Hithui ";
    79.     public string sMonth12 = "Girithron ";
    80.     /*****************************************************************/
    81.  
    82.     /*****************************************************************/
    83.     // <= Remove the =>  //  to NOT use this Calendar
    84.     //Month Naming For Clocks and Time Stuff (English Provided)
    85.     public string sMonth1  = "January ";
    86.     public string sMonth2  = "February ";
    87.     public string sMonth3  = "March ";
    88.     public string sMonth4  = "April ";
    89.     public string sMonth5  = "May ";
    90.     public string sMonth6  = "June ";
    91.     public string sMonth7  = "July ";
    92.     public string sMonth8  = "August ";
    93.     public string sMonth9  = "September ";
    94.     public string sMonth10 = "October ";
    95.     public string sMonth11 = "November ";
    96.     public string sMonth12 = "December ";
    97.     /*****************************************************************/
    98.  
    99.     //::USE ONLY 1 SET OF CALENDAR LANGUAGES
    100.     /*****************************************************************/
    101.     /* <= Remove the =>  //  to NOT use this Calendar
    102.     //Month Naming For Clocks and Time Stuff (Sindarin/Elvish Provided)
    103.     public string sDay1  = "Orbelain ";
    104.     public string sDay2  = "Orgilian ";
    105.     public string sDay3  = "Oranor ";
    106.     public string sDay4  = "Orithil ";
    107.     public string sDay5  = "Orgaladhad ";
    108.     public string sDay6  = "Ormenel ";
    109.     public string sDay7  = "Oraearon ";
    110.     /*****************************************************************/
    111.  
    112.     /*****************************************************************/
    113.     // <= Remove the =>  //  to NOT use this Calendar
    114.     //Month Naming For Clocks and Time Stuff (English Provided)
    115.     public string sDay1  = "Sunday ";
    116.     public string sDay2  = "Monday ";
    117.     public string sDay3  = "Tuesday ";
    118.     public string sDay4  = "Wednesday ";
    119.     public string sDay5  = "Thursday ";
    120.     public string sDay6  = "Friday ";
    121.     public string sDay7  = "Saturday ";
    122.     /*****************************************************************/
    123.  
    124. #endregion
    125.  
    126.  
    127.     // Use this for initialization
    128.     void Start ()
    129.     {
    130.         //Get Conversion Functions in _GameData
    131.         gConversions = GameObject.Find ("_GameData").GetComponent<gConversions>();
    132.      
    133.         //Get Data Functions in _GameData
    134.         gFunctions = GameObject.Find ("_GameData").GetComponent<gFunctions>();      
    135.     }
    136.  
    137. #region Time Functions
    138.  
    139.     //The Current Calendar Year
    140.     public int GetCalendarYear()
    141.     {
    142.         int nVal = (int)this.GetType().GetField("nYearCurrent").GetValue(this);
    143.         return nVal;
    144.     }
    145.  
    146.     //The Current Calendar Year as a String
    147.     public string GetCalendarYearString()
    148.     {
    149.         int nVal = GetCalendarYear();
    150.         string sString = gConversions.IntToString(nVal);
    151.         return sString;
    152.     }
    153.  
    154.     //Converts a Year to Months
    155.     public int GetYearToMonths(int nVar)
    156.     {
    157.         int nVal = nVar * 12;
    158.         return nVal;
    159.     }
    160.  
    161.     //The Current Calendar Month
    162.     public int GetCalendarMonth()
    163.     {
    164.         int nVal = (int)this.GetType().GetField("nMonthCurrent").GetValue(this);
    165.         return nVal;
    166.     }
    167.  
    168.     public string GetDayOfMonthString()
    169.     {
    170.         string sMonth = "";
    171.         int nMonth = GetCalendarMonth();
    172.         switch(nMonth)
    173.         {
    174.             case 1:
    175.                 sMonth = sMonth1;
    176.                 break;
    177.             case 2:
    178.                 sMonth = sMonth2;
    179.                 break;
    180.             case 3:
    181.                 sMonth = sMonth3;
    182.                 break;
    183.             case 4:
    184.                 sMonth = sMonth4;
    185.                 break;
    186.             case 5:
    187.                 sMonth = sMonth5;
    188.                 break;
    189.             case 6:
    190.                 sMonth = sMonth6;
    191.                 break;
    192.             case 7:
    193.                 sMonth = sMonth7;
    194.                 break;
    195.             case 8:
    196.                 sMonth = sMonth8;
    197.                 break;
    198.             case 9:
    199.                 sMonth = sMonth9;
    200.                 break;
    201.             case 10:
    202.                 sMonth = sMonth10;
    203.                 break;
    204.             case 11:
    205.                 sMonth = sMonth11;
    206.                 break;
    207.             case 12:
    208.                 sMonth = sMonth12;
    209.                 break;          
    210.         }
    211.      
    212.         return sMonth;
    213.     }
    214.  
    215.     //Month to Days
    216.     public int GetMonthToDays(int nVar)
    217.     {
    218.         int nVal = nVar * 28;
    219.         return nVal;
    220.     }
    221.  
    222.     //The Current Calendar Day
    223.     public int GetCalendarDay()
    224.     {
    225.         int nVal = (int)this.GetType().GetField("nDayCurrent").GetValue(this);      
    226.         return nVal;
    227.     }
    228.  
    229.     //The Current Day of Week
    230.     public int GetCalendarDayOfWeek()
    231.     {
    232.         int nDay = GetCalendarDay();
    233.         int nVal = 1;
    234.  
    235.         if (nDay <= 7)
    236.         {
    237.             nVal = nDay;
    238.         }
    239.         else if (nDay > 7 && nDay <= 14)
    240.         {
    241.             nVal = nDay - 7;
    242.         }
    243.         else if (nDay > 14 && nDay <= 21)
    244.         {
    245.             nVal = nDay - 14;
    246.         }
    247.         else if (nDay > 21 && nDay <= 28)
    248.         {
    249.             nVal = nDay - 21;
    250.         }
    251.      
    252.         return nVal;
    253.     }
    254.  
    255.     public string GetDayOfWeekString()
    256.     {
    257.         string sDay = "";
    258.         int nDay = GetCalendarDayOfWeek();
    259.         switch(nDay)
    260.         {
    261.             case 1:
    262.                 sDay = sDay1;
    263.                 break;
    264.             case 2:
    265.                 sDay = sDay2;
    266.                 break;
    267.             case 3:
    268.                 sDay = sDay3;
    269.                 break;
    270.             case 4:
    271.                 sDay = sDay4;
    272.                 break;
    273.             case 5:
    274.                 sDay = sDay5;
    275.                 break;
    276.             case 6:
    277.                 sDay = sDay6;
    278.                 break;
    279.             case 7:
    280.                 sDay = sDay7;
    281.                 break;
    282.         }
    283.      
    284.         return sDay;
    285.     }
    286.  
    287.     //Days to Zero Point
    288.     public int GetDaysToZero()
    289.     {
    290.         int nYear     = GetCalendarYear() - 1;
    291.         int nMonth     = GetCalendarMonth() - 1;
    292.         int nDay    = GetCalendarDay();      
    293.         int nYTM     = GetYearToMonths(nYear) + nMonth;
    294.         int nMTD     = GetMonthToDays(nYTM) + nDay;
    295.      
    296.         int nVal = nMTD;      
    297.         return nVal;
    298.     }
    299.  
    300.     //Add Number of Days in the Future (Calculated from Days to Zero Point)
    301.     public int GetDaysInAdvance(int nVar)
    302.     {
    303.         int nCD = GetDaysToZero();
    304.              
    305.         int nVal = nCD + nVar;      
    306.         return nVal;
    307.     }
    308.  
    309.     //Days to Hours
    310.     public int GetDayToHours(int nVar)
    311.     {
    312.         int nVal = nVar * 24;
    313.         return nVal;
    314.     }
    315.  
    316.     //The Current Time Hours: 0 to 23
    317.     public int GetTimeHour()
    318.     {
    319.         int nVal = (int)this.GetType().GetField("nHourCurrent").GetValue(this);      
    320.         return nVal;
    321.     }
    322.  
    323.     //Hours to Zero Point
    324.     public int GetHoursToZero()
    325.     {
    326.         int nYear   = GetCalendarYear();
    327.         int nMonth  = GetCalendarMonth() - 1;
    328.         int nDay    = GetCalendarDay() - 1;
    329.         int nHour   = GetTimeHour();      
    330.         int nYTM     = GetYearToMonths(nYear) + nMonth;
    331.         int nMTD     = GetMonthToDays(nYTM) + nDay;
    332.         int nDTH     = GetDayToHours(nMTD) + nHour;
    333.      
    334.         int nVal = nDTH;      
    335.         return nVal;
    336.     }
    337.  
    338.     //Hours to Seconds
    339.     public int GetHoursToSeconds(int nVar)
    340.     {
    341.         int nVal = nVar * 60 * 60;
    342.         return nVal;
    343.     }  
    344.  
    345.     //The Current Time Seconds: 1 to 60
    346.     public int GetTimeMinute()
    347.     {
    348.         int nVal = (int)this.GetType().GetField("nMinuteCurrent").GetValue(this);      
    349.         return nVal;
    350.     }
    351.  
    352.     //Minutes to Zero Point
    353.     public int GetMinutesToZero()
    354.     {
    355.         int nYear   = GetCalendarYear();
    356.         int nMonth  = GetCalendarMonth() - 1;
    357.         int nDay    = GetCalendarDay() - 1;
    358.         int nHour     = GetTimeHour();
    359.         int nMinute = GetTimeMinute();      
    360.         int nYTM     = GetYearToMonths(nYear) + nMonth;
    361.         int nMTD     = GetMonthToDays(nYTM) + nDay;
    362.         int nDTH     = GetDayToHours(nMTD) + nHour;
    363.         int nMIN     = nDTH * 60 + nMinute;
    364.      
    365.         int nVal = nMIN;      
    366.         return nVal;
    367.     }
    368.  
    369.     //Hours to Minutes
    370.     public int GetHoursToMinutes(int nVar)
    371.     {
    372.         int nVal = nVar * 60;
    373.         return nVal;
    374.     }
    375.  
    376.     //Minutes to Seconds
    377.     public int GetMinutesToSeconds(int nVar)
    378.     {
    379.         int nVal = nVar * 60;
    380.         return nVal;
    381.     }
    382.  
    383.     //The Current Time Seconds: 1 to 60
    384.     public int GetTimeSecond()
    385.     {
    386.         int nVal = (int)this.GetType().GetField("nSecondCurrent").GetValue(this);      
    387.         return nVal;
    388.     }
    389.  
    390.     //Seconds to Zero Point
    391.     public int GetSecondsToZero()
    392.     {
    393.         int nYear   = GetCalendarYear();
    394.         int nMonth  = GetCalendarMonth() - 1;
    395.         int nDay    = GetCalendarDay() - 1;
    396.         int nHour   = GetTimeHour();
    397.         int nMinute    = GetTimeMinute();
    398.         int nSecond = GetTimeSecond();      
    399.         int nYTM     = GetYearToMonths(nYear) + nMonth;
    400.         int nMTD     = GetMonthToDays(nYTM) + nDay;
    401.         int nDTH     = GetDayToHours(nMTD) + nHour;
    402.         int nMIN     = GetHoursToMinutes(nDTH) + nMinute;      
    403.         int nSEC     = GetMinutesToSeconds(nMIN) + nSecond;
    404.      
    405.         int nVal = nSEC;      
    406.         return nVal;
    407.     }
    408.      
    409.     /// Gets the new frame time based upon Minutes Per Day Length setting.
    410.     /// fFrameTime = Time.delataTime
    411.     public float GetNewFrameTime(float fFrameTime)
    412.     {
    413.         float fVal = 0.0f;
    414.      
    415.         //Real and Game Seconds Per Day
    416.         int nRSPD = 24 * 60 * 60;
    417.         int nGSPD = nMPD * 60;
    418.         float fRatio = (float)nRSPD / (float)nGSPD;
    419.      
    420.         //New Frame Time Rate
    421.         fVal = fRatio * fFrameTime;
    422.      
    423.         return fVal;
    424.     }
    425.  
    426.     /// Hours in Decimal Format
    427.     /// Includes Game Minutes Per Day setting (nMPD)
    428.     public float GetHoursToDecimal(int nHour, int nMinute, float fSeconds)
    429.     {
    430.         float fVal = 0.0f;
    431.              
    432.         float fDecHours = (float)nHour;
    433.         float fDecMin = (float)nMinute / 60;
    434.         float fDecSec = fSeconds / 3600;
    435.              
    436.         fVal = fDecHours + fDecMin + fDecSec;
    437.      
    438.         return fVal;
    439.     }
    440.  
    441. #endregion
    442.      
    443.     // Update is called once per frame
    444.     void Update ()
    445.     {  
    446.         //print(Application.persistentDataPath);
    447.              
    448.         //Save Time Data if set to Persistency
    449.         fTimeSaveTimer += Time.deltaTime;
    450.      
    451.         //Frame Time
    452.         fFrameTime = Time.deltaTime;
    453.      
    454.         //Minutes Per Hour Sanity Check
    455.         if(nMPD < 1)
    456.         {
    457.             nMPD = 1;
    458.         }
    459.      
    460.         //Load Time Data on First Update
    461.         if (nPersistentTime == 1 && nTimeInitialized == 0)
    462.         {
    463.             //Check for Zero in Year...No Data...New Database
    464.             int nTest = gFunctions.GetDBInt("Time","Year",0);
    465.             if (nTest == 0)
    466.             {
    467.                 gFunctions.SetDBInt("Time","Year",nYearCurrent,0);
    468.                 gFunctions.SetDBInt("Time","Month",nMonthCurrent,0);
    469.                 gFunctions.SetDBInt("Time","Day",nDayCurrent,0);
    470.                 gFunctions.SetDBInt("Time","DayOfWeek",nDayOfWeek,0);
    471.                 gFunctions.SetDBInt("Time","Hour",nHourCurrent,0);
    472.                 gFunctions.SetDBInt("Time","Minute",nMinuteCurrent,0);
    473.             }
    474.             else
    475.             {          
    476.                 nYearCurrent = gFunctions.GetDBInt("Time","Year",0);
    477.                 nMonthCurrent = gFunctions.GetDBInt("Time","Month",0);
    478.                 nDayCurrent = gFunctions.GetDBInt("Time","Day",0);
    479.                 nDayOfWeek = gFunctions.GetDBInt("Time","DayOfWeek",0);
    480.                 nHourCurrent = gFunctions.GetDBInt("Time","Hour",0);
    481.                 nMinuteCurrent = gFunctions.GetDBInt("Time","Minute",0);
    482.             }
    483.          
    484.             nTimeInitialized = 1;
    485.         }      
    486.      
    487.         //Save Time Data if set to Persistency (Works on the Fly as well)
    488.         if (nPersistentTime == 1 && nTimeInitialized == 1)
    489.         {
    490.             if (fTimeSaveTimer >= fTimeSave)
    491.             {
    492.                 gFunctions.SetDBInt("Time","Year",nYearCurrent,0);
    493.                 gFunctions.SetDBInt("Time","Month",nMonthCurrent,0);
    494.                 gFunctions.SetDBInt("Time","Day",nDayCurrent,0);
    495.                 gFunctions.SetDBInt("Time","DayOfWeek",nDayOfWeek,0);
    496.                 gFunctions.SetDBInt("Time","Hour",nHourCurrent,0);
    497.                 gFunctions.SetDBInt("Time","Minute",nMinuteCurrent,0);
    498.                 fTimeSaveTimer = 0.0f;
    499.             }          
    500.         }
    501.      
    502.         //Calculate Day Length in Minutes for Day/Night Cycle
    503.         //Used in Time of Day:: TOD_Time.cs
    504.         fDayLengthMinutes = (float)nMPD * 60.0f;
    505.      
    506.         //New Frame Time based upon Minutes Per Day Length
    507.         fNewFrameTime = GetNewFrameTime(fFrameTime);
    508.         fSecondCurrent = fSecondCurrent + fNewFrameTime;
    509.         fHourCurrent = GetHoursToDecimal(nHourCurrent, nMinuteCurrent, fSecondCurrent);
    510.              
    511.         //Minute
    512.         if(fSecondCurrent >= 60.0f)
    513.         {          
    514.             nMinuteCurrent = nMinuteCurrent + 1;
    515.             fSecondCurrent = fSecondCurrent - 60.0f;
    516.         }
    517.      
    518.         //Hour
    519.         if(nMinuteCurrent > 59)
    520.         {
    521.             nHourCurrent = nHourCurrent + 1;
    522.             nMinuteCurrent = 0;
    523.         }
    524.      
    525.         //Day
    526.         if(nHourCurrent > 23)
    527.         {
    528.             nDayCurrent = nDayCurrent + 1;
    529.             nHourCurrent = 0;          
    530.         }      
    531.      
    532.         //Month
    533.         if(nDayCurrent > 28)
    534.         {
    535.             nMonthCurrent = nMonthCurrent + 1;
    536.             nDayCurrent = 1;
    537.         }
    538.      
    539.         //Year
    540.         if(nMonthCurrent > 12)
    541.         {
    542.             nYearCurrent = nYearCurrent + 1;
    543.             nMonthCurrent = 1;
    544.         }      
    545.      
    546.         //Strings for GUI
    547.         sMinuteCurrent = gConversions.IntToString(nMinuteCurrent);
    548.         sHourCurrent = gConversions.IntToString(nHourCurrent);
    549.         nDayOfWeek = GetCalendarDayOfWeek();
    550.         sDayOfWeek = GetDayOfWeekString();
    551.         sDayCurrent = gConversions.IntToString(nDayCurrent);
    552.         sMonthCurrent = GetDayOfMonthString();
    553.         sYearCurrent = gConversions.IntToString(nYearCurrent);
    554.      
    555.         //Time
    556.         string sNth;
    557.         string s1st  = "st ";
    558.         string s2nd  = "nd ";
    559.         string s3rd  = "rd ";
    560.         string s4th  = "th ";
    561.      
    562.         if(nDayCurrent == 1 || nDayCurrent == 21) sNth = s1st;
    563.         else if(nDayCurrent == 2 || nDayCurrent == 22) sNth = s2nd;
    564.         else if(nDayCurrent == 3 || nDayCurrent == 23) sNth = s3rd;
    565.         else sNth = s4th;
    566.      
    567.         string sDayOf = "Day Of ";
    568.         sTimeCurrent = sDayOfWeek +"the "+ sDayCurrent + sNth + sDayOf + sMonthCurrent + "of the Year " + sYearCurrent;      
    569.     }
    570. }
    571.  
    572.  


    Simple Int to String Conversion:
    Code (CSharp):
    1. public string IntToString(int nVal)
    2.     {
    3.         string sString = nVal.ToString();
    4.         return sString;    
    5.     }
    Database Functions to Save/Retrieve the Data:
    Code (CSharp):
    1. #region Database Functions
    2.  
    3.     //Database Filename for No Encryption
    4.     private string GetDBString(string sDatabaseFilename, string sVarName)
    5.     {
    6.         string sDB = "";
    7.         string sFileSuffix = ".txt?tag=";
    8.         sDB = sDatabaseFilename + sFileSuffix + sVarName;
    9.         return sDB;
    10.     }
    11.  
    12.     //Database Filename for Encryption
    13.     private string GetDBStringEncryption(string sDatabaseFilename, string sVarName)
    14.     {
    15.         string sDB = "";
    16.         string sFileSuffix = ".es?encrypt=true&password=pass";
    17.         sDB = sDatabaseFilename + sFileSuffix;
    18.         return sDB;
    19.     }
    20.  
    21.     //Sets the value of an integer in a particular database
    22.     //string sDatabaseFilename = File.txt
    23.     //string sVarName = nameTag
    24.     //int nValue = Value to Store
    25.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    26.     public void SetDBInt(string sDatabaseFilename, string sVarName, int nValue, int nEncrypted)
    27.     {
    28.         string sDB = "";
    29.              
    30.         //Encrypted Option
    31.         if (nEncrypted == 1)
    32.         {
    33.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    34.             ES2.Save(nValue, sDB);    
    35.         }
    36.         else
    37.         {
    38.             sDB = GetDBString(sDatabaseFilename, sVarName);
    39.             ES2.Save(nValue, sDB);
    40.         }    
    41.     }
    42.  
    43.     //Get the value of an integer in a particular database
    44.     //string sDatabaseFilename = File.txt
    45.     //string sVarName = nameTag
    46.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    47.     public int GetDBInt(string sDatabaseFilename, string sVarName, int nEncrypted)
    48.     {        
    49.         string sDB = "";    
    50.         int nValue = 0;
    51.      
    52.         //Encrypted Option
    53.         if (nEncrypted == 1)
    54.         {
    55.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    56.             if(ES2.Exists(sDB))
    57.             {            
    58.                 nValue = ES2.Load<int>(sDB);
    59.             }        
    60.         }
    61.         else
    62.         {
    63.             sDB = GetDBString(sDatabaseFilename, sVarName);
    64.             if(ES2.Exists(sDB))
    65.             {            
    66.                 nValue = ES2.Load<int>(sDB);
    67.             }        
    68.         }
    69.      
    70.         return nValue;
    71.     }
    72.  
    73.     //Sets the value of a decimal in a particular database
    74.     //string sDatabaseFilename = File.txt
    75.     //string sVarName = nameTag
    76.     //float fValue = Value to Store
    77.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    78.     public void SetDBFloat(string sDatabaseFilename, string sVarName, float fValue, int nEncrypted)
    79.     {
    80.         string sDB = "";
    81.      
    82.         //Encrypted Option
    83.         if (nEncrypted == 1)
    84.         {
    85.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    86.             ES2.Save(fValue, sDB);    
    87.         }
    88.         else
    89.         {
    90.             sDB = GetDBString(sDatabaseFilename, sVarName);
    91.             ES2.Save(fValue, sDB);
    92.         }    
    93.     }
    94.  
    95.     //Get the value of a float in a particular database
    96.     //string sDatabaseFilename = File.txt
    97.     //string sVarName = nameTag
    98.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    99.     public float GetDBFloat(string sDatabaseFilename, string sVarName, int nEncrypted)
    100.     {        
    101.         string sDB = "";    
    102.         float fValue = 0.0f;
    103.      
    104.         //Encrypted Option
    105.         if (nEncrypted == 1)
    106.         {
    107.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    108.             if(ES2.Exists(sDB))
    109.             {            
    110.                 fValue = ES2.Load<int>(sDB);
    111.             }
    112.         }
    113.         else
    114.         {
    115.             sDB = GetDBString(sDatabaseFilename, sVarName);
    116.             if(ES2.Exists(sDB))
    117.             {            
    118.                 fValue = ES2.Load<int>(sDB);
    119.             }
    120.         }
    121.      
    122.         return fValue;
    123.     }
    124.      
    125.     //Sets the value of a string in a particular database
    126.     //string sDatabaseFilename = File.txt
    127.     //string sVarName = nameTag
    128.     //string sValue = Value to Store
    129.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    130.     public void SetDBString(string sDatabaseFilename, string sVarName, string sValue, int nEncrypted)
    131.     {
    132.         string sDB = "";
    133.      
    134.         //Encrypted Option
    135.         if (nEncrypted == 1)
    136.         {
    137.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    138.             ES2.Save(sValue, sDB);    
    139.         }
    140.         else
    141.         {
    142.             sDB = GetDBString(sDatabaseFilename, sVarName);
    143.             ES2.Save(sValue, sDB);
    144.         }    
    145.     }
    146.  
    147.     //Get the value of a string in a particular database
    148.     //string sDatabaseFilename = File.txt
    149.     //string sVarName = nameTag
    150.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    151.     public string GetDBString(string sDatabaseFilename, string sVarName, int nEncrypted)
    152.     {        
    153.         string sDB = "";    
    154.         string sValue = "";
    155.      
    156.         //Encrypted Option
    157.         if (nEncrypted == 1)
    158.         {
    159.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    160.             if(ES2.Exists(sDB))
    161.             {            
    162.                 sValue = ES2.Load<string>(sDB);
    163.             }
    164.         }
    165.         else
    166.         {
    167.             sDB = GetDBString(sDatabaseFilename, sVarName);
    168.             if(ES2.Exists(sDB))
    169.             {            
    170.                 sValue = ES2.Load<string>(sDB);
    171.             }
    172.         }
    173.      
    174.         return sValue;
    175.     }
    176.  
    177.     //Sets the value of a transform location in a particular database
    178.     //string sDatabaseFilename = File.txt
    179.     //string sVarName = nameTag
    180.     //Transform object.transform = Value to Store
    181.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    182.     public void SetDBLocation(string sDatabaseFilename, string sVarName, object oObject, int nEncrypted)
    183.     {
    184.         //TODO: Code
    185.      
    186.         /*
    187.         string sDB = "";
    188.         oObject = this.transform;
    189.      
    190.         //Encrypted Option
    191.         if (nEncrypted == 1)
    192.         {
    193.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    194.             ES2.Save(oObject, sDB);    
    195.         }
    196.         else
    197.         {
    198.             sDB = GetDBString(sDatabaseFilename, sVarName);
    199.             ES2.Save(oObject, sDB);
    200.         }
    201.         */    
    202.     }
    203.  
    204.     //Get the value of a transform location in a particular database
    205.     //string sDatabaseFilename = File.txt
    206.     //string sVarName = nameTag
    207.     //int nEncrypt = Set to 1 to Encrypt Data to AES 128bit
    208.     public Transform GetDBLocation(string sDatabaseFilename, string sVarName, int nEncrypted)
    209.     {        
    210.         //TODO: Code
    211.         //ES2.Load<Transform>("File.txt", this.transform);
    212.      
    213.         string sDB = "";    
    214.         string sValue = "";
    215.      
    216.         //Encrypted Option
    217.         if (nEncrypted == 1)
    218.         {
    219.             sDB = GetDBStringEncryption(sDatabaseFilename, sVarName);
    220.             if(ES2.Exists(sDB))
    221.             {            
    222.                 ES2.Load<Transform>(sDB, this.transform);
    223.             }
    224.         }
    225.         else
    226.         {
    227.             sDB = GetDBString(sDatabaseFilename, sVarName);
    228.             if(ES2.Exists(sDB))
    229.             {            
    230.                 ES2.Load<Transform>(sDB, this.transform);
    231.             }
    232.         }
    233.      
    234.         return this.transform;
    235.     }
    236.  
    237.  
    238. #endregion
    Cheers
    Olander
     
    Last edited: Jan 9, 2015
  46. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    BHS. Very good to hear about the 1.8.1 listed updates and fixes. Thank You for this. As soon as it posts on the Asset Store I will be surely testing this out.

    On an FYI for anyone. Time of Day, in my opinion, renders lighting better than UniStorm. The AWS weather addon for Time of Day is fickled and takes a lot of work to make it even somewhat close UniStorm....and it still is not right. UniStorm has fantastic weather and temps. I added Celsius conversion but even that is included in 1.8.1! Awesome.

    With what I see in this 1.8.1 UniStorm....the cream rises to the top....brilliant! This is a very very good weather tool. I miss it greatly! I may even convert over to the UniStorm dynamic clouds as well. =P

    Thanks BHS for updating this! Very much appreciated.

    Cheers
    Olander
     
  47. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thank you for your answers. I don't belive that it is an RTP bug, it just happens when the lightning is coming for 4-5 sec long and then again when the next lightning is coming. Im using Unity 4.5.5f1. Terrain can cause this problem and for there the pixel error can be raised, but this didn't helped. I also disabled the shadow, didn't helped. I have the unity pro version, probably the Image Effects can cause this problem? I used the version which comes with your asset, but i have no idea that Image Effects (Pro) influence the terrain or not.
     
  48. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    i found the problem, in UniStormWeatherSystem.cs, beginning from Line 5890:

    lightSource.light.intensity = 0;
    ...
    lightSource.light.enabled = false;

    changed to:

    lightSource.light.intensity = 0.01f;
    ...
    //lightSource.light.enabled = false;

    Disabling and/or nulling the light cause in RTP 3.0 (on RTP 3.1 too) black spots at the strong blended textures or with too much perlin normal. With this fix no black spots anymore and the 0.01 intensity is hardly noticeable.

    I hope you fix this in the next version for RTP.

    Edit:
    Somewhat is definitely wrong with the lightning-directional-light. My own and also another lightning didn't cause such black spots on the terrain. Probably it will be fixed with the next version, with the use of the new particle system.
     
    Last edited: Jan 11, 2015
  49. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Does it will works with Unity5?
     
  50. dpgSam

    dpgSam

    Joined:
    Jan 8, 2015
    Posts:
    10
    anyone tried UniStorm with stereoscopic 3D yet (oculus rift)? any double-camera rendering issues or artifacts?