Factorio My Inroduction to Optimization class uses Factorio as an example of linear optimization


My Inroduction to Optimization class uses Factorio as an example of linear optimization

Posted: 05 Sep 2018 10:02 AM PDT

Why is FPS always <= UPS in Factorio?

Posted: 04 Sep 2018 11:41 PM PDT

It has been asked multiple times why FPS in Factorio can't run higher than UPS and I thought I would do a technical write-up as to why.

The way Factorio works the entire update cycle is deterministic. This has some nice benefits from a testability perspective and is required for Factorio multiplayer to work. More on that here and here

The rendering process goes something like this:

  1. While the game update is paused divide the visible portion of the world into horizontal strips 8 tiles tall

  2. Start as many threads as needed (as possible) to process each world strip

  3. Each thread scans the world strip and finds entities in that strip it should render collecting render data (position, what to draw, and so on) for each entity found

  4. Once all threads finish start the next game update (if needed) and in parallel start rendering the collected render data to the GPU (more on that here)

With the update cycle being deterministic that indirectly leads to rendering being deterministic. The game doesn't do any kind of interpolation of entity positions last frame vs current or anything like that. Every frame position, every rotation, every angle, color, and sprite drawn is derived from the deterministic game state each frame in the above process. This means that you won't see anything like z-fighting, sprites flickering between one and another while on the same position, or any kind of visual oddity when looking at a single static portion of the world (unless we did something wrong - which is always possible).

This also means if you don't call update() on the game state to tick the world that the information you get from the last time you ran the render logic will be identical. That is ultimately why Factorio doesn't let FPS run > UPS: because it would spend all of the extra time collecting render data only to render a pixel-for-pixel copy of the last frame. It would effectively spend twice as much time rendering for no visual difference.

Now, with all of that being said: what I think people are actually asking for when they ask to let FPS run > UPS is to let input handling run > FPS and or UPS - which is something that we could feasibly do in 0.17 with the graphics engine rework and something I want to look into.

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

This Factorio restaurant IRL

Posted: 05 Sep 2018 04:31 AM PDT

A complex system that works is invariably found to have evolved from a simple system that worked.

Posted: 05 Sep 2018 07:28 AM PDT

A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a working simple system. – John Gall

Found d this quote in my got training docs. I think it is good advice for this game.

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

Is it time for an ultrawide monitor?

Posted: 05 Sep 2018 05:55 AM PDT

Is there a benefit to speed modules if space unlimited?

Posted: 05 Sep 2018 10:58 AM PDT

Relatively new player (on my 4th factory). I have never really liked going back and trying to fit beacons into my earlier designs to accommodate speed modules. However I figure there is no advantage to them over simply building more buildings (unlike productivity modules - yay free stuff).

Am I missing something?

I should point out I play peaceful mode so the space really isn't an issue. I imagine with biters about there is more incentive to keep it compact.

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

Second run through and managed to tick off a few achievements!

Posted: 05 Sep 2018 04:40 AM PDT

18 hrs in, maybe I should get steel production started

Posted: 05 Sep 2018 04:30 PM PDT

What's up with the captcha on factorio.com?

Posted: 05 Sep 2018 03:18 PM PDT

I can't login to download any mods anymore because the captcha check keeps failing. Been trying all evening. Is anybody else having this problem?

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

My use of Filter Splitters is getting quite claustrophobic...

Posted: 05 Sep 2018 05:53 PM PDT

Rate my train network (kinda guide as well)

Posted: 05 Sep 2018 10:49 AM PDT

Rate my train network (kinda guide as well)

Haven't seen this type before, so I want to share my creation and maybe ask for improvements. Created Reddit account just for this post, also I am non English speaker, so excuse me for possible mistakes and misunderstandings ;)

In short: loading stations output the number of trains, which can be loaded, by red wire; unloading stations output the number of trains, which can be unloaded, by green wire; depots compare signals and request the lower number of trains (between red and green wire signals) for delivering resource.

More detailed explanation with screenshots (I use word "then" meaning result of combinator operation, output signal):

1) Loading station (materials)

https://i.redd.it/48sh2hdxigk11.jpg

