Page 1 of 1
[0.9] Weird lag
Posted: Mon Feb 17, 2014 2:32 am
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.
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 8:51 am
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.
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 10:30 am
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%.
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 12:22 pm
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 ...
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 1:24 pm
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).
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 1:32 pm
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).
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 4:03 pm
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.
Re: [0.9] Weird lag
Posted: Mon Feb 17, 2014 4:41 pm
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).
Re: [0.9] Weird lag
Posted: Thu Feb 20, 2014 4:17 pm
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?
Re: [0.9] Weird lag
Posted: Thu Feb 20, 2014 4:47 pm
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.
Re: [0.9] Weird lag
Posted: Fri Feb 21, 2014 7:31 am
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
Re: [0.9] Weird lag
Posted: Mon Mar 10, 2014 2:26 am
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.