• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

My prefab is laggy as hell

I made our LAN-party house as a prefab, but it's extremely laggy. It's a three-story house and the area in total is about 70x70 wide. Outside it works normally, but when you enter the house it's all slow and stuff. Naturally in the editor there was zero problems. So far we've used it only in Navezgane just north of Bobs boars. Is it Navezgane that's not so fond of prefabs, or have I goofed up something somewhere?

 
Does it have a lot of lights turned on?

What's the triangle count reported by the PreFab editor? (Or is it a polygon count? I forget and can't go look at the moment.)

I'm sure Stallionsden has a bigger list of possibilities.

 
The prefab editor will tell you both the triangle and poly count.  You can also turn on light performance to see color coding for how many lights overlap a space.  I concur that these are two of the most important performance factors to check.

 
Uhh, yeah. A lot of lights. In every room lol. That's probably it. 
Doh yeh lights are a big killer.  With what crater was saying make sure no lights cross each other's radius.

If you have 3 lights on next to each other turn2 of them range to 0 this will give the look as on but not affect fps 

 
Yeee, I smashed them and lag no more. What sort of distance would be ok? This place has plenty of bedrooms etc.

The building is 30x30 and has 3 floors plus a twisted attic.

 
As long as we're on the subject, is the coloring you get with light performance turned on accurate for different types of lights?  It draws a radius around the light, even if it's a spotlight instead of a point light.  Are you on the hook performance-wise anywhere near a light, even if it's a spotlight pointing the other way?

 
As long as we're on the subject, is the coloring you get with light performance turned on accurate for different types of lights?  It draws a radius around the light, even if it's a spotlight instead of a point light.  Are you on the hook performance-wise anywhere near a light, even if it's a spotlight pointing the other way?


I'm not sure I understand the question (not sure what you mean by "coloring"), but if the radii of multiple light sources overlap then performance suffers. I think that's true even in the case of a directional light like a spotlight, but I'm just guessing.

 
I'm not sure I understand the question (not sure what you mean by "coloring"), but if the radii of multiple light sources overlap then performance suffers. I think that's true even in the case of a directional light like a spotlight, but I'm just guessing.


When you turn on light performance in the POI editor, it stops rendering the textures of blocks and instead paints them a color based on how many lights hit that surface. That's what I meant by coloring.  The shape of these blobs of color is always spherical, even if some lights are directional instead of point lights.  You answered my question, though: you think the type of light doesn't affect performance.

 
When you turn on light performance in the POI editor, it stops rendering the textures of blocks and instead paints them a color based on how many lights hit that surface. That's what I meant by coloring.  The shape of these blobs of color is always spherical, even if some lights are directional instead of point lights.  You answered my question, though: you think the type of light doesn't affect performance.
Not the light itself  the radius crossing over anothers radius does cause fps issues. 

 
As long as we're on the subject, is the coloring you get with light performance turned on accurate for different types of lights?  It draws a radius around the light, even if it's a spotlight instead of a point light.  Are you on the hook performance-wise anywhere near a light, even if it's a spotlight pointing the other way?
From what I've experienced, regardless of the 'editor' coloring, anything with dynamic features will be FPS eaters while anything baked will be much more forgiving. 2 dynamic lights close to each other but with no overlapping will cause more FPS hits than 3 static lights with some, but not extreme, overlapping. As soon as that overlapping gets extreme we get what the OP experienced and it becomes as bad as dynamic. This can be seen in a place like the Vanilla Gunshop in A19; not sure if A20 worked on that.
In some games, walls can act as occlusion and really help with rendering so the light radius overlapping shows in the Editor but has minimal impact in game, but in 7 Days the walls can be pretty leaky and those overlaps must be carefully considered.

A20 Prefabs seem to have really toned down lighting a lot from the POIs I've visited and rely much more on the player's own light source. Not surprising with the added sophistication and underground features. I can feel that some models are not rendering until much closer now as an optimisation feature, unless it is a new GPU setting. I hope blocks will better occlude for further updates, as walls in other games can have occlusion volumes built in so that what we can't see isn't rendering. But such is the nature of a block based destructible setup. The coloring is a good guide but type and surroundings can take precedence.

 
Back
Top