• Breaking News

    Wednesday, April 21, 2021

    Factorio I will never stop...

    Factorio I will never stop...


    I will never stop...

    Posted: 20 Apr 2021 01:45 PM PDT

    more than 20% UPS performance gain by using large tables.

    Posted: 21 Apr 2021 01:29 AM PDT

    Hi, looks like Factorio is a very good excuse to switch to Linux, especially for megabases or if you also like an uninterrupted game play (special feature of Linux to save the game during run time). And because the details about the UPS gains were hidden in two threads, with a very important detail mentioned in a comment only, here we go again:

     

    1) Install Linux

    I am using Ubuntu 20.04, installed on a SSD. I just plugged the empty drive into the system, used the live iso image I got from ubuntu.org to generate a bootable usb drive (one of the options when booting from such an usb drive), from where I installed the system on the new drive. All I had to do after that step was to set the new SSD as first boot drive in the BIOS to have the Linux boot loader screen with an option to boot Windows if needed.

    Side note: if you run into issues with the login screen (all I got was a purple screen) and you have two monitors attached to your computer - turn on the second monitor before you start searching for solutions on the internet concerning missing login prompts. This can save you some hours (GRML).

     

    2) Install Factorio.

    If possible, use the version you can get on www.factorio.com and not the Steam application, because that one adds some strange wrappers around the game which sometimes don't shut down when closing the program.

    By doing this, factorio ended in the subfolder factorio of the home folder of my user (/home/<username>/factorio/), and the game binary is located in /home/<username>/factorio/bin/x64/:

    becks@daddel:~$ ll /home/becks/factorio/bin/x64/ drwxrwxr-x 2 becks becks 4096 Apr 17 14:33 ./ drwxrwxr-x 3 becks becks 4096 Apr 13 10:02 ../ -rwxr-xr-x 1 becks becks 212212192 Apr 17 14:33 factorio* 

     

    3) open a command shell and install the default huge page support for Ubuntu

    > sudo apt install libhugetlbfs-bin 

    Not 100% sure if anything out of this package is really required, but it doesn't hurt to have it installed.

     

    4) install cmake

    > sudo apt install cmake 

     

    5) Install mimalloc

    The default memalloc program for huge pages has a bug(?) and decreases the reserved memory each time you run factorio, The outcome is visible when running factorio benchmarks where you run the same map more than once during test. Factorio gets slower each time the test is run. Mimalloc doesn't show this behavior (or at least minimizes it), plus according to the github page it is faster than the default memory allocator.

    Open https://github.com/microsoft/mimalloc , click on the code button and download the zip file. Follow the instructions on the page on how to build the binary, or:

    open a shell, change to the directory wher you saved the file and unzip it

    > cd /home/<username>/Downloads/ > unzip mimalloc-master.zip > cd mimalloc-master 

     

    6) switch to root, run the configuration program, compile the binary and install it:

    > sudo bash > cmake > make > make install 

    I got the following feedback after make install:

    root@daddel:/home/becks/Downloads/mimalloc-master# make install [ 42%] Built target mimalloc [ 48%] Built target mimalloc-test-stress [ 51%] Built target mimalloc-obj [ 94%] Built target mimalloc-static [100%] Built target mimalloc-test-api Install the project... -- Install configuration: "Release" -- Installing: /usr/local/lib/mimalloc-1.7/libmimalloc.so.1.7 -- Installing: /usr/local/lib/mimalloc-1.7/libmimalloc.so -- Installing: /usr/local/lib/mimalloc-1.7/cmake/mimalloc.cmake -- Installing: /usr/local/lib/mimalloc-1.7/cmake/mimalloc-release.cmake -- Installing: /usr/local/lib/mimalloc-1.7/libmimalloc.a -- Installing: /usr/local/lib/mimalloc-1.7/include/mimalloc.h -- Installing: /usr/local/lib/mimalloc-1.7/include/mimalloc-override.h -- Installing: /usr/local/lib/mimalloc-1.7/include/mimalloc-new-delete.h -- Installing: /usr/local/lib/mimalloc-1.7/cmake/mimalloc-config.cmake -- Installing: /usr/local/lib/mimalloc-1.7/cmake/mimalloc-config-version.cmake -- Symbolic link: /usr/local/lib/libmimalloc.so -> mimalloc-1.7/libmimalloc.so.1.7 -- Installing: /usr/local/lib/mimalloc-1.7/mimalloc.o 

    We now have the binary installed, the directory looks the following way:

    root@daddel:/home/becks/Downloads/mimalloc-master# ll /usr/local/lib/mimalloc-1.7/ total 512 drwxr-xr-x 4 root root 4096 Apr 21 08:46 ./ drwxr-xr-x 4 root root 4096 Apr 21 08:46 ../ drwxr-xr-x 2 root root 4096 Apr 21 08:46 cmake/ drwxr-xr-x 2 root root 4096 Apr 21 08:46 include/ -rw-r--r-- 1 root root 193298 Apr 21 08:46 libmimalloc.a lrwxrwxrwx 1 root root 18 Apr 21 08:46 libmimalloc.so -> libmimalloc.so.1.7 -rw-r--r-- 1 root root 144720 Apr 21 08:46 libmimalloc.so.1.7 -rw-r--r-- 1 root root 160256 Apr 21 08:46 mimalloc.o root@daddel:/home/becks/Downloads/mimalloc-master# 

     

    7) Setup the system so it uses huge pages with mimalloc as memory allocator when we run factorio.

    It is possible to store the required environment variables in the system in a way so they are added to the default variables of an user and are active all the time. I don't recommend this approach because some programs (especially web browser like Firefox or Vivaldi) don't support large pages and crash when you launch them. Instead, just add these variable whenever you run factorio.

    Open gedit (or any other text editor) and add the following content to a new file:

    #!/bin/bash LD_PRELOAD=/usr/local/lib/mimalloc-1.7/libmimalloc.so MIMALLOC_PAGE_RESET=0 HUGETLB_MORECORE=thp MIMALLOC_LARGE_OS_PAGES=1 /home/<username>/factorio/bin/x64/factorio 

    don't forget to replace <username> with your actual user name. Save the file under a name and at a place where you can find it (I stored it as fac.sh in /home/<username>). If you want, make it executable by running the command

    chmod 755 <filename> 

    Now you can launch factorio with huge page support. all you need is to open a terminal and enter the command

    bash ./<filename> 

    or just in case you made it an executable file

    ./<filename> 

     

    The options in detail:

    HUGETLB_MORECORE=thp - use transparent huge pages when running a program

    MIMALLOC_PAGE_RESET=0 - don't reset/purge pages which are in use every 100ms. Should be fine as long as factorio is not run long term (as server)

    MIMALLOC_LARGE_OS_PAGES=1 - force the usage 2MB large pages. Thois detail wasn't mentioned on the orginal thread but gives a drastic performance boost.

     

    After the first launch, while being in the start menu, don't forget to press <strg> and <alt>, then click on settings and go to the otherwise hidden menu "the rest". Enable the following options:

    cache-prototype-data

    non-blocking-saving

    8) Finally - benchmark results:

    I used a recent game (modded megabase with trains/bots, currently running at 211k SPM, saved as 60.zip in the folder where the binary of factorio is stored) for a test. First without Mimalloc:

    becks@daddel:~/factorio/bin/x64$ ./factorio --benchmark-ticks 10000 --benchmark-runs 3 --benchmark-sanitize --benchmark 60.zip Performed 10000 updates in 193851.420 ms avg: 19.385 ms, min: 15.399 ms, max: 619.842 ms checksum: 882541605 Performed 10000 updates in 195933.421 ms avg: 19.593 ms, min: 15.858 ms, max: 604.858 ms checksum: 882541605 Performed 10000 updates in 199070.816 ms avg: 19.907 ms, min: 16.155 ms, max: 603.291 ms checksum: 882541605 

    Average: 19.628 ms

    Now with Mimalloc:

    becks@daddel:~/factorio/bin/x64$ LD_PRELOAD=/usr/local/lib/mimalloc-1.7/libmimalloc.so MIMALLOC_PAGE_RESET=0 HUGETLB_MORECORE=thp MIMALLOC_LARGE_OS_PAGES=1 ./factorio --benchmark-ticks 10000 --benchmark-runs 3 --benchmark-sanitize --benchmark 60.zip Performed 10000 updates in 149309.618 ms avg: 14.931 ms, min: 11.987 ms, max: 349.357 ms checksum: 882541605 Performed 10000 updates in 150623.894 ms avg: 15.062 ms, min: 12.249 ms, max: 335.546 ms checksum: 882541605 Performed 10000 updates in 154670.223 ms avg: 15.467 ms, min: 12.517 ms, max: 337.171 ms checksum: 882541605 

    Average: 15.153 ms or only around 77% of the time required to calculate the game without using huge page support.

    And with Mimalloc plus page reset turned off:

    becks@daddel:~/factorio/bin/x64$ MIMALLOC_PAGE_RESET=0 LD_PRELOAD=/usr/local/lib/mimalloc-1.7/libmimalloc.so HUGETLB_MORECORE=thp MIMALLOC_LARGE_OS_PAGES=1 ./factorio --benchmark-ticks 10000 --benchmark-runs 3 --benchmark-sanitize --benchmark 60.zip Performed 10000 updates in 149071.848 ms avg: 14.907 ms, min: 11.960 ms, max: 333.631 ms checksum: 882541605 Performed 10000 updates in 150228.250 ms avg: 15.023 ms, min: 12.008 ms, max: 336.240 ms checksum: 882541605 Performed 10000 updates in 150309.885 ms avg: 15.031 ms, min: 12.070 ms, max: 349.371 ms checksum: 882541605 

    Average: 14.987 ms or only around 76% of the time required to calculate the game without using huge page support and another 1% gain compared to the one which uses page resets.

    Not too bad. o/

    submitted by /u/becks0815
    [link] [comments]

    My world generated like this, perfect fit for my labs

    Posted: 21 Apr 2021 03:56 AM PDT

    Introducing Minesweeper! Map Expansion by Puzzle Solving! KABOOM!!

    Posted: 21 Apr 2021 05:38 AM PDT

    To see exact item counts, use an arithmetic combinator with Each % 1000

    Posted: 21 Apr 2021 06:41 AM PDT

    2nd Playthrough, went into this one vowing to start organized........but it wasn't long before I was cooking my favorite familiar pasta. But, hey its a hell of a lot better than my first spaghetti nightmare!

    Posted: 21 Apr 2021 05:21 AM PDT

    My first train system is working smoothly!

    Posted: 21 Apr 2021 12:26 AM PDT

    I finally got No Time for Chitchat! Now how hard will There is No Spoon be?

    Posted: 20 Apr 2021 05:08 PM PDT

    Factorio is so hard!!!

    Posted: 21 Apr 2021 04:58 AM PDT

    My company uses Factorio for leadership training and in all honest I am so lost ... we have had quite a few sessions now and here what I need to complete today:

    1. Rollover] Research on technologies required to build a Roboport, Construction and Logistics robots
    2. Build a Roboport and some robots
    3. Research on technologies required to build the blueprint https://factorioprints.com/view/-LCQOHzGAAeN8-Aqe6Su
    4. Build the blueprint https://factorioprints.com/view/-LCQOHzGAAeN8-Aqe6Su Secondary Objectives The following objectives are optional - complete if time permits!
    5. Replace all existing furnaces with Electric such

    Any tips to share with me to get better at the game?

    submitted by /u/Worried-Rise2529
    [link] [comments]

    Recommended settings

    Posted: 21 Apr 2021 06:46 AM PDT

    I have the following mods installed: - spacex (and its dependencies) - rampant - some quality of life mods

    And i want a fun challenge but dont wanna make things too hard or overcompensate for the increased difficulty.

    Edit: i would also like to know wether or not to use rampants new biters or not.

    submitted by /u/random_uman
    [link] [comments]

    You can never have enough bots - 30kspm bot only!

    Posted: 20 Apr 2021 01:04 PM PDT

    Looking for Factorio friends

    Posted: 20 Apr 2021 04:11 PM PDT

    I am not sure if this is appropriate here, so let me know if not.

    I am trying to make some friends for gaming and not having a lot of luck. I guess I've been looking in the wrong places, so I figured I should look at the community for a game I've actually played. It's been a while since I've played but I'd love to helpwork on some things with people and pick up some tips. I guess later game stuff gets overwhelming for me and I've been pretty stressed lately and can't focus on it.

    I'd appreciate even just finding some people to join in and help out or even just see your build and chat. Mostly I'm trying to have some people to talk to and spend time with and see more later game stuff but mostly to help with the corona isolation blues. I'd love to talk about the game or mods or learning to mod. I am trying to learn more about programming and raspberry pi, love Star Wars and sci-fi, science and space, so any of that is a good place to start.

    Let me know if you'd be interested. Please introduce yourself a bit, more thank just dropping a discord name. I'm pretty shy and not good with introductions so it'd help to psych myself up if I know something about you. Thanks.

    Edit: I forgot. I am US eastern time and available most evenings and weekends.

    Discord is monkeyfett8#9223

    submitted by /u/janovich8
    [link] [comments]

    space exploration monitor items per planet

    Posted: 21 Apr 2021 04:28 AM PDT

    Hi

    Playing space exploration looking for information / module about the state of resources/items, but per planet.

    I have a situation where on planet A I am extracting, for example, coal, and I supply and consume it on planet B. The general view of the resources does not give me information that I am running out of coal on planet B.

    I am looking for a mod, a way to monitor a number of items per planet.

    submitted by /u/No_Character_7995
    [link] [comments]

    Excess gas?

    Posted: 21 Apr 2021 07:41 AM PDT

    So I've just started playing with Bob's Mods, and needed oxygen for steel plates. Problem is production keeps halting because the small storage tanks i'm putting the hydrogen in keep filling up. I've read that theres a gas vent i can use to vent excess gas, but I can't find anything in research, or in what I can currently make like that. Can someone tell me how I get rod of the excess hydrogen or some other suggestion what to do with it please?

    submitted by /u/TheRealMeanie
    [link] [comments]

    Curious behaviour that I just wanted to point out, I assume it's intentional, but base inserters cannot pick items off of the inside of a turning belt.

    Posted: 20 Apr 2021 01:43 PM PDT

    Anybody that can think of a better train to train design for rails?

    Posted: 20 Apr 2021 10:16 AM PDT

    How do you do your train to main bus unloading?

    Posted: 21 Apr 2021 03:35 AM PDT

    I'm a newbie currently researching feeding the main bus from trains.

    To my current knowledge, all to-bus unloaders can be broadly divided into two groups: with trains facing parallel to the bus lines and perpendicular. Perpendicular requires good planning in order not to run out of space.

    Parallel, unless done with bots, is tricky to make inline (i.e. each station corresponds exactly to each line of the bus in width), unless you use super-compact (and possibly low-performance) unloaders or sacrifice compactness (making bus lines wider-spaced to line up with the stations). If not inline, unloaders require non-tileable Z-shaped "adapters", which again require good planning so you don't run out of gap space between the stations and the factory itself.

    How do you do your unloading from trains onto your main bus? Except robots, of course.

    submitted by /u/Cheetah97
    [link] [comments]

    If anything ever produces more than 1 recipe per tick, how does the game handle this?

    Posted: 21 Apr 2021 03:05 AM PDT

    If I research mining productivity 1190, one drill will produce 60 ore per second. If I then research one more level, the drill will be making 60.05 ore per second. How does the game handle this? Does it create 1 ore on every tick, but creates 2 ore every 20th tick? Drills don't have inventories, how does that even work? What would happen if I speed up a drill so much that it makes more than a stack of ore per tick?

    submitted by /u/MediocreMeat
    [link] [comments]

    Don't let Spidertron auto-target nukes

    Posted: 20 Apr 2021 02:35 PM PDT

    That's all. If you're going to equip nukes, turn off auto-targeting.

    Also, I left my Spidertron on "Auto targeting without gunner" and logged out of a server game; while I was away it got excited and nuked a bug (at close range, and thus nuked itself). So now I'm gonna try and remember to un-equip nukes before logging out. Really only equip them when I'm going out clearing bugs and otherwise only keep plain missiles equipped.

    submitted by /u/brianolson
    [link] [comments]

    Finding any disused stations

    Posted: 21 Apr 2021 04:19 AM PDT

    It's got to the point now where I've lost track of the stations on my network a bit. I went on a bit of a building spree, and just can't remember which ones have trains using them and which I've simply forgotten.

    Short of watching each station, or clicking on each, is there a way to see stations that have no trains calling at them?

    I'm aware of the Trains Menu (shortcut O) but that seems to show a count of stations which are the next stop for a train - rather than those where a bunch of trains just left (for instance).

    Alternatively, is there a way to the "next" station from the detailed station view? or to go from the detailed station view "back" to the main trains (O) view?

    submitted by /u/Cleverbum
    [link] [comments]

    Factorio song

    Posted: 21 Apr 2021 02:42 AM PDT

    16gb ram usage and 10mins load times

    Posted: 20 Apr 2021 11:51 AM PDT

    No comments:

    Post a Comment