Contents of chests related to one of the wagons (signal "each") divided by maximum resource capacity of one wagon (exact numbers depend of stack size), output signal A. It means number of wagons section A of a train station can load. Same operation is happening in section B, outputting signal B.

Stack size Chests capacity per section Capacity of one wagon
50 28800 2000
100 57600 4000
200 115200 8000

Then decider combinators compare signals from sections: simply if A<=B, then A; if A>B, then B (find the lowest value signal). Finally arithmetic combinator convert signal to appropriate resource signal: A or B (from previous step)+0, then, for example, iron plates equal input count.

2) Unloading station (materials)

https://i.redd.it/glmj154yigk11.jpg

Somewhat similar logic to loading station: contents of chests minus maximum capacity of chests, then negative signal zero (any signal really, doesn't matter); signal zero multiply by -1; then signal zero (convert to positive number, as); signal zero divided by maximum capacity of wagon, then signal A (as writing this part, I see I could divide by negative maximum capacity of wagon, excluding previous step). Same for section B (output signal B). To prevent situation when chests are empty therefore combinators won't get any signal, each section have decider combinator: if "everything" equal 0, then signal zero=1. Just for making combinators work. And in the end by comparing signals A and B (check my loading station explanation) we get number of trains unloading station can receive in green wire network.

3) Loading station (fluids)

https://i.redd.it/vjqps5wyigk11.jpg

Contents of 3 tanks in each section divided by 25k (fluid wagon) gives signal A and B. Other than that, same mechanism from material loading station.

4) Unloading station (fluids)

https://i.redd.it/s2d0ubdzigk11.jpg

3 decider combinators checks fluid level for each section: if "everything"=0, then A=3; if "everything"<=25k, then A=2; if "everything"<=50k, then A=1. Other than that, same mechanism from material loading station.

5) Other notes on stations

As you probably see from screenshots, I am using setup in stations to equalize input/output. Not designed by me, but they are exceptionally great, I would say (can't remember author, sorry). Explanation for loading: contents of chests in one section divided by minus 12 (total number of chests per wagon), then signal "each" to all inserters of the section by green wire; every inserter connected with its chest by single red wire (not all of them at once). So we have inserters check if their chest filled in below average, then work (condition "everything<0, then enable"). For unloading simply connect all inserter to work if "everything=0", so they will extract items simultaneously.

Overall design of fluid loading station was found on forums, it is the best one from what I saw. I only add "fluid splitter" consist of two pumps with condition everything>400, then enable (internal buffer of one pump equal 200), which again not my idea, but it makes sense. On the other hand, fluid unloading station (aka monstrosity) was designed from scratch. And now I can't even fully understand what I've done here…In general, pumps cycle fluid in a loop to ensure each tank have equal amount. There is stand out tank for pumping fluid from station. Still looking for better setups and improvements.

Each station is enabled if it can load/unload each wagon of the train (combinators: if A>0, then signal zero=1; if B>0, then signal zero=1; if signal zero=2, then green square=1; station enable if green square>0).

6) Depot control unit

https://i.redd.it/l28r8xa4jgk11.jpg

In setup on screenshot we have 6 blocks, each similar again to other "compare circuit": resource signal from red wire +0, then signal A; resource signal from green wire +0, then signal B; If A<=B, then A; if signal A>B, then B; A or B +0, then resource signal equal input count, outputting into separate wire (in my case green) depot network (currently I have 2 depots, so I connected their networks).

Trains have route with conditions: Depot - wait 5 seconds for refuel AND circuit condition "resource signal >=X (index number of the train, for example, I have 10 trains for iron ore, then x=from 1 to 10); Train station "resource in" – wait until inventory full; Train station "resource out" – wait until inventory empty.

Blueprint book: https://pastebin.com/HFxfWwef

Example how the whole system work:

1) Because of mistake in production line, chests in section A of loading station can fill only 2 wagons with iron plates, when section B provides materials for 14 wagons. So in red wire there will be signal "iron plates=2", to prevent trains eventually stack due to wait condition "until inventory full".

2) Because of mistake in consumption line, chests in section B of unloading station have space for 5 wagons with iron plates, when section B completely empty, therefore have space for 14 wagons. So in green wire there will be signal "iron plates=5", to prevent trains eventually stack due to wait condition "until inventory empty".

