[1665] Building Roof Creates huge lag spikes

Hello! I noticed that when my Workers build a roof my computer lags so bad my game crashes! I don’t know what is going on, I used to build roofs fine, now I just get major lag spikes every time a worker places 1 block!

I am gonna try updating my Graphics card, which I already did, but I will try again!

My Computer specs are:

Processor: AMD A4-5000 APU Quad Core 1.5Ghz (LAPTOP)
RAM: 4Gb of RAM
Display: AMD HD Radeon HD 8330

1 Like

I get the same, mostly happens on really large building. The indicator shows that Lua is using 99+%.

Alpha 5 (Steam) (0.1.0.1665)

Specifications:
2.7 GHz Intel Core i7
16GB 1600MHz RAM
NVIDIA GeForce 650M 1GB

Display: 15" Retina 2880x1900

Windows 7

Just when doing roofs? And not heavy pathfinding loads?

Interesting if so :slight_smile: .

@victorzimmer is right I get the huge lag spikes when trying to build a town hall, I am gonna try a small building maybe 15x15? My Town halls would be like 30x18 or something like that like lol

1 Like

Seems like it’s mostly during roofs for me, though I’ve only had the lag spikes on a few buildings that have been really large, like 60x40, but I haven’t tested it thoroughly so dont take my word for it, might happen with walls as well. :slight_smile:

Yeah, mine never crashes though, only extreme lagspikes until construction finishes.

I hope they fix this soon :stuck_out_tongue: This game is great!

1 Like

I found out that rolling in high speed make the game crashes sooner than on normal speed. I even handle to finish one of my two 25x25 houses :smile:

However, game crashes repeatedly for the second … I hope to finish it by saving after each block of roof posed :stuck_out_tongue:

EDIT : The lag miraculously stop as soon as it’s lunc time too ! :stuck_out_tongue:

2 Likes

Yeah lag also stops when its lunch time, my guess being because no roof blocks are being put on! I just hope they can fix it soon :stuck_out_tongue:

1 Like

Everyone has got to love lunch time :wink:

2 Likes

Summary: I was building a single-storey house, and the workers stopped working on the roof to get food. After eating, they ganged up on the same task. Game was running at ~1FPS, and returned to normal when roof construction finished.

Steps to reproduce:

I have not reproduced this yet. Maybe I’ll try again this week

  1. Design building
  2. Have many berries in stock, nearby
  3. Have many workers working on building go on lunch break while placing roof.
  4. Hope they all return to work at the same time.

Expected Results:

Workers spread out on the roof, taking a different task/tile each.

Actual Results:

They all swarmed over to the same block. The roof was built slowly, one tile at a time. FPS dropped significantly, pathfinder was at 100% the whole time.

Notes:

Confounder - I had a few trapper zones. Being the eejit that I am, I started removing them to “fix” the problem. I don’t think they were to blame as the FPS drop only fizzled out as the roof neared completion.

Building size - I designed a spiral building, outer dimensions of 24 x 18:

Roof - I think this bug is roof-placement-specific. My roof was 2 units tall, sloped on all 4 sides. I think the large surface area helped me get the timing right for this bug, as the villagers only started laying roof as they became hungry. If trying to reproduce, play around with your building size to have them be working on the roof when they drop everything to eat (or script something to trigger them getting hungry?)

Lastly, I had an abundance of berries all in the same area. They all ate near each other, which may have caused them to return to work at the same time (and plan to place the same block)

Edit: I get a similar FPS drop when I promote 5 or 6 villagers into farmers and then place large farms… they seem to crowd in that scenario as well, both when hoeing the earth and when planting. To be tested in the future!!

Versions and Mods:
b1687 / Candlearch Mod

nothing of real value to add here… just wanted to acknowledge the well formatted report…

thanks! :smile: :+1:

2 Likes

Just a follow-up… I removed the halloween mod to investigate further, and started a new game to recreate this. I rushed to build a 24 x 24 building, low roof height so they wouldn’t waste time building higher walls. Feeding was not necessary for the slow-down, nor were they crowding the same tile. Here are some pics I took, running at around 1 frame per 3 seconds!!! The second and third pics are pretty much the only frames I saw in the last 10 seconds of the build:

All I have to report is that there are five workers working on the roof, and the fps shot back up to a smooth rate after the building was finished.

I’m assuming this is more evident on slower machines… could any of the ca. 2008 laptop people try this out? :smile:

I’ll further update when I find time to document and compare what happens when I build massive farms with six farmers.

1 Like

I can tell, my laptop is from 2009, and has integrated graphics. The first time we were able to build decent roofs I closed the game because I was scared of that framerate and high consuming of cpu. With subsequent releases, this improved a lot, little by little, each time the team said they did some optimizations on the game.

But it is true that the roof makes huge spikes compared to the rest of the building, and even other activities like farming or engaging combat.

Edit before posting: I made a little gif of a hurried test (sorry for the camera going out at some moments). In it it’s visible that sometimes two workers place the same voxel, and when there’s more than half of the roof already built (just at the end of the gif), the slowing down of the fps. It’s a bit long, it may take time to load. Sorry I didn’t record till the end :sweat:

1 Like

Thanks for testing this out!

The optimizations have helped a lot, I could notice an improvement with each build since I started playing. I had never had such fps drops before, maybe because I wouldn’t have many free workers before the Change Job function was implemented… I usually play in peaceful mode as well, as the goblins would bring my game to a halt in earlier builds. In any case, I hope this helps the team out.

P.S. I was hoping you’d try it with the red roof! It could just be the intricate thatchwork bogging down our systems! :wink:

2 Likes

I wonder if some the roof construction lag is down to pathfinding. First you have to consider getting up to the roof, and not dropping back down to floor level or anything. Then every time a block is placed the area of the roof you’re permitted to walk on changes, which I’m guessing means more calculations to do. Add in several villages and a few hundred blocks and voila…

2 Likes

I agree with you. Even if roofs only need some stairs to be built, they have complex shapes, which causes the pathfinder to do more calculations. Well, that’s my impression. You’re totally right about the expanding walkable surface.

When im building a big house (20x50) the workers start building it, so there is no problem.
But when they start to build the roof, the game is lagging. After they finished the roof, no problem at all.
My Computer specs:
GPU NVIDIA GeForce GTX 760 4096 MB
16GB Ram
CPU i5-4670 3.40Ghz

im not certain this is really a bug, its just the fact that the game is still in development and will some times have trouble doing things.

1 Like

Which version are you playing? r188? I’ll merge your bug to a related report, although I agree with @8BitCrab , this is Alpha.

If you want to ease on that lag, click the vision mode that only shows the floors of the houses when they’re building the roof, it really helps :smile: