Friday Facts #184 - Five years of Factorio

Regular reports on Factorio development.
POPISowyNumer
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Thu May 05, 2016 1:31 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by POPISowyNumer »

ihumangetmeoutofhere wrote:
1. You connect the circuit network to the stations

2. The conditions are sent through the logistics network
My initial idea was that train stations receive data from circuit networks, then relay them to trains stopping at them, so if my coal hauler stops at Coal Bunker Chute, and gets signal that two of the coal mines are ready to ship their output, train goes to nearest one IF it has more than 50 units of fuel, otherwise it goes to station dedicated to train maintenance.

Then maybe there could be tech that allows things to be broadcast over the radio waves, giving module for trains that allows them to connect to Radio/Wifi comms, and receiving updates more often.
User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 687
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by StoneLegion »

Saving is instant just setup a dedicated client that joins with a auto save script and turn off server saving and bang you have fastest auto save :P
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by daniel34 »

Kane wrote:Saving is instant just setup a dedicated client that joins with a auto save script and turn off server saving and bang you have fastest auto save :P
That's an interesting idea and in theory it would work, but in practice you have to run an extra graphical client which also has to simulate the game and there's no way to automate saving (no external script or lua command), unless you made a tool that automatically presses Esc and clicks the save button.

I can even see that working in a "singleplayer" game where you start a LAN game and have a second PC (e.g. laptop) join you and periodically save the game, but I think the time it would take to set something like that up is not worth it.
quick links: log file | graphical issues | wiki
bripi
Inserter
Inserter
Posts: 31
Joined: Sat Jul 02, 2016 3:15 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by bripi »

Congrats!! 5 years...what passion you have for this "game". It's so hard for me to call it a "game" when it is more addictive than heroin, more destructive than meth, more time-consuming than just about anything...and it's realism lets me use it in the classroom to teach important concepts like energy. I claim this is a SIMULATION but I know it would be hard to get people excited about a "simulation" when "game" sounds waaaaay sexier. All in good fun...many, many, MANY thanks for your amazing efforts and dedication, devs...it's a hell of piece of work!
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 509
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Yoyobuae »

Deadly-Bagel wrote:As it stands you could drop wood from the game entirely, replace it with Iron Plate, and it wouldn't have any real impact.
Nope, nope, nope...
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Deadly-Bagel »

I could make a defence purely out of landmines, it doesn't make them a useful addition to the game.
Money might be the root of all evil, but ignorance is the heart.
User avatar
MrGrim
Fast Inserter
Fast Inserter
Posts: 241
Joined: Sat Apr 09, 2016 7:58 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by MrGrim »

Rseding91 wrote:
MrGrim wrote:
Floaf wrote:Have you guys given any thought about how the autosave works? In later gameplay it can take 15-20 seconds to save and if you autosave like every 2 minutes (since you are hunting biters) it get a little bit tedious.

Shouldn't it be possible to just make a copy of the game state and saving that state on a separate thread in the background? Of course it still may take some time to copy the state, but it should be much faster.

Just a thought :-)
Saves on large maps even in vanilla are annoyingly slow. Mod free on a 3.7Ghz Xeon E5 and a Samsung 850 Pro SSD 2 minute autosaves become insanely aggravating. Even if it only takes 5 seconds (which is not uncommon for me on very large maps) it becomes like a regular 2 minute jolt that just rips you right out of the game. About the only thing worse is disabling or extending it and losing a ton of work.

I brought this up on a reddit thread, and kovarex actually replied with some interesting information here: https://www.reddit.com/r/factorio/comme ... s/d90yy8q/

I really hope this experimental saving method he mentions makes its way into the main game before 1.0. Seemless auto saving would be epic as hell!
It's not going to happen.
It makes me super sad, but thanks for being up front about it. The mischievous part of me wants to find a way to plant a plugin on all of the devs favorite text editors they use for coding that pauses the editor for 5 seconds every 2 minutes, but that would be mean.. :D (and probably impossible)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14250
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Rseding91 »

MrGrim wrote:It makes me super sad, but thanks for being up front about it. The mischievous part of me wants to find a way to plant a plugin on all of the devs favorite text editors they use for coding that pauses the editor for 5 seconds every 2 minutes, but that would be mean.. :D (and probably impossible)
All of our editors already do that randomly :P No need for addins.

Also we do play the game and get to experience autosave as well. If you don't like it turn it off or make it less frequent. It's not technically possible to make it faster right now due to how it has to work.
If you want to get ahold of me I'm almost always on Discord.
Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Aeternus »

