Friday Facts #115 - The power switch
Friday Facts #115 - The power switch
The power switch in action and more: https://www.factorio.com/blog/post/fff-115
Re: Friday Facts #115 - The power switch
Do you have an estimate of the .13 extra experimental release date? Also will there be a way to measure the electricity consumption graphs?
Keep up the great work!
Keep up the great work!
No, I'm not a piece of cheese!
Re: Friday Facts #115 - The power switch
Posts about your code always make me so curious. How about gimme access so I can snoop around a little, kthxbye
OS: Linux Mint 19 x64 | desktop: Awesome 4.2 | Intel Core i5 8600k | 16GB DDR4 | NVidia GTX 1050 Ti (driver version: 410.104) (2019-03)
Re: Friday Facts #115 - The power switch
Open source factorio !
I hope it would be a thing, but only well after they squeezed all the money from Factorio.
I hope it would be a thing, but only well after they squeezed all the money from Factorio.
Re: Friday Facts #115 - The power switch
Which "modules proposal" and "unity build"?P.S. I know about the modules proposal, but it will take years until it gets to standard and implemented. Unity build is another thing on my list to try out.
Re: Friday Facts #115 - The power switch
There is EASTL, which is an std-like library.
And are you building incrementally for testing?
Edit: Except you might want to make sure that EASTL has an appropriate license. (GPL might have some interesting side effects)
And are you building incrementally for testing?
Edit: Except you might want to make sure that EASTL has an appropriate license. (GPL might have some interesting side effects)
-
- Burner Inserter
- Posts: 16
- Joined: Fri May 22, 2015 12:55 pm
- Contact:
Re: Friday Facts #115 - The power switch
OOI what does your build hardware look like?
-
- Fast Inserter
- Posts: 180
- Joined: Tue Jan 20, 2015 7:49 pm
- Contact:
Re: Friday Facts #115 - The power switch
I love the crackly effect inside the switch!
FactoriOh No: when it's accidentally 2am, again
- Xterminator
- Filter Inserter
- Posts: 981
- Joined: Sun Jun 15, 2014 4:49 pm
- Contact:
Re: Friday Facts #115 - The power switch
Awesome! Power switch looks really cool, I can't wait to see what kind of stuff people end up doing with that when connected to the circuit network.
Re: Friday Facts #115 - The power switch
I used the following workaround for long compile times when developing some small games (granted, factorio is much more complex): I combine all my cpp files in a single file (either with cat or #include) and I compile them as a single source. This way you only pay the cost of library inclusion only once. You do pay more for the actual code generation but with -O1 it's not a problem.
That does require though that you have no name collisions.
I had a 10 second compile time for my game (I wouldn't touch boost with a 10 foot pole though so maybe that was part of it).
You could generalize this to a small number of modules, each of which is compiled monolithically, to keep all your cores busy.
That does require though that you have no name collisions.
I had a 10 second compile time for my game (I wouldn't touch boost with a 10 foot pole though so maybe that was part of it).
You could generalize this to a small number of modules, each of which is compiled monolithically, to keep all your cores busy.
Re: Friday Facts #115 - The power switch
Hey, compiling can be a lot of fun!Compilation times in C++ suck. The fact that I have to wait 3 and half minute whenever Factorio is recompiled makes me impatient and ineffective.
My mods
Re: Friday Facts #115 - The power switch
I expected the little lever on the bottom left of the switch would move as well when you togglethe switch on or off
Re: Friday Facts #115 - The power switch
I don't know how Wube's build environment is set up, and I'm almost afraid to ask, but, here's some stuff I've used in the past to make compilation take much less time.kds71 wrote:Hey, compiling can be a lot of fun!Compilation times in C++ suck. The fact that I have to wait 3 and half minute whenever Factorio is recompiled makes me impatient and ineffective.
https://github.com/distcc/distcc
https://ccache.samba.org
Anything that offloads tasks to much bigger computers. What about continuous Integration? Do ya'll do that?
https://blogs.aws.amazon.com/applicatio ... Amazon-ECS
Re: Friday Facts #115 - The power switch
Will we get an option to turn on/off the switch based on % of available power in accumulators? Being able to turn off part of the factory when power runs low would be very helpful.
-
- Inserter
- Posts: 30
- Joined: Thu Feb 20, 2014 8:59 pm
- Contact:
Re: Friday Facts #115 - The power switch
A few ideas to increase compile speed:
1. Turn down optimization levels. Optimizing away templates takes a lot of grunt.
2. Try clang for faster test builds (http://www.phoronix.com/scan.php?page=n ... px=mtgznde)
3. Rent a big computer in the cloud. AWS has 36 core computers with 60G RAM for example.
1. Turn down optimization levels. Optimizing away templates takes a lot of grunt.
2. Try clang for faster test builds (http://www.phoronix.com/scan.php?page=n ... px=mtgznde)
3. Rent a big computer in the cloud. AWS has 36 core computers with 60G RAM for example.
Re: Friday Facts #115 - The power switch
I worked on a project for a hospital.
If we wanted to compile for a release or the first time we had a compile time of 10~15 minutes at most we where looking at 20 minutes.
that was us compiling about 1.5GB of source code.
when we working on a feature/bug and we needed to compile to test said feature/bug we where never waiting for more then 5 seconds. and that was including the time we had to wait to install it all.
when we used any thing from boost and or std we pointed to that explicitly, so if we needed string from std for example, we used:
also make sure you prevent your headers form being included more then once it helps a ton:
in your .h/.hpp
if you are already doing that make sure you call make with the option -j4 you can call up to -j8 if you have a quad core with multi threading.
if you are also doing that.... I really want to take a look at your code.... because this is interesting to me....
on the topic of the switch:
that is an awesome looking switch. but I am wondering? why the sparks... makes me feel like the connection is not sound...
If we wanted to compile for a release or the first time we had a compile time of 10~15 minutes at most we where looking at 20 minutes.
that was us compiling about 1.5GB of source code.
when we working on a feature/bug and we needed to compile to test said feature/bug we where never waiting for more then 5 seconds. and that was including the time we had to wait to install it all.
when we used any thing from boost and or std we pointed to that explicitly, so if we needed string from std for example, we used:
Code: Select all
#include <string>
using std::string;
in your .h/.hpp
Code: Select all
#ifndef __FILENAME_HPP__
#define __FILENAME_HPP__
// your header code here
#endif //__FILENAME_HPP__
if you are also doing that.... I really want to take a look at your code.... because this is interesting to me....
on the topic of the switch:
that is an awesome looking switch. but I am wondering? why the sparks... makes me feel like the connection is not sound...
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Friday Facts #115 - The power switch
use "#pragma once" if your compiler supports it
Does the compiler include the expanded template in a compiled header if you typedef it? (something to profile) If so then you can put the typedef for every template you use in the compiled header.
Otherwise you can sub out the typedef for std::string (which is a template) with the specific std::string and remove the std version from the include path.
Does the compiler include the expanded template in a compiled header if you typedef it? (something to profile) If so then you can put the typedef for every template you use in the compiled header.
Otherwise you can sub out the typedef for std::string (which is a template) with the specific std::string and remove the std version from the include path.
Re: Friday Facts #115 - The power switch
I'd go with some of the suggestions already, more hardware, better compile options, header optimizations. I'm anti-boost. The whole library sucks to be honest. I write my own stuff, I try not to use some one elses code. But if your set on using boost, then just cut and paste the classes that you use from it into your own source code tree. It shouldn't take too long tbh.
Re: Friday Facts #115 - The power switch
I've learned really lot from Casey about compile time optimization: https://www.youtube.com/watch?v=Ee3EtYb8d1o
It seems ridiculous first, but I've tried to reorganize one of my projects this way, and well, got compile time down to 4-5 seconds from 3 minutes.
It seems ridiculous first, but I've tried to reorganize one of my projects this way, and well, got compile time down to 4-5 seconds from 3 minutes.