[0.9] Weird lag

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
liq3
Inserter
Inserter
Posts: 38
Joined: Tue Feb 19, 2013 9:30 am
Contact:

[0.9] Weird lag

Post by liq3 »

I have a dual-monitor setup and tend to watch youtube on the other monitor when playing. For some reason in 0.9 I've started getting lag when I do this. FPS drops to 45 (usually solid 60). If I pause the youtube video the lag stops, and if I press play the lag starts again. And my computer should easily be able to handle it, factorio only uses about 7% CPU (have a quad core). I never had this problem in the past.

Using Windows 7 Home Premium if that's relevant.

PS: Also the savegame i'm running doesn't matter. It does on the new one I started in 0.9, and the old ones from 0.8.x.

PPS: Also it's not just the FPS that drops, but the actual game feels like it's running at half speed.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.9] Weird lag

Post by SilverWarior »

It is posible that the slowdowns you are expiriencing is due to your graphic card being fully loaded. if you use any newer Browsers (IE9 or newer, Gogle Chrome, newer Firefox) the youtube video is being rendered with the help of your graphic card. This could eat up quite some processing power of your graphic card especially when you are watching youtube movies in HD quality.

In order to track this more easily I recomend you download Process Explorer (http://technet.microsoft.com/en-us/sysi ... 96653.aspx)
Process Explorer is nice program which alows you to monitory your system usage similar to task manager but has many more feature.
The features I like most of process Explorer is that it alows you to monitor resource usage for every individaul application (CPU usage, Memory usage, GPU usage, Video Memory usage, etc.).
Infact becouse the process Explorer is so usefull I keep running it all the time.

liq3
Inserter
Inserter
Posts: 38
Joined: Tue Feb 19, 2013 9:30 am
Contact:

Re: [0.9] Weird lag

Post by liq3 »

Well I downloaded that (very nice program) and it's definitely not a GPU bottleneck. Factorio only uses up to about 30%, and chrome barley uses 5%. I am running a GTX 680 after all. ;p Probably not a CPU bottleneck either. Factorio doesn't go above 20%, and chrome doesn't go above 5-10%.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9] Weird lag

Post by kovarex »

I believe the problem might be with the vsync. I have this theory, that the youtube video has ~30fps and it forces factorio to have 30 fps vertical sync as well. In this case, chaning the game to low fps mode would solve it, but it isn't perfect as you loose the smooth 60 fps gameplay ...

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.9] Weird lag

Post by SilverWarior »

liq3 wrote:Probably not a CPU bottleneck either. Factorio doesn't go above 20%, and chrome doesn't go above 5-10%.
Do note that when you are looking CPU utilization for seperate applications 100% would mean full utilization of all CPU cores. So if you have 4 core computer and your application is showing 25% usage that could mean it runs only one one car and utilizes it entirely.
When looking at detailed information about each application (double ckick on entry) you can also see how many threads are assigned to that application and what is CPU utilization for each thread (again presented in precentage of full cpu utilization).
So I recomend for you to check how many threads are asigned to factorio when it runs. Do note that some aditional threads are shown due to windows Graphic and Sound interface. You just have to focuss on those thread which indicate that their binary is Factorio.exe.
If teere is only one thread with Factorio.exe as binary file this means Factorio is running in singlethreaded mode. So go to options and check the number of threads Factorio is supose to use.
kovarex wrote:I believe the problem might be with the vsync. I have this theory, that the youtube video has ~30fps and it forces factorio to have 30 fps vertical sync as well. In this case, chaning the game to low fps mode would solve it, but it isn't perfect as you loose the smooth 60 fps gameplay ...
I'm not sure if youtube could affect Factorio vyscnc-ing. I'll try to do some testing about this when I get home (I'll even try with some other games).

liq3
Inserter
Inserter
Posts: 38
Joined: Tue Feb 19, 2013 9:30 am
Contact:

Re: [0.9] Weird lag

Post by liq3 »

kovarex wrote:I believe the problem might be with the vsync. I have this theory, that the youtube video has ~30fps and it forces factorio to have 30 fps vertical sync as well. In this case, chaning the game to low fps mode would solve it, but it isn't perfect as you loose the smooth 60 fps gameplay ...
I might do that option to fix it... But I don't think it's a vsync problem, as it fluctuates between 35-60fps the whole time the video is playing. It often stays steady at 60fps for 10-30 seconds, or sometimes gets stuck around 45fps (with slower game speed) for several minutes.

Also it only happens while the videos are running. :< If I pause them and leave them open it stays at a steady 60fps.

Interestingly, I get the same problem if I run a large disk copy in the background (stuck at 45FPS even tho plenty of CPU). I have a feeling it might be a disk issue, but I have no idea what it might be or if it's that's even possible.

PS: Ok there's no way it's a CPU bottleneck. It only hangs around 5-10% CPU usage, including when the slowdown happens. I'll keep watching it tho.

PPS: Now this is even weirder. The issue seems to have gone away for the most part, but I still get occasional lag spikes (3-4 seconds of FPS drop).

Gammro
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Oct 09, 2013 1:45 pm
Contact:

Re: [0.9] Weird lag

Post by Gammro »

Occasional lag spikes could be the autosave. It's 2 minutes by default, I usually set it to 5-10 minutes because I get annoyed by the frequency of the spikes.
Ignore this

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9] Weird lag

Post by kovarex »

It might have something to do with replay saving. You can disable replay saving of the save by loading the mod with any mod (and you can switch it off again).

Rens2Sea
Inserter
Inserter
Posts: 46
Joined: Tue Feb 04, 2014 4:04 pm
Contact:

Re: [0.9] Weird lag

Post by Rens2Sea »

kovarex wrote:It might have something to do with replay saving. You can disable replay saving of the save by loading the mod with any mod (and you can switch it off again).
Speaking of replays, how do i watch them?

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9] Weird lag

Post by kovarex »

It is currently disabled, as there are lots of desynchronisation problems, we will have to fix as a first step of making the multiplayer.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.9] Weird lag

Post by SilverWarior »

@lig3

Can you please do the same test I recomended in next thread:
https://forums.factorio.com/forum/vie ... f=7&t=2454

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [0.9] Weird lag

Post by TheSAguy »

I seem to have this also for the first time in 9.2.
First game had a weird lag, but was playable. I stopped after about 4 hours.

The second game, my frames dropped from 60 to less than 10. The game was only an hour old, with a very small base. Got worse and worse. My save also seemed to explode in size. At last look it was over 80MB. My previous game, with a big base was less than 20MB...

I did great a post with my save.

Post Reply

Return to “Pending”