3) In depot's wire network we will have signal "iron plate=2", because 2<=5. Of all 10 trains with circuits conditions: iron plates>=1 for first one, iron plates>=2 for first second one…etc to iron plates>=10 for last one, - only first and second train depart from depot for delivering iron plates.

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

What is wrong with my fluid wagons?

Posted: 05 Sep 2018 05:00 PM PDT

I have a 15 cart train that's carrying heavy oil. The train IS on automatic mode and is set to leave my oil reserve when the inventory is full. Whenever the train stops at the oil reserve, the pumps pump every single wagon with 25k oil except ONE wagon that is at 24k. Just a drop away from 25k, throwing my whole system out of whack, causing irritating power outages. What is the problem here?

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

Interpreting the results from the kirkmcdonald site: am I doing it right?

Posted: 05 Sep 2018 11:45 AM PDT

So I am making outposts to build science and train the output into my lab area for research. I have chosen the arbitrary goal of making 1 blue belt of science at my outpost. Red and Green were easy, blue is much more challenging, as we all know. So I went to the Kirk McDonald site, set the defaults to assembler 3, blue belt, and 12 beacon (24 speed 3). Told it I wanted to make 40 items/sec of blue science. Here is what it gave me. I like the visualize view as it tells me I need to feed 286 iron plates/sec into 6.6 assemblers to make the required number of miners to support this. If I take that 286 plates/sec and divide that by the capacity of a blue belt I get 7.15 blue belts of iron plates. Is this right?

In a 12 beacon build its not really possible to get a blue and a red belt of iron to each assembler so I should round this up to 8 assemblers and over-produce miners (which I am not really worried about)?

For completeness I need 3.5 blue belts of gears and 2.15 blue belts of green circuits to support this.

I want to make sure I am taking the information it is giving me and translating that into a design.

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

How can you make trains skip stations ?

Posted: 05 Sep 2018 03:06 AM PDT

So i've been tryin to learn circuitry but couldnt figured out my self nor there is any useful help exactly on this subject that i saw so far.

My problem is i have a train which goes to 14 stations by itself (for now, planning to expand it) it is a train to carry artillery shells and since it's a long way to wait for it to go to all the train stops and come back to the loading area i want to make the train go to first unloading station unload the amount of artillery shells the station can take, then if it still has more shells continue on the next station if not turn back to load more and try on the route again.

I believe it would be possible with all the fancy wiring stuff but couldnt figured it out yet, any suggestions ?

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

Is finding this in the starting area a good sign?

Posted: 05 Sep 2018 08:25 PM PDT

Unexplained error...

Posted: 05 Sep 2018 02:19 PM PDT

Hello guys,

I'm completely helpless at this point... No matter what I do regarding my mod list, my game just would not load and throw this error upon loading my save game: https://imgur.com/a/5A7XAuO.

It does not matter if I update a single mod to the newest version (no matter what mod, I tried like 10 of them one by one), or if I remove a single mod (again, no matter which one, tried to remove multiple of them one by one).

Has anyone seen anything like this? Or am I doomed to play with the set of mods (and their current versions) on my save game?

Any help or suggestion is appreciated.

This is the log file from the moment the game save is selected to be loaded: https://pastebin.com/Kc8BCVAz

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

Using factorio to write a maths essay?

Posted: 05 Sep 2018 07:52 PM PDT

Hey everyone. I'm currently a high school student enrolled in the international Baccalaureate program. As a requirement of the program, I need to write a paper that explains a topic in depth and solves a problem for maths. My favorite idea is using maths to plan a perfect factory and then execute the plan in game to prove my plans work. However, I honestly have no idea where to start doing that sort of thing. I would really appreciate some resources that could explain how to get started using maths to create an efficient factory. It would be ideal if ideas like sequences and series or calculus are present. As a final note, all the math has to be done by hand, so mods that so the calculations for me are a no go. Thank you for taking the time to read this.

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

Any of you guys have any inspiration for me ?

Posted: 05 Sep 2018 08:14 AM PDT

ive automated transport belts to bring blue red green and military science packs to my labs and i saw the blue chip thing was about to have a complete mental breakdown any help?

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

Lost logistics Network?

Posted: 05 Sep 2018 07:14 PM PDT