Rail pathing question. In the notes it says that trains do not need to know if a rail is being destroyed unless it has a signal on it - even if that rail is part of the currently elected path. That seems a bit strange to me. Example: A train is departing an ore mine while I'm editing the railways. My rail system is basically one big loop with trains going in one direction. Because of my edits, the loop is broken while the train is on approach. Does it ram full-speed into the now dead end?

Another pathing question: Do trains re-calculate their path if due to a signal change their currently elected path is blocked? I'm guessing that in 0.14 it does do that, because trains do switch between stations with the same name if you use that to have a big station with multiple tracks and stops.
Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Aeternus »

POPISowyNumer wrote:
ihumangetmeoutofhere wrote:
1. You connect the circuit network to the stations

2. The conditions are sent through the logistics network
My initial idea was that train stations receive data from circuit networks, then relay them to trains stopping at them, so if my coal hauler stops at Coal Bunker Chute, and gets signal that two of the coal mines are ready to ship their output, train goes to nearest one IF it has more than 50 units of fuel, otherwise it goes to station dedicated to train maintenance.
Reading fuel from the engine doesn't seem to be possible yet. I usually remedy this by setting up refueling (using the logistics network) at all smelters/factory unloading docks. The fuel requirements for trains are so low, it doesn't strain the logistics system to do so.
A coal transfer station could do this even easier, simply divert a small amount of coal back into a chest for refilling the train locomotive(s).
Engimage
Smart Inserter
Smart Inserter
Posts: 1069
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Engimage »

It would definitely be great if devs could do a FF post describing train behaviour in detail. What causes them to re-path, change speed, how do they choose a target station, path etc. How do they react to signals...
I do understand that this is a complex job but this would really help rail junkies like me.
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Deadly-Bagel »

I think there's only two things we don't really know about trains. Firstly how many signals are required before a train decides a station is too far and instead will path to a closer, unavailable station though this could fairly easily be tested.

And secondly how trains pick between two stations that are an equal number of signals away. Pretty sure the acceleration figure is floating around somewhere and I recently read the formula for braking distance.

To answer your questions to my knowledge, a target station is selected based first on availability, if two stations are available it will go to the station where it must pass the least number of signals. See above for exceptions. This also answers your next question. When a train approaches a signal, at the point the train can no longer stop before the signal the signal will go... not red or green (colourblind - is it orange?) and to all intents and purposes is treated as a red signal by other trains. This includes all signals along the path of the train, even if they are behind other signals. Of course trains approaching signals that are not green will start braking at the point they will stop at that signal, otherwise they are accelerating (as corners are ignored).
Money might be the root of all evil, but ignorance is the heart.
Engimage
Smart Inserter
Smart Inserter
Posts: 1069
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Engimage »

Deadly-Bagel wrote:I think there's only two things we don't really know about trains. Firstly how many signals are required before a train decides a station is too far and instead will path to a closer, unavailable station though this could fairly easily be tested.

And secondly how trains pick between two stations that are an equal number of signals away. Pretty sure the acceleration figure is floating around somewhere and I recently read the formula for braking distance.

To answer your questions to my knowledge, a target station is selected based first on availability, if two stations are available it will go to the station where it must pass the least number of signals. See above for exceptions. This also answers your next question. When a train approaches a signal, at the point the train can no longer stop before the signal the signal will go... not red or green (colourblind - is it orange?) and to all intents and purposes is treated as a red signal by other trains. This includes all signals along the path of the train, even if they are behind other signals. Of course trains approaching signals that are not green will start braking at the point they will stop at that signal, otherwise they are accelerating (as corners are ignored).
You have told nothing that I don't know. I've been researching trains a lot.
However there are several important questions left. I can name them if you want but still getting the complete picture from devs would be much better.

1. At what moments does a train recalculate its path?
2. How exactly do signals effect chosen path? I mean pathfinding and not train behaviour due to red/yellow signals ahead.
3. At what moments does a train choose which destination station (with the same name) to go to? It seams at this point the station is chosen when train leaves previous station based on which destination stations are free. Thats why it is an regular practice to make a stacker with pre-unload stations. But this behaviour is not optimal at least thats why we wanna know how it works to unnderstand if it should be altered.
4. What is the number of blocks acceptable for a train to accept a runaround if signal is red?
Loewchen
Global Moderator
Global Moderator
Posts: 9090
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Loewchen »

