[Fixed 1.07][Bug 1.05] Game slows down to a crawl.

Hi,

First off, thank you for this game. For the short period i played it, i enjoyed it.

Unfortunatly (as it is in Aplha, so that’s ok) there are some bugs in it. Btw, i played it on 1.05.

So i first started on a small map and i found out that you can’t get a loan :stuck_out_tongue: So when your account goes to negative, you are bankrupt. And this happened to me thanks to automatic imports.
This is no bug, btw! I like this. Something learned the hard way :slight_smile:
Second game i kept this lesson in mind and it went much better.

Third game i chose the biggest map, because i wanted to make a huge factory with all the sub assembly line and manufacturing stations.
I started with the chassis and then worked my way down the line. But when i got to the Engine fitting part the game slowed down really bad. It only updates once every second or so (real live seconds). The strange thing is that when i have only the Engine fitting station placed (well, 14 of them) it runs smoothly.
But when i put in all the subassemblies and the manufactoring (only 5 lines) it slows down. It doesn’t matter if these are connected to the production line or not. Connecting them and deleting the main Engine fitting stations doesn’t help. Only when i delete all the subassemblies and manufactoring, and replace the main engine fitting stations is runs smooth again.

I see my CPU (I7 6700) with a load of around 14%, which tells me this game uses only one thread. Is that correct? If so, then this game needs a lot of optimization or be able to use more threads.

So in my opinion 1.05 is unplayable if you want to build a big factory.
Big Factory Test 1.rar (351 KB)

Hi, the game is multithreaded (will use up to 8) but not in all areas of the game. I’ll take a look at your save game and try to identify the bottlenecks in the code.

Hi Cliff,

Good to hear it is multithreaded. I have played too much cpu-intensive games which were single-threaded :frowning:
Thank you for looking into it. In the mean time i will check out 1.06 :slight_smile:

I’ve worked out what this is, and there will be a big fix for 1.07. In the meantime, the cause is all those slots whose stockpiles are not connected. They are very slow in 1.06 (way faster now), so connecting up slots before you amass too many should sort it until the next patch.

Thank you for your quick response. I will wait then till 1.07 is out.
As i tried your solution by building one column at a time and it worked. The lower i could build without a problem. When i started at the top columns, i couldn’t build the second column without getting delays again.
Even on 1.06.

And 1.06 made me go bankrupt with the same factory which brought me millions in 1.05. Lol.
At the moment of bankruptcy i had a stockpile of 300 cars and was trying to sell them at a discount of 15%. But still the stocks grew.

And i was missing one or two manufacturing modules. But i guess those will come in a future update :slight_smile:

You will appreciate the next patch, I’m panning around your factory at 60 FPS now :smiley:

Hey Cliff,

If you want an extra test case for this I ran into what may be the same issue on 1.06. The save has massive slowdown, although the factory ran fairly well for a minute or two at normal speed after I built all the new areas (while paused). Note: There is one disconnected row of MakeValve slots.

I’m not sure how your concurrency is setup but the UI is almost totally unresponsive while the simulation is running, but recovers completely once it is paused.

Of note is the fact that the Paint Finish slots are all out of resources , despite working perfectly well for a time. This occurred before the massive slowdown which was created by building the engine fitting area.

Note: Sometimes I get the error “!Route Pending!:…\src\SIM_ResourceRoute.cpp 167” when loading the save. It seems most likely to happen when I load the game, exit to the main menu, then load it again.

Cheers
f5l slow.zip (394 KB)

This was a huge help, and this is fixed for the next build, and runs silky smooth now. Hilariously you ran out of resource objects, I’ve quadrupled the limit, and will check there are no leaks to ensure the cap really is as high as possible.