When I press L and go to the logistics network menu I see that I have two networks. The first has one cell and several items. The second logistics network is the one I've been working with, 12 cells. I assume this means that I have a logistics Network somewhere that is not connected to my main network. How do I locate this? It's bugging me. Thanks

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

Nucelar bots Bob's logistic bug?

Posted: 05 Sep 2018 03:04 PM PDT

Just started getting bots into my Mega base and put 7500 Nuclear bots into the mega base (this is totally disconnected from my 1st main base)

When i started to empty all the warehouses randomly spread over the mega base, I realised that there was some MK1 robots flying very slow, I looked in my roboport to see how many robots are in my system.

I had 7500 bots in the system nothing more, nothing less.

is there something I am missing? or is this a bug? I have had it happen before in my main base but I thought it was because I left a chest beside a port and it just inserted bots in by accident, but now this happened in my mega base where I know it doesn't have any chests beside a roboport.

Any suggestions will be appreciated!

submitted by /u/Rare-Human
[link] [comments]

How to expand radar view?

Posted: 05 Sep 2018 06:15 PM PDT

As the title says, I want to be able to scroll out further in the map view without it going to the "mist of war". Is there a vanilla setting, or a mod for that?

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

Labs maths

Posted: 05 Sep 2018 08:26 AM PDT

Hi! Can someone help me with calculating needed science packs per minute? The official wiki explanation is not clear to me, i don't understand what "adjusted cycle time" is.

@EDIT

Case solved, got what "adjusted cycle time" is :)

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

Vanilla Rail Network Questions

Posted: 05 Sep 2018 12:09 PM PDT

I'm about 120 hours in on the map I am currently playing on. I ended up launching about 20 satellites and about half of the spaceship components for the spacex mod in my starter base when I realized the final FTL tech requires hundreds of thousands of space science and to complete, and there was absolutely no way this base was going to make it that far. My resources were already close to depleted, especially oil.

So I set off to the west of my base and started clearing out biters and set up an artillery supply line to keep the rail line clear. Finally managed to get far enough out that I was finding 50-100 million ore patches, so I set up my second base.

Previous to this point, my knowledge of rail systems was rudimentary. I set up a bunch of loops that just go out to an outpost and back around my initial bases, but never anything more complicated than that. I resolved for this base to figure out how to build a more complex network.

Anyhow that's the background. I feel pretty good about how far I have come, but mostly I wanted to get some feedback to see if the conclusions I have come to so far are sound.

The way I laid it out is essentially a loose city block kind of design. There are squares with 2-lane rails around the peremeters. In each square I set up a relatively self-contained factory. At the moment I have a mall, a circuit/module factory, iron smelting, copper smelting, an oil refinery, and a stone products factory, and a power plant. Obviously some of those are more input/output heavy than others. The circuit factory has enormously high throughput on both sides if it is going full tilt, and I gave it the least space of all of them...

Anyhow, my biggest question is about the depots. I have probably designed 15 different way of doing it now, and I'm still not sure I have a solution I am happy with.

I have a system that I like pretty well for the loading (output) side, especially for the smelting facilities. I have 1 loading dock that is belt fed, and I have created a stacker in between the loading dock and the exit so that any empty trains will first be loaded very quickly, and then go and wait at one of the staging stops until their presence is requested by one of the factories.

My question with the output docks is about multiple products. The smelting facilities are simple because they only send 1 thing, but I can't think of a good way of creating a relatively compact loading dock that can handle several different kinds of products. At my oil refinery, for instance, I have 4 separate loading areas; plastic, sulfuric acid, artillery shells, and a mixed fluid train for the mall. It works ok but it takes up an enormous amount of space, and if I wanted to export something else I would have to tear up the entire line and start over. Is there a better way of doing this? I know that LTN would make this problem go away, but I am interested to know if there is a good solution outside of mods.

And with the incoming docks, I am wondering what the most UPS friendly unloading method is. Right now I am dumping all of the product into purple chests and having bots move them from the unloading area to the input area of the factory. It works pretty well and it is item-independent because the bots will sort everything, I am just not sure how scale-able it is. My circuit factory can easily keep 1000 logistics bots busy if it is going balls to the walls, and my factory isn't really that big.

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

Post a Comment

Powered by Blogger.