PacifyerGrey wrote: 1. At what moments does a train recalculate its path?
2. How exactly do signals effect chosen path? I mean pathfinding and not train behaviour due to red/yellow signals ahead.
3. At what moments does a train choose which destination station (with the same name) to go to? It seams at this point the station is chosen when train leaves previous station based on which destination stations are free. Thats why it is an regular practice to make a stacker with pre-unload stations. But this behaviour is not optimal at least thats why we wanna know how it works to unnderstand if it should be altered.
4. What is the number of blocks acceptable for a train to accept a runaround if signal is red?
1.: This I'd like to know as well.
2.: Trains care only for blocks not for signals themselves. Occupied blocks get a path length penalty when pathfinding, it is higher for longer, nearer blocks (there is a post with the actual parameters somewhere).
3.: This is the same question as 1
4.: The train will take the shortest path (including the penalty), there is no limitation as you are describing.
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Deadly-Bagel »

1. Trains recalculate every time they pass a signal or when a rail, signal or station is added or removed (or renamed in the case of stations). This is why you can't currently use a Chain Signal before your waiting bays because the train doesn't recalculate while sitting at the signal.

2. As I said pathfinding is determined by signal count. If route A passes 5 signals and route B passes 7 signals (assuming all are green) it will take route A even though it may be physically a longer path. This includes Chain Signals. If no routes are available it will take whatever route will get it the fewest signals away from its destination. I talked about signal colour because that and the destination are the only things that affect acceleration.

3. Path recalculation includes picking a station, so the answer is the same as 1. (often used in loading / unloading bays).

4. That is one of the points I mentioned we don't know.

EDIT
kovarex wrote:Currently occupied blocks just get penalty of distance (100 + length of block) / (1 + block distance from start).
So for one block of length 20 that is just in front of the train, the block gets penalty (120 + 20)/2 -> 70 tiles. [corrected]
viewtopic.php?f=11&t=2237
Money might be the root of all evil, but ignorance is the heart.
Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Zeblote »

Is there a reason why trains don't update their path when stopped at a chain signal?
Loewchen
Global Moderator
Global Moderator
Posts: 9090
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Loewchen »

Deadly-Bagel wrote: 2. As I said pathfinding is determined by signal count. If route A passes 5 signals and route B passes 7 signals (assuming all are green) it will take route A even though it may be physically a longer path. This includes Chain Signals. If no routes are available it will take whatever route will get it the fewest signals away from its destination. I talked about signal colour because that and the destination are the only things that affect acceleration.
This is incorrect, the length is the factor, amount of blocks is irrelevant, make a simple setup like
this
and you can see yourself.
Engimage
Smart Inserter
Smart Inserter
Posts: 1069
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by Engimage »

Deadly-Bagel wrote:Trains recalculate every time they pass a signal or when a rail, signal or station is added or removed (or renamed in the case of stations). This is why you can't currently use a Chain Signal before your waiting bays because the train doesn't recalculate while sitting at the signal.
I am sure that the train does not recalculate path on every signal for several reasons.
1. This is not optimal CPU wise and I believe in greater sense of Wube.
2. Train has a calculatable breaking distance in tiles. So the train actually effects signals that are this number of tiles ahead - the point of inevitable entry, when a block gets reserved the signal turns yellow. I'm sure that repathing occurs when a train meets a red signal at the point of inevitable entry as opposed to passing any rail signal.

This and previous example (blocks vs rail length) shown clearly that there is no definite knowledge among players as of train exact behaviour.

And yes, I think train should repath every second/couple while sitting at red chain signal (imo).
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by ratchetfreak »

PacifyerGrey wrote:
Deadly-Bagel wrote:Trains recalculate every time they pass a signal or when a rail, signal or station is added or removed (or renamed in the case of stations). This is why you can't currently use a Chain Signal before your waiting bays because the train doesn't recalculate while sitting at the signal.
I am sure that the train does not recalculate path on every signal for several reasons.
1. This is not optimal CPU wise and I believe in greater sense of Wube.
2. Train has a calculatable breaking distance in tiles. So the train actually effects signals that are this number of tiles ahead - the point of inevitable entry, when a block gets reserved the signal turns yellow. I'm sure that repathing occurs when a train meets a red signal at the point of inevitable entry as opposed to passing any rail signal.

This and previous example (blocks vs rail length) shown clearly that there is no definite knowledge among players as of train exact behaviour.

And yes, I think train should repath every second/couple while sitting at red chain signal (imo).
s/they pass/their braking point passes/
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Friday Facts #184 - Five years of Factorio

Post by posila »

Rseding91 wrote:Also we do play the game and get to experience autosave as well. If you don't like it turn it off or make it less frequent.
I don't recommend turning autosaves off as the point is not to lose hours of progress in case of crash.
Post Reply

Return to “News”