Page 1 of 2
[0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 9:22 pm
by ssilk
This is strange, but what I've seen is this: I could play Factorio 0.12.35 some hours with my MacBookPro on batteries. It had been normally warm during that time. The ventilators summed a bit, but nothing disturbing, even if the game needed really much CPU. It would be only louder/hotter when loading/saving, when two CPUs are used.
Now with 0.13 I observe, that Factorio uses much more (CPU-)power: The fan turns up to 80% speed, it uses more power, the whole PowerBook becomes quite hot, the accu drains much faster. What I can see is, that Factorio uses 100-120% CPU (of 4 CPUs) all the time, that means: one CPU runs all the time at full speed, without wait cycles - even if I'm in the very early game.
This happens with or without mods.
Maybe some forgotten sleep(), some debug-code?
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 9:31 pm
by Rseding91
sleep() in the main loop is inaccurate and doesn't work to keep a constant 60 UPS. It was changed to busy-wait so we can maintain accurate times. That's by design.
You'll need to plug in the laptop

Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 9:48 pm
by m44v
Rseding91 wrote:sleep() in the main loop is inaccurate and doesn't work to keep a constant 60 UPS. It was changed to busy-wait so we can maintain accurate times. That's by design.
You'll need to plug in the laptop

It doesn't seem like a good trade off though?
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 9:58 pm
by ssilk

well, I can plug it in, but - seriously - that still keeps the issue, that the fans are then so loud, that it is not possible to play with it any more. For me a large step back.
So I keep on saying it's a bug, cause you can also wait in a way, so that the sleep() wakes up long enough before the 1/60 second is reached (to save power) and only the remaining microseconds it actively waits.
You can save some CO2 emissions with it, less pollution, more green forests, it reduces the evolution factor, less biters... uhhmmm..

Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 10:10 pm
by Kayanor
Do you use headphones?
ssilk wrote:You can save some CO2 emissions with it, less pollution, more green forests, it reduces the evolution factor, less biters... uhhmmm..

But you can't test your power supplier if their generators are enough to power laser turrets.

Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Mon Jul 25, 2016 10:19 pm
by ssilk
Kajanor wrote:Do you use headphones?

Well, I can play of course with ear-plugs. But it's not this. My partner complained, and I need to say: She is right! The laptop is then so loud, that you will have problems to hear the TV. It is quite disturbing in a living room. And compared to as it was before it is really not acceptable. MacBooks are known for this behavior: they are normally quite silent, but if you use really much CPU they sound like a Boing.
ssilk wrote:You can save some CO2 emissions with it, less pollution, more green forests, it reduces the evolution factor, less biters... uhhmmm..

But you can't test your power supplier if their generators are enough to power laser turrets.

I need a mod, that could use the accumulator-power from the laptop in the case, that the game-accus are empty.

Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Thu Jul 28, 2016 7:10 pm
by kinnom
luckily(for me) itisonly mac. My Dell XPS M1210 still has a stable cpu temp of 78-83 C
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 7:37 am
by dee-
Busy waiting is "Bug by design".
I also fail to see which problem you tried to solve with that from 0.12
You already did a "sleep(millisecondsPerCycle - (now() - timeOfLoopBegin)" ?
You can also spawn a lightweight thread that only does a "sleep(millisecondsPerCycle)" and then opens the mutex, which the normal update thread runs into and waits until rewoken by the first thread.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 9:18 am
by Rseding91
dee- wrote:Busy waiting is "Bug by design".
I also fail to see which problem you tried to solve with that from 0.12
You already did a "sleep(millisecondsPerCycle - (now() - timeOfLoopBegin)" ?
You can also spawn a lightweight thread that only does a "sleep(millisecondsPerCycle)" and then opens the mutex, which the normal update thread runs into and waits until rewoken by the first thread.
Sleep in computers is not accurate - that's the issue. When you call "sleep for X" it sleeps for a *minimum* of X and then probably some extra. That probably some extra is the issue - it makes the update loop imperfect and it fluctuates between 59 and 61 rapidly.
http://gameprogrammingpatterns.com/game-loop.html
http://gamedev.stackexchange.com/questi ... on-windows
http://gamedev.stackexchange.com/questi ... sleep?rq=1
http://gafferongames.com/game-physics/f ... -timestep/
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 9:56 am
by dee-
Hm. Where have the good ol' times of IRQ8 gone to?
Maybe as a bandaid sleep for 50 and busy wait the last 10?
If you really need such an exact timer, you probably depend on a proper realtime operating system.
I wonder how everybody else (demoscene, games, latency-measure-tools) does this...
Hm, there's
Periodic Processing With Standard C++11 Facilities.
Anyway, I'm way out of my leagure here

Thx for the linked articles.
/signing off
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 10:05 am
by ssilk
Rseding91 wrote:Sleep in computers is not accurate - that's the issue.
I must say this:
It's now some days, that I reported this and I slept some days over this, so what I have to say is not just a feeling as in the beginning.
I repeat:
My problem is, that the mac becomes too hot to put it on the lap and that it becomes too loud to play in living room.
I've tried several things to fix this problem, for example I plugged earphones, I put it on a pillow, I quit all other programs, I even cleaned the fans...

But I still cannot play in the same room, where others live, cause that is too disturbing; the reason is in Factorio. The second issue with this is, that is now not longer possible to play when you are traveling and have no power plug.
In short:
- too loud in normal home surroundings.
- too hot on laptops (O.K. I've no proof for other Laptops than MacBook).
- not playable without power plug.
- [waste of electric power and global heating

, but that is a bad/stupid argument.]
And the point is:
This was possible before 0.13.
So my conclusion is,
- this issue is a bug,
- cause here something has been fixed, which was in my eyes not a bug, but a feature (had there been bug reports about the incorrect timing? I didn't find anything? Is there really the need for being so exact or is it just a graphical issue/glitch?) and
- cause there are several simple solutions possible to fix this, that it runs silent/cold again. (*)
Cause of that reasons I moved it back from Not a bug to bugs.
(*) Possible solutions see above. Another option would also be a configuration switch between new exact timing and old sleeped timing.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 10:15 am
by Rseding91
I also have a laptop and experience no such issues with high CPU temps and loud fans which means high CPU temperature in your laptop causing the fan to run at high speeds is an issue with your laptop. Factorio is just using the computing resources available on the hardware its running on.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 11:13 am
by ssilk
But that it runs on
your laptop, doesn't mean, that it isn't a problem for others. It doesn't mean, that it is no bug if something works for you or that you cannot imagine the difference in loudness.
Yes, perhaps it's a Mac specific problem. But see topic. As said: I haven't tested it seriously enough on other laptops to say anything about that.
But then this
remains a bug. And for me there is no other logical conclusion, cause with 0.12 it's playable in that surroundings, with 0.13 it is not.

Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 11:17 am
by Rseding91
ssilk wrote:But that it runs on
your laptop, doesn't mean, that it isn't a problem for others. It doesn't mean, that it is no bug if something works for you or that you cannot imagine the difference in loudness.
Yes, perhaps it's a Mac specific problem. But see topic. As said: I haven't tested it seriously enough on other laptops to say anything about that.
But then this
remains a bug. And for me there is no other logical conclusion, cause with 0.12 it's playable in that surroundings, with 0.13 it is not.

A bug is a defect in the software. The software is running exactly as desired - no bug. Your laptop running hot is an issue with your laptop and it not being able to properly cool when running CPU intensive programs.
Often that kind of heat issue can be caused by the thermal paste on the CPU drying out. How old is the laptop? Have you ever had the paste replaced? If not, that could fix the issue.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 11:59 am
by ssilk
Rseding91 wrote:A bug is a defect in the software. The software is running exactly as desired - no bug.
Well, that is not correct. A software bug is, if software does not things, that's awaited. Yes. But also if it does does things, that are not awaited. Like in this case.
Your laptop running hot is an issue with your laptop and it not being able to properly cool when running CPU intensive programs.
So please explain me: Why has it been running with 12 Gigabyte Megafactory without noise/heat in 0.12? It runs at 20 ups, nearly 100% CPU. I could play 4 hours without charging. The CPU runs silent. Etc. Allready all explained.
NOW it doesn't even reach 60 ups, when running on blank new game. CPU runs hot.
See screenshot

- Screen Shot 2016-07-29 at 13.48.58.png (3.96 MiB) Viewed 6374 times
All mods turned off.
Often that kind of heat issue can be caused by the thermal paste on the CPU drying out. How old is the laptop? Have you ever had the paste replaced? If not, that could fix the issue.
Thanks for such advice, but this is a level of discussion I would like to avoid.
As said I opened it yesterday to clean and check everything. Also that above. There is no hardware problem. I use this laptop the whole day, 8-14 hours a day, which includes, that I don't use it only for playing games.
EDIT: Now when I think about it I need to say, that it runs with only 30 ups is new. I think with 0.13.9 or so it was 60 ups.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 1:12 pm
by Rockstar04
I agree with ssilk, this is not worth the side effects. Laptop, Desktop, Battery or plugged in, no program should monopolize an entire CPU core just because it can.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 1:39 pm
by Klonan
The excessive CPU and workload is being looked at, but im afraid it might be a lot more difficult to fix
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 2:39 pm
by Rockstar04
Klonan wrote:The excessive CPU and workload is being looked at, but im afraid it might be a lot more difficult to fix
I'm not sure what needs to be looked at, the exact cause has been clearly stated in this very thread already. What exactly was that change targeted at fixing? Were there many cases of that time variation causing frequent desyncs? If not then it seems like a premature jump for perfection that had major negative side effects.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 2:42 pm
by steinio
What speaks against a CPU at full load.
Empty RAM and low CPU usage is a waste of ressources.
Re: [0.13.10] MacBookPro: CPU is much hotter than with 0.12
Posted: Fri Jul 29, 2016 3:08 pm
by Rockstar04
steinio wrote:What speaks against a CPU at full load.
Empty RAM and low CPU usage is a waste of ressources.
I'm a server admin by trade, and while underutilized resources can be wasteful, I have monitoring systems that will wake me up in the middle of the night if any of my servers are running at over 90% cpu utilization. As far as I'm concerned, any program that tries to consume all of a systems resources just because it can is a flawed program, and needs to be fixed.