Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[RELEASED] UniStorm 4.0 - AAA Procedural Volumetric Clouds, Weather, Sky, Cloud Shadows, & More!

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

  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Hey there!

    It seems like your Viewport Rect may be offset. We have tested UniStorm on many different computers and device and have not come across this issue before. So, it must be scene related.

    Go to your camera gameobject and check your camera's 'Viewport Rect'. Ensure that its parameters cover your screen. The settings should be: X=0, Y=0, W=1, H=1.

    If this isn't the case, it could be something with a RenderTexture in your scene.

    Are you using any additional cameras?

    What version of Unity are you using?

    What version of UniStorm are you using?
     
  2. snuoq

    snuoq

    Joined:
    Feb 22, 2016
    Posts:
    3

    Thanks for really quick reply. I have currently two cameras in my project: fps camera and "weapon camera". I am using Unity 5.3.2f1 Personal and UniStorm 2.1.2.

    Anyway the glitch lines disappeared when I disable and re-enable UniStorm sun shafts script.. For some reason the lines came back always when I change weather type.
     
    Last edited: Feb 22, 2016
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    It sounds like it may be due to the way your 2 cameras are setup. We use UFPS with UniStorm so we know a second camera works. If you are having issues with Image Effects there may be a setting wrong somewhere.

    Try disabling all image effects except the Sun Shafts and the Global Fog to see if this changes anything.

    Also try test out our demo scenes, if they work, it's something with your setup. We will need more info to help you out. Are you using a custom 2nd camera setup or something like UFPS? If you are using UFPS, we have a system that automatically sets it up for you.
     
  4. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    I don't know if others have had this issue or not but a couple days ago I downloaded an update to our UniStorm. I hadn't updated it in a while so I figured I would do it. Now since updating I am getting no clouds in any of the demos and in my own scenes.

    Here is a screenshot showing what it looks like when it rains:
    UniStorm_Bug.jpg

    The error I'm getting there is a result of how everything is instantiated and shouldn't be what's causing the issue since the clouds also do not display in any of the demos that comes with UniStorm. Any help would be greatly appreciated!
     
  5. snuoq

    snuoq

    Joined:
    Feb 22, 2016
    Posts:
    3
    Well, I tried today demo scenes and make new scene with only camera with UniStorm, but these lines appears sometimes in both of them. Don't really have any idea what's going on.
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Hey there!

    What version of UniStorm are you using and what version of Unity are you using? There was a Unity 5.3 bug that has been fixed with the newest version of Unity. There was also a shader update that with UniStorm 2.1.2. Ensure that you are using both the current version of Unity and UniStorm.

    Are you using a custom script to instantiate UniStorm or the one we supplied? The instantiation demo we supplied will instantiate the player then get all the components needed to make it work. If you are instantiating your player and UniStorm, you need to make sure UniStorm is spawned first so the player has the necessary components to get. When instantiating UniStorm ensure that it is done so in the Awake function and that the player grabs the components in the Start function.

    Use our instantiation script or use it as a starting point. If you test the instantiation demo out, it works. There may be a component you are missing somewhere in your scene.

    If you can answer the above, we should be able to see what's going on.


    That's strange because I can import UniStorm into the same version of Unity with no issues.

    Have you tried disabling all Image effects except the Sun Shafts and the Global Fog?

    Also try removing and reimporting the Image Effects.
     
  7. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    Hello, thanks for getting back to me. It's UniStorm 2.1.2 that I'm using with Unity 5.2.2 UniStorm is added to the scene through the editor and then when my Player and Camera is instantiated I make sure everything is connected up properly through code.

    I am getting no clouds on ALL of the demos that come with UniStorm as well as my own scene so It shouldn't be the way I'm setting everything up.

    Code (csharp):
    1.  
    2.  
    3. void Update ()
    4.     {
    5.         if (this.cameraObject == null && EnvironmentHandler.Instance != null)
    6.         {
    7.             this.rain = EnvironmentHandler.Instance.Rain;
    8.             this.rainSplashes = EnvironmentHandler.Instance.RainSplash;
    9.             this.rainMist = EnvironmentHandler.Instance.RainMist;
    10.             this.snow = EnvironmentHandler.Instance.Snow;
    11.             this.butterflies = EnvironmentHandler.Instance.LightningBugs;
    12.             this.windyLeaves = EnvironmentHandler.Instance.WindyLeaves;
    13.             this.mistFog = EnvironmentHandler.Instance.RainStreaks;
    14.             this.snowMistFog = EnvironmentHandler.Instance.SnowDust;
    15.             this.lightningSpawn = EnvironmentHandler.Instance.LightningSpawn;
    16.  
    17.             this.cameraObject = Camera.main.gameObject;
    18.  
    19.             if (this.cameraObject != null)
    20.                 SetupUniStorm();
    21.  
    22.             if (this.cameraObject != null)
    23.                 GetComponentInParent<FollowPlayer>().player = TerrainManager.Instance.player;
    24.  
    25.             return;
    26.         }
    27.  
    28.  
    29.  
     
  8. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    Ok I figured out on my own what the problem was that I was having. I'm not making a mobile game so I wrongfully figured I didn't need to import the Mobile Version as well. The mobile and Desktop version share some assets such as the Cloud dome so the Cloud Dome mesh wasn't imported.
     
  9. rubenijpelaar

    rubenijpelaar

    Joined:
    Nov 15, 2012
    Posts:
    1
    Sounds like a good plan! Cumulus clouds are essential for a good weather ambiance. Are there also plans to generate large cumulus (cumulonimbus) cloud systems? Nice for improving thunderstorms sky view before they arrive. Are cumulus clouds scheduled in forthcoming updates?
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Great to hear you figured out what was going on. We will have to add a mobile cloud dome so users can import the Mobile folder without having to import the Desktop folder with our next update.


    With the next update (2.1.3), we will be doing some minor bug fixes, redoing the UniStorm Editor (Adding tabs for each option), and improving the Auto Player Setup. After 2.1.3, we will try to add some cumulus clouds to UniStorm.
     
  11. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    The SunShaftPosition script seems to do nothing, as indicated by the following screen dumps. This is the moment of sunrise:

    Screen Shot 2016-02-29 at 18.25.46.png

    And this is just a few seconds later:

    Screen Shot 2016-02-29 at 18.26.47.png

    This is a yet a little later. The discrepancy is still there, but it's slightly obscured by the wider reflection path:

    Screen Shot 2016-02-29 at 18.27.21.png

    The Update() function of the script is completely empty. Is there further configuration needed to get sun shaft caster positions to update automatically?
     
  12. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    Sunset pic:

    Screen Shot 2016-03-02 at 01.06.24.png
     
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Hey there!

    If you want your sun to perfectly match your specular light, you will need to do the following. We had to implement our own sun because Unity's Sunshafts can't cast from a procedural skybox sun.

    1) Open up the UniStormWeatherSystem script.
    2) Go to around line 639 and find where it says: SkyBoxMaterial.SetFloat("_SunSize", 0);
    3) Comment this out so it looks like the following: //SkyBoxMaterial.SetFloat("_SunSize", 0);
    4) In the project search, search for the ProceduralSky material. Once you've done so select it.
    5) Adjust the sun size to the desired size.
    6) Go to the hierarchy and search for the SunGlow and disable the "Mesh Renderer"
    7) Go to your UniStorm camera and disable the Sunshafts Image Effect.

    This will use UniStorm's procedural skybox sun instead of its default sun.
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Hey everyone!

    @snuoq @guildwriter

    For those of you who have been having some shader issues with Unity 5.3.3, we found what was happening. This was due to some shader changes that Unity made with the 5.3.3 update.

    The good news is that we have found a solution. A quick fix update should be submitted sometime tomorrow or Friday!

    If you need the updated shaders sooner, you can email us at: Support@BlackHorizonStudios.com or PM us here on the forums. Please include your invoice number for UniStorm when doing so.
     
    Last edited: Mar 2, 2016
  15. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    So does this mean with UniStorm it's either sun shafts or correct specular lights, but not both?

     
  16. keithale

    keithale

    Joined:
    Feb 23, 2016
    Posts:
    1
    Will UniStorm work with Third Person Controller and if so, how hard to set up?
     
  17. Irish-Merlin

    Irish-Merlin

    Joined:
    Apr 23, 2015
    Posts:
    5
    I have Scene A as a main menu. Later, loads Scene B which then load additive Scene C, D, etc.. I have UniStorm on scene B. Problem is when I load a scene, Unity's lightning environment, "Sun" gets unassigned.

    As far as I could tell, there is no way to assign "Sun_Moon" game object to Unity's lightning environment using script only.

    See:
    Link 1
    Link 2
    Link 3

    So, basically... when I load a game, the night sky will be bright blue. The solution is to assign Sun_Moon to the inspector, but I can't do that. Does anyone happen to have a workaround for this kind of problem?
     

    Attached Files:

  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Yes, to my knowledge, it's a limitation to Unity's Sun Shafts. I believe it needs an actual object to base its position on.


    I haven't tested it, but I know other have used it and got it to work. You would just need to use the Auto Player Setup to setup your player.


    We are well aware of this. The problem is Unity's API. They don't allow any code to access or set the Sun object in the Environment Lighting. This makes it impossible for anyone to access it. I believe that I've heard that they plan on adding proper API for it. Other than that, I have no idea how to set it, unless someone provided a hack.
     
  19. Irish-Merlin

    Irish-Merlin

    Joined:
    Apr 23, 2015
    Posts:
    5
    I've solved my problem.

    Turns out that if I have UniStorm as a prefab in the scene, the Lightning environment inspector will lose the Sun_Moon whenever I load the next scene (either during runtime or editor).

    The solution is to select UniStorm prefab that is in the scene (hierarchy), click on the menu at top, GameObject > Break Prefab Instance. Finally, assign the Sun_Moon to the Lightning environment inspector. Save scene.

    I tested and confirmed this works.
     
  20. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    OK, I can live with that for the time being; thanks for the reply.

    Another question: I need a full day/night cycle. Nighttime is too bright, however. I see that UniStorm animates Ambient Color, but not Ambient Intensity. Now, with terrains, trees and vegetation are rendered as they should – they're clearly affected by the Ambient Color – but the terrain itself isn't. The only way is by reducing the Ambient Intensity. Is there a way UniStorm can be made to animate Ambient Intensity as well? Otherwise you end up with completely dark vegetation, but a weirdly lit terrain.

    It's fairly easy to set up something which determines the luminosity of the Ambient Color on a 0.0 to 1.0 scale and multiply the basic Ambient Intensity with that factor. Is there something already built-in which can be used for that purpose?
     
  21. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    138
    Has this gone live yet? No clouds showing up in the latest version of Unity+UniStorm in the demos. :(
     
  22. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    I created a new clean Project, imported UniStorm and got dozens of script errors.
    Using Unity 5.3.3f1 and UniStorm 2.1.2
    ExampleScripts with sharedmaterials have issues, Material.SetColor and so on.
    As it is right now, it can't be used.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    UniStorm's night can be adjusted as dark as you'd like. The screenshot below shows a really dark example of how dark night can be (you can even go darker if you'd like). You need to make sure that you are also decreasing the Moon Light color or intensity as this also affects how dark your nights are.

    SuperDarkNightTime.png



    Sorry for the cloud issue. It's an issue that was just introduced with Unity 5.3.3.

    We submitted UniStorm 2.1.3 today that fixes the shader issues related to Unity 5.3.3. If you need it sooner, just send us a PM or email at Support@BlackHorizonStudios.com so we can send it to you early.


    Are you receiving errors or warning messages?

    We just imported UniStorm 2.1.2 into Unity 5.3.3.1f without any errors, other than some obsolete warning messages. The obsolete warning messages can be ignored as they do not not affect the system in any way. We will update the API to get rid of the obsolete warning messages when we get the chance to do so.

    If it's anything related to the shaders, we just submitted an update that updates the shaders to work with Unity 5.3.3.1f.
     
    Last edited: Mar 6, 2016
  24. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Just added this to a test project today, tried setting it up a few times. I'm not getting a sun, moon stars or clouds showing.

    I add it to the project as you show in the tutorial, for desktop.

    I spawn the player in after as it's multiplayer, so the camera is separated out and is in the scene without the player, it then follows the player once it spawns.

    I've tried the fixes in the troubleshooting faq, but the script already has the 4.0 for the shader (clouds). I'm running the newest version of Unity and just downloaded the Unistorm package.
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Hey there!

    Thanks for letting us know. We will need a little more information to help resolve your issue. Please post a screenshot of your issue as it may help us to see what's going on.

    We can import UniStorm into Unity 5.3.3.1f and see the sun, moon, and stars. So, we can't recreate your issue. Make sure you are importing both the Desktop and Mobile folders.

    The reason you can't see the clouds is because of a new shader issue introduced with the newest version of Unity (version 5.3.3.1f). Send us a PM or email at Support@BlackHorizonStudios.com with your invoice number so we can send you the updated shader.

    We just submitted an update that fixes the cloud issue related to Unity 5.3.3.1f.
     
  26. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    138

    Thanks BHS!! No need, will get it when it goes live! Thanks for the quick reply! :)
     
    BHS likes this.
  27. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    Yes, thanks, but I do think you might be misunderstanding me. Let me rephrase my question: I know that UniStorm modifies the Ambient Color depending on the time of day, but is there any way UniStorm can be made to vary Ambient Intensity as well, along with the Ambient Color? Or do I have to do that myself?
     
  28. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    I emailed you more info, I'm actually running 5.3.2.1f ... just upgraded a week or so ago, had no clue I'm out of date already!

    I'll await your response to the email, as there is more information to consider.

    Thanks again.
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Oh okay, gotcha!

    You would need to add this yourself. However, we would be happy to help if you need it.

    You would just use a float interpolation and adjust it as needed for each time of day. We used similar interpolations for other fading factors so you can use those as references. You can find all of this in the TimeOfDayCalculator function.
     
    Last edited: Mar 7, 2016
    PeterB likes this.
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    UniStorm 2.1.3 has been submitted and is awaiting approval!

    This update fixes the shader issue introduced with Unity 5.3.3.1f. As well as some other much needed improvement.

    Updated UniStorm Sun
    UniStorm's Sun has been fixed and it now uses the sun created with UniStorm's Procedural Skybox. We have also added full support for Sun Shafts with the Skybox sun. This allows for shadows, specular lighting, and Sun Shafts to be accurately cast. The Sun is constant so users can roam as far as they want without limitation. The sun and its sun shafts will also remain constant. Below is Ceto being used with UniStorm. The specular lighting remains accurate, regardless of how far the player moves.

    New UniStorm Sun (2.1.3).png

    New UniStorm Editor
    We have also redid the UniStorm Editor and added tabs for each option. This allows everything to be categorized according to the current option tab that is selected. Only the options for the currently selected tab will be visible. This makes navigating much easy instead of having every option on one large list that you have to constantly scroll through.

    New Editor.png

    Day of the Week and Info
    We have added accurate day of the week. The day of the week is calculated automatically given the date set within the UniStorm Editor. It can be accessed by using UniStormDate.DayOfWeek. Below is the new UniStorm Info box that gives useful information regarding the current UniStorm conditions. This info box is above the option tabs.

    UniStorm Info.png


    UniStorm Desktop and Mobile Independent Import
    UniStorm Desktop and Mobile are now able to be imported independently.
     
    Last edited: Mar 10, 2016
    Tinjaw, PeterB and montyfi like this.
  31. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    Fantastic! Many thanks
     
  32. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Great news. I'd like to say thanks for the quick reply and suggestions, all my issues thus far are resolved - I sent you some follow up messages about a few details.

    I gotta say I was about to mention how the sun doesn't line up on the horizon, seems you fixed that now so there's no need!

    Thanks again, and the new menu layout looks better... :)
     
  33. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello , I have a problem with shadows : his trembling on the ground, how to solve it ?
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    You're welcome!


    We replied and sent you our UniStorm network example using Photon. Even if you aren't using Photon, it should help you get an idea of how it can be done.

    You are welcome and thanks!


    This is a little Unity bug, but it's a simple fix. Go to your camera and increase its Near Clipping Plane to 0.5. This should get rid of the weird shadow issue.
     
  35. bsixel

    bsixel

    Joined:
    Mar 2, 2016
    Posts:
    7
    Loving the asset! Works great for single player scenes I've done. Unfortunately I've been unable to get it to work using Unity's UNET - upon spawning the player prefab, the console gets spammed with "UnassignedReferenceException: The variable moonLight of UniStormWeatherSystem_C has not been assigned." However, upon going and looking in the inspector, that is certainly assigned. In a previous comment someone had the same issue and you mentioned the issue had been fixed in 1.8.5, which is long past. Any idea what could be causing it now?
     
    Arganth likes this.
  36. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    280

    same problem here ^^
    but I think (i may be wrong) you have to setup the player too
    from the unistorm tab/window
     
  37. bsixel

    bsixel

    Joined:
    Mar 2, 2016
    Posts:
    7
    I actually started with one of the example scenes and used one of the prefabs that came with UniStorm , and tried adding networking on top of that - unfortunately that didn't seem to work.
     
  38. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    I am working to get networking using unistorm. Currently I'm syncing the weather state ... trying to get the time to sync now.

    In multiplayer each client/player will have a unistorm component, these all need to be told to be the same... how you do this is the question. In my case I'm just syncing it to the primary client, as the network code I'm using is purely standalone, it doesn't run any game code, just handles the transmission of data.

    On this subject, I'm trying to sync the time/date and I'm not getting any results with feeding the counter variables with the values from the server/controlling client. Any ideas BHS?

    Thanks :)
     
  39. knotFF

    knotFF

    Joined:
    Apr 13, 2013
    Posts:
    66
    While importing UniStorm on an empty scenes using Desktop+C# I am getting about 22 of these errors:

    Code (CSharp):
    1. Material doesn't have a texture property '5f4d61696e54657831'
    2. UnityEngine.Material:SetTextureOffset(String, Vector2)
    3. UniStormWeatherSystem_C:DynamicCloudFormations() (at Assets/UniStorm (Desktop)/Scripts (Desktop)/UniStorm Systems/UniStormWeatherSystem_C.cs:2370)
    4. UniStormWeatherSystem_C:Update() (at Assets/UniStorm (Desktop)/Scripts (Desktop)/UniStorm Systems/UniStormWeatherSystem_C.cs:1678)
    And, I guess, as a consequence the clouds don't work....
     
  40. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Until you get the upcoming release (any day now the fixed version is out) you need to install the mobile part of the asset. That solved the majority of my issues.
     
  41. knotFF

    knotFF

    Joined:
    Apr 13, 2013
    Posts:
    66
    Just did. Still got 3 errors (But I will wait for the update) :

    Material doesn't have a texture property '5f4d61696e54657831'
    UnityEngine.Material:SetTextureOffset(String, Vector2)
    UniStormMobileWeatherSystem_C:DynamicCloudFormations() (at Assets/UniStorm (Mobile)/Scripts (Mobile)/UniStorm Systems/UniStormMobileWeatherSystem_C.cs:2379)
    UniStormMobileWeatherSystem_C:Update() (at Assets/UniStorm (Mobile)/Scripts (Mobile)/UniStorm Systems/UniStormMobileWeatherSystem_C.cs:1683)
    Code (CSharp):
    1. Material doesn't have a texture property '5f4d61696e54657831'
    2. UnityEngine.Material:SetTextureOffset(String, Vector2)
    3. UniStormMobileWeatherSystem_C:DynamicCloudFormations() (at Assets/UniStorm (Mobile)/Scripts (Mobile)/UniStorm Systems/UniStormMobileWeatherSystem_C.cs:2379)
    4. UniStormMobileWeatherSystem_C:Update() (at Assets/UniStorm (Mobile)/Scripts (Mobile)/UniStorm Systems/UniStormMobileWeatherSystem_C.cs:1683)
     
  42. knotFF

    knotFF

    Joined:
    Apr 13, 2013
    Posts:
    66
    Question:
    Is it possible to change the time of day on the fly, for example when you enter a trigger, from say 7am to 3pm?
    I noticed the hourCounter, but it seems to be read only.
    Also I saw in an older post somebody mentioned InstantWeather() , where you could load a "saved" on Start.
    I need to do it on the same scene.
    What would be the best method to implement this?
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    I would upgrade to 2.1.2. It has a lot of improvements.

    As for your issue, that's usually associated with missing a component on the player. UniStorm needs everything to be applied in the Awake function so it can be applied before UniStorm calls it. We have been able to get UniStorm working using Photon so I know it's possible.


    I'm not sure what networking system you are using, but we have UniStorm working over the network with synced weather and time of day using Photon.

    It has 1 player run everything as a master client which then sends the weather and time data to other clients when the weather changes/time is updated. If the master client is disconnected, the master client status is passed on to another player to act as the master client. As long as players don't have access to the Time and Weather changing tools, the time or weather can not be altered by anyone other UniStorm itself changing the weather and having the time flow. This can be handled differently, but it's a very nice starting point for those who need help with UniStorm and Photon.

    Here's the code we used:
    Code (CSharp):
    1. //Black Horizon Studios
    2. //Photon Example
    3.  
    4. using UnityEngine;
    5.  
    6. public class UniStormNetworkSync : Photon.MonoBehaviour
    7. {  
    8.     public GameObject UniStormObject;
    9.     public UniStormWeatherSystem_C UniStormSystem;
    10.     public PhotonView thisPhotonView;
    11.  
    12.     void Start ()
    13.     {
    14.         UniStormObject = GameObject.Find ("UniStormSystemEditor");
    15.         UniStormSystem = UniStormObject.GetComponent<UniStormWeatherSystem_C>();
    16.         thisPhotonView = GetComponent<PhotonView>();
    17.  
    18.     }
    19.  
    20.     void Update()
    21.     {
    22.         if (PhotonNetwork.isMasterClient)
    23.         {
    24.             this.thisPhotonView.RPC ("ChangeWeather", PhotonTargets.All, UniStormSystem.weatherForecaster, UniStormSystem.startTime, UniStormSystem.minuteCounter, UniStormSystem.dayCounter, UniStormSystem.monthCounter);
    25.         }
    26.     }
    27.  
    28.     [PunRPC]
    29.     public void ChangeWeather(int weatherType, float mytime, int minute, int day, float month)
    30.     {
    31.         if (!PhotonNetwork.isMasterClient)
    32.         {  
    33.             UniStormSystem.weatherForecaster = weatherType;
    34.             UniStormSystem.startTime = mytime;
    35.             UniStormSystem.minuteCounter = minute;
    36.             UniStormSystem.dayCounter = day;
    37.             UniStormSystem.monthCounter = month;
    38.         }
    39.     }
    40.    
    41.     public void OnPhotonPlayerConnected()
    42.     {
    43.         this.thisPhotonView.RPC("ChangeWeather", PhotonTargets.All, UniStormSystem.weatherForecaster,UniStormSystem.startTime, UniStormSystem.minuteCounter, UniStormSystem.dayCounter, UniStormSystem.monthCounter);
    44.     }
    45. }
    46.  

    The issues you mentioned earlier will be fixed with 2.1.3. If you need the shader early, we can send it to you. Just let us know.

    Saving any UniStorm variable is possible. We have supplied an example with the Save and Load Example included with UniStorm. This allows users to save the time, weather, and date then load it instantly when the data is loaded.

    The calculations for loading time can be found in the LoadTime function where realStartTime is the hours and realStartTimeMinutesFloat is the minutes. We have updated these names with 2.1.3, but these are what they're called with UniStorm 2.1.2.
     
  44. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Not sure why it's not working, I use the below:

    Server sends:
    int[] timeData = { uniStorm.minuteCounter, uniStorm.hourCounter, uniStorm.dayCounter, (int)uniStorm.monthCounter, (int)uniStorm.yearCounter };

    DarkRiftAPI.SendMessageToOthers(TagIndex.WeatherFUpdate, TagIndex.WeatherFUpdateSubjects.Time, timeData);

    And receiving clients get:

    if (uniStorm.minuteCounter != (data as int[])[0])
    {
    PostScreenMessage("Updating Time and Date!" + (data as int[])[0]);
    uniStorm.minuteCounter = (data as int[])[0];
    uniStorm.hourCounter = (data as int[])[1];
    uniStorm.dayCounter = (data as int[])[2];
    uniStorm.monthCounter = (data as int[])[3];
    uniStorm.yearCounter = (data as int[])[4];
    }


    I didn't use startTime I assumed start time is only used the very first time it starts... I'll add that in and give it another try.
     
  45. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Okay I do have it syncing now over UNET - here's the code for anyone who needs it:

    [SyncVar]
    SyncListInt allTimeInts = new SyncListInt();

    [SyncVar]
    float lastStartTime;

    (below is in update or fixed update and you can adjust send frequency with a timer if you want)

    if(isClient)
    {
    if (allTimeInts.Count > 0)
    {

    uniStorm.minuteCounter = allTimeInts[0];
    uniStorm.hourCounter = allTimeInts[1];
    uniStorm.dayCounter = allTimeInts[2];
    uniStorm.monthCounter = allTimeInts[3];
    uniStorm.yearCounter = allTimeInts[4];

    uniStorm.startTime = lastStartTime;

    }
    }

    if(isServer)
    {
    allTimeInts.Clear();

    allTimeInts.Add(uniStorm.minuteCounter);
    allTimeInts.Add(uniStorm.hourCounter);
    allTimeInts.Add(uniStorm.dayCounter);
    allTimeInts.Add((int)uniStorm.monthCounter);
    allTimeInts.Add((int)uniStorm.yearCounter);

    lastStartTime = uniStorm.startTime;
    }

    Explanation: must reside on a gameobject that exists in both the server and the client, as it runs, it assigns the variables in the (isServer) to the gameObject that is on the server. Because both allTimeInts and lastStartTime are [syncvar] those are automatically updating all the client variables. At this point we only need to look for a change on the client side. I'm just checking for a list count of greater than 0, as it starts empty, it only has data from the server if the server has already updated it.

    Might not be perfect but it works for now. Hope this helps someone using UNET.
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Awesome! Thanks for this. I'm sure it will help a lot of others out. We will test it and see if we can add anymore features, such as weather syncing.
     
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    We just had a chance to test out Map Magic (A node based procedural and infinite map generator) with UniStorm and it worked and looked great!

    Below are some screenshots using their included demo and UniStorm. It only took 30 seconds to setup UniStorm with Map Magic's demo scene. This scene consists of an infinite terrain. All we did was write a simple script to have the UniStorm's domes and moon follow the player. During this test we traveled a huge distance and UniStorm worked great.

    So, for those of you who were wondering if UniStorm works with infinite terrains, it does!

    UniStorm_And_MapMagic.png
    UniStorm_And_MapMagic_2.png
     
    Last edited: Mar 13, 2016
    Wright likes this.
  48. halcyon626

    halcyon626

    Joined:
    Mar 5, 2016
    Posts:
    6
    In the above night time screenshot, the moon is not full yet the 'dark' portion of the moon is blended to be the same color as the sky. How was that effect achieved? Have a minimal test scene with the UniStorm-generated player/effects etc. and the 'dark' portion of the moon does not match the sky. Capture.PNG
     
  49. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    138
    Hi there,
    I sent an email to Support@blackhorizonstudios.com inquiring about the shader Friday evening and I haven't heard back. Is this the right email?
    -Kivak
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,212
    Sorry for the delay! I'll PM it to you right now.
     
    Last edited: Mar 14, 2016
unityunity