Announcement

Collapse
No announcement yet.

[TUTORIAL] Quick Time-of-Day Setup

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [TUTORIAL] Quick Time-of-Day Setup

    UPDATE: The pre-made blueprint is available for download! Get it here: http://gregoryjb.blogspot.com/2015/0...f-day-v14.html

    - Extract archive;
    - Copy the "Content" folder into your project folder (it should merge with the content folder already there);
    - When it asks if you want to merge folders, say yes;
    - Launch UnrealEd, and load the project you copied that folder to;
    - Go to 'File > Open Level' and choose "TimeOfDayTemplate.umap" (it should be located under \YourProject\Content\Maps);
    - Hit simulate, and watch the sun move!

    Experiment with the properties in the blueprint. I've written comments for all of them (I think), so it shouldn't be too hard to figure it out. Quick tip: If you want to change the speed of time, "Time Speed" is what you're looking for.

    For more details about this blueprint, go here: http://gregoryjb.blogspot.com/2014/0...int-guide.html

    If it isn't working, please make sure that you followed all of the steps above correctly. They are all necessary!

    Finally, please give feedback! Was it useful? Not useful? Too complicated? Broken? Let me know below!

    [EDIT Updated to v1.2]


    Original Post:

    Hey all,

    I've created a quick tutorial on how to set up a dynamic day-night cycle on the wiki:
    https://wiki.unrealengine.com/Tutorial:_Time_of_Day

    I noticed that there wasn't much info on this, so after figuring it out I decided to share it with you all.

    Hope this helps some people! And feedback is welcome

    EDIT: Updated the tutorial to include a section on environment customization events. Now you can change things based on the level being day or night!
    Last edited by gregdumb; 08-19-2016, 03:35 AM.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  • #2
    One question. How did you get "Light Source" as the target for Add Actor Local Rotation?
    /r/unrealengine/ Check out the Unreal Engine Reddit Community!

    Comment


    • #3
      Originally posted by ParadodxCTRL View Post
      One question. How did you get "Light Source" as the target for Add Actor Local Rotation?
      In the 3D viewport, select your sun lamp, then right-click in the level blueprint editor and choose "Add reference to light source."

      This should work for you
      Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

      Comment


      • #4
        Thanks gregdumb, this is great. Nice and simple!
        Full Time UE4 Tutor! www.tesla-dev.com
        Watch, Learn & Create using my tutorials here: *https://www.youtube.com/playlist?lis...8Zjziv4gUqjLZ_*

        Comment


        • #5
          Thanks Tesla!
          Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

          Comment


          • #6
            Originally posted by gregdumb View Post
            In the 3D viewport, select your sun lamp, then right-click in the level blueprint editor and choose "Add reference to light source."

            This should work for you
            Ha, so simple, no wonder I didn't think of it. This is really cool now that I have it working. Now I'm trying to think about how I can cause events to trigger based on it being "night time".
            /r/unrealengine/ Check out the Unreal Engine Reddit Community!

            Comment


            • #7
              Originally posted by ParadodxCTRL View Post
              Ha, so simple, no wonder I didn't think of it. This is really cool now that I have it working. Now I'm trying to think about how I can cause events to trigger based on it being "night time".
              I would go about it by, in the blueprint, check your sun's rotation and see if it is in the "night" range (aka below the horizon). Then cause events to happen if it is. If you check the skydome's blueprint (select it and click "Edit BP_Sky_Sphere" in the details panel) they have the setup for this, which they used to blend in the stars.

              EDIT: I'll update the tutorial to include something like this when I have the time
              Last edited by gregdumb; 03-30-2014, 08:26 PM.
              Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

              Comment


              • #8
                Very good, congratulations, I really liked it.
                It was easy to understand and quick to implement.
                [Compatibility List] Unreal 4 - Hardware Feedback (Leave your feedback on how the Unreal runs on your computer)

                Comment


                • #9
                  Originally posted by Weskey View Post
                  It was easy to understand and quick to implement.
                  Thanks! That's good to hear, means I did my job right
                  Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                  Comment


                  • #10
                    Hi i have this working but I am looking for a way to get night to look correctly is this in engine or in the editor itself? I am also getting light from under terrain that i believe i can fix via BP but i need a better night sky but i can not find the sky settings for night anywhere.
                    12 CatBlack Studios - One man with a dream, to create amazing things...
                    RPG Engine Toolkit: https://www.unrealengine.com/marketp...engine-toolkit
                    Auto Terrain Cover V3: https://forums.unrealengine.com/show...ver-V3-Release
                    Youtube: https://www.youtube.com/channel/UCuT...VDuzeIeJ6_j1pA
                    Facebook: https://www.facebook.com/pages/12-Ca...52913014823124

                    Comment


                    • #11
                      Originally posted by Shoiko View Post
                      Hi i have this working but I am looking for a way to get night to look correctly is this in engine or in the editor itself? I am also getting light from under terrain that i believe i can fix via BP but i need a better night sky but i can not find the sky settings for night anywhere.
                      You can make changes to the sky in the skydome blueprint (just select it and, in the details panel, click "Edit BP_Sky_Sphere"). The underground lighting could probably be fixed by turning off the sun when it goes below the horizon, I'm working to update the tutorial in relation to demonstrate how to set up something like this
                      Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                      Comment


                      • #12
                        Holy **** did not think that was a BP ... now i said it it starts with bp.... But yes i turn on and off the Sun brightness at 0.1 adn that works i just need to change the night settings now thanks.
                        12 CatBlack Studios - One man with a dream, to create amazing things...
                        RPG Engine Toolkit: https://www.unrealengine.com/marketp...engine-toolkit
                        Auto Terrain Cover V3: https://forums.unrealengine.com/show...ver-V3-Release
                        Youtube: https://www.youtube.com/channel/UCuT...VDuzeIeJ6_j1pA
                        Facebook: https://www.facebook.com/pages/12-Ca...52913014823124

                        Comment


                        • #13
                          Okay, to see where the sun is, just check your light's "Pitch" rotation value. If that's positive, it means it's nighttime. Here's the blueprint setup I used:



                          (Just look at the bottom section, starting with "Get Actor Rotation.") You can then make decisions based on the "Night" boolean. The "Night Threshold" float determines how many degrees the sun must be below the horizon for it to count as night.
                          Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                          Comment


                          • #14
                            Alright, I've added the new section to the tutorial. This should fix the "sun coming through the ground" problem, and also give you a way to customize the environment to day or night.
                            Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                            Comment


                            • #15
                              you could use sun height to tell day and night at night the height is <0 To get the sky to actually change to night i had to modify the lerp to make my own night lery color and transition to that but now if i use a sky light my terrain gets bright at night. I'm going to see if yours does the same... are u using a terrain?
                              12 CatBlack Studios - One man with a dream, to create amazing things...
                              RPG Engine Toolkit: https://www.unrealengine.com/marketp...engine-toolkit
                              Auto Terrain Cover V3: https://forums.unrealengine.com/show...ver-V3-Release
                              Youtube: https://www.youtube.com/channel/UCuT...VDuzeIeJ6_j1pA
                              Facebook: https://www.facebook.com/pages/12-Ca...52913014823124

                              Comment

                              Working...
                              X