OK I have been battling with building lighting. It has always taken awhile but nothing like this. Yesterday I finished half a block in my map. The level has a 1009X1009 landscape. I have a day night cycle so it has two directional lights one is turned off for 11 minutes. A skylight that refreshes every 20 seconds and a Exponential Height Fog. I think there might be a atmospheric volume in there too.
I am using a lot of foliage and all of the light maps are set to 8. There is one post process volume with a cube map to darken the interior because for some reason the skylight makes interiors lighter than outside.
This is the rub there are no other lights at all in the map. I did have 1 point light and 4 spot lights but it was taking a extreamly long time to build. I removed them.
I changed my settings to try to speed it up. I set the lightmap setting from 1 to 4. Went to bed and woke up and it was only at 42%
Seriously? 8 hours not to build lighting on such a small map with just environment light???
Before my computer comes into question the build took about 75-82% of my CPU the entire time and 6.20 megs of RAM. I even set swarm to allowstandalone just in case. This btw is right after other memory problems that I thought was due to the engine going so long without reinstall. So about 2 weeks ago I reinstalled everything but 4.13 preview because I hadn’t used it yet. This has got to stop… This is WAY to long.
From the sound of it you have a very complex setup here that doesn’t lend itself well to using any static lighting for your game. When you have moving directional lights and refreshing skylights to update the capture your shadowing for static lighting would not look correct. That being said, it’s still possible to have static lighting with all of this, but you have a lot going in your scene already with just this.
You mention that you had some spot and point lights but removed them. Assuming everything else is meant to be dynamic and not set to Stationary or Static you should consider enabling the option for “Force No Precomputed Lighting” in the World Settings. If you’re entire project will not use static lighting, I would suggest setting this in the World Settings > Rendering > Uncheck the option for “Allow Static Lighting”.
If you had any stationary or static lighting in the level and you have a densely packed, large level as you describe, the process of sending this information to Swarm Agent can take a while and is largely dependent upon your machine and how much there is to process. All the calculations that are needed can take a while in larger levels and with multiple lights. It’s a very CPU intensive process.
You may want to take a look at the section regarding Logging for Swarm Agent and enabling the super verbose logs. This can have some helpful information for you to sift through and see what exactly is happening during the light build, like the number of assets processed, the number of lighting calculations, Number of lights in the scene, etc.
In addition to this, you can also use the Statistics window in UE4 by going to Window > Statistics. After a completed light build you can use the drop-down and select the option for Lighting Build Info and you can see the column for Lighting Time which indicates how long each actor took to process the lighting. Keep in mind that the Lighting Time column will also have an accumulated time as well, and that that this value is not indicative of the actual time it took to build lighting for scene but instead it’s the accumulated time that each actor took, remembering that each actor is sent to different CPU cores to be calculated. So even though it may say something like 240 seconds for a simple scene, the lighting did not actually take 4 minutes to build when you see that it completed in 30 or less seconds.
I hope this helps with some of the issues you’re seeing.
It does thank you. Although I have question. Yesterday I opened back up the project and it insisted the lighting was built after I had canceled the light build at 40 something percent the night before. I use this sky setup for everything and it hasn’t been a problem until now. Do you think there could be something wrong with my swarm agent?
If you cancelled the light build and didn’t save on exit it is likely using the previous build. If you’re using Swarm with the Binary release my swarm agent guide has some useful info for cleaning the cache and validating, and clearing the derived data cache.
If you’re using a source build, it’s not uncommon for some to have issues with Swarm Agent because Lightmass wasn’t built properly when compiling. This often leads to issues with “Swarm Failed to kickoff” errors, though. In that instance just rebuilding UnrealLightmass should work.
Beyond that, it’s a little hard to say offhand what exactly caused what you’re seeing if it doesn’t line up with this.