3 months ago - Klonan - Direct link

Hello,
Another trains FFF!


Generic interrupt

We first showcased the new Schedule interrupts in FFF-389. They allow you to control your trains using conditions and target destinations.

We have played with schedule interrupts extensively, and they work very well for controlling larger numbers of trains and train systems. One small problem/annoyance/crime is that you need to add an interrupt for each type of item manually. So if you want the train to handle Iron gear wheel, you need to create a new interrupt specifying "If you have Iron gear wheel, go to Iron gear wheel dropoff".


Lots of interrupts...

It gets a bit boring and tedious adding new interrupts, and in our mind the goal is clear, "If you have Item X, go to X dropoff".

So that is exactly what we did using a new special wildcard signal called 'Any item'.


A 'Generic interrupt' using the any item signal.

When a train is evaluating an interrupt which uses the 'Any item' signal, it will check the interrupt conditions against each item in the cargo, and the first one that passes will be the 'passing item' for the interrupt. The passing item will replace the 'Any item' in the interrupt target name and target wait conditions.

We also have similar signals for 'Any Fluid', 'Any Fuel' and 'Any Signal'. Using these signals, the interrupt is more generalised and hands-off, as long as you ensure you have your train stops named consistently.

But what if I don't have a "Personal Battery equipment MK2 dropoff"?

So one important thing to make this work, is that the game has to be fail-safe for stops that don't exist. In 1.1, if a train stop doesn't exist (or is disabled), the stop is completely skipped/ignored in the schedule. This can create a big problem, a train can just decide to go again to item pickup while already full.

So in 2.0, we have changed it so that trains will 'No path' for stops that don't exist.


A train with a 'Stop that doesn't exist' goes to 'No path' state.

This means the train will never do something unexpected, and it will be the players configuration error causing the train to wait around for better orders.

Does it still skip if I disable a stop with circuit network?

This leads us onto another change in 2.0, disabling stops will no longer cause trains to skip the stations and repath. We have had the skipping behavior in the game for a long time, but effectively using it has always been a bit janky. Since we added trains limits in 1.1, the usage has been very limited, and can cause a lot of problems if you approach the feature naively.

For example, if you disable a stop while a train is en-route, the train may very well be in a position where it can't path anywhere else (e.g. just turning the corner to arrive). This would cause the train to 'no path' while sticking out onto the mainline, causing chaos for the rest of the trains.

So in 2.0, disabled trains stops will act as if they have 'Train limit = 0':

  • If a train is on the way and the stop is disabled, it will continue to the stop regardless.
  • If a train is told to go to a disabled stop, it will enter the 'Destination full' state and wait until it is enabled.

This change will prevent the damage that disabling stops causes, and means you can have a slightly easier time controlling stops with circuit network. For example, with an artillery outpost, just wire up a chest to read how much ammo is left, and only enable the stop if ammo is empty. This way you don't need to include any combinators to translate the lack of ammo into a Train limit.


Alert for 'No path'

More trains means more chance of something unexpected happening. In Space age, where the players' attention is split between multiple planets, is is especially important that the player is made aware of problems in the train system. So it only made sense to add an alert for trains with 'no path'.

With the new 'Generic interrupt', it means if the train picks up an item for which you have no associated train stop, you will be notified about it, and can decide how to solve it.


Easier train dispatching

Another annoyance which becomes more clear with larger train systems, is the pain of creating and dispatching new trains. With the ability to blueprint trains, it is almost painless, but you still need to manually set them to automatic mode.

No Longer! Now when a train blueprint is fully built (importantly, including fuel requests), it will switch to automatic mode.

Trains playback not supported on your device.

This is the last piece of the puzzle, and now if you need to add another 5, 10, 20, 50 trains to your network, it is just a matter of stamping down the train blueprint as many times as needed; No further manual intervention necessary.

Additionally, there were quite a few inconsistencies with blueprinting trains, bugs and unexpected behaviors, which made it a little bit unreliable if the schedule in the blueprint would actually 'stick' to the new train, and if all the wagons would connect correctly. So we've fixed all the cases we could find for 2.0.


Train stop priority

Trains generally prefer stations closer to them. With static routes and limits, the system worked okay. When you have individual train routes for each item, they always have some consistent level of service for that item. If you have 10 iron mines and 3 iron trains, then you know you will always have some trains working that route.

However with generic schedules and 'One big bag of trains', it can happen that all the trains are busy moving around advanced products and nothing is there to direct trains to the mining outposts, especially as the mining outposts are normally far away on the periphery of the base.

Another motivation here was the situation of decommissioning old stations. We want the trains already at the stop to "Get out of here", but often times they would just sit and go "Well my destination is full". So another goal was "When I tell a train to go somewhere manually, I want it to have priority".

So we added the feature of Train stop priority:

The way it works, is that the priority of a train stop has two effects:

  1. When searching for a destination, trains will prefer a higher priority train stop.
  2. When trains are trying to leave a stop, trains at stops with higher priority are dispatched first.

Train stops have a default priority of 50, and players can adjust it to any number they want from 0 to 255. The slider in the train stop suggests values from 10 to 90, but you can be more precise with the textfield. We also added the ability to set the priority using the circuit network.

Additionally, there are some special cases where trains are given the absolute max priority of 255:

  • When the player manually tells the train to go somewhere.
  • When a train has 'no path' or 'destination full' in the middle of the tracks (i.e. not waiting at a train stop).


Icons for Train status

Factorio veterans will know well the flying text popup of 'No Path' and 'Destination full'. Valuable information, but it has always felt a bit ugly and distracting (some people also really hated seeing them in screenshots).

So in 2.0, we changed it so that these states are shown to the player with an icon drawn over the locomotive, and we added the train status to the GUI and tooltip.

Trains playback not supported on your device.

The 'No path' icon flashes to let you know that something is wrong. Destination full is just a solid icon shown in alt-mode. These should make it easier to tell at a glance what a train is up to, without having to do the mental pause to verify there is no flying text notification coming soon.


As always, dispatch your thoughts to us at the usual places.

3 months ago - /u/kovarex - Direct link

Originally posted by captainserafinowicz

Oh My God trains in 2.0 are gonna be so much fun to use

I can confirm!

I have almost 600 trains in my 2.0 testing game, and it just works. Combined with the bulk inserters and quality, the typical train producing outposts fill train after train.This implies that the overall train traffic gets increased a lot, so the quality of intersections and the train network as a whole stops being just theoretical problem, as it often becomes one of the important bottlenecks even with elevated rails.

3 months ago - /u/kovarex - Direct link

Originally posted by Professional_Goat185

This implies that the overall train traffic gets increased a lot, so the quality of intersections and the train network as a whole stops being just theoretical problem

uh, it definitely is not a theoretical problem now, with megabases people are building.

Also does that mean that the expansion will require significantly bigger production than vanilla, or are those (and belt/inserter) changes for sake of the mods ?

The production is definetly expected to be bigger. I'm not sure how much bigger because it very much depends on your personal goals. If you decide to make almost everything legendary in the very endgame (like I did), the sheer amount of production you need for everything is huge, and the factory becomes a monster (and I enjoy it that way, obviously). I have almost 10kspm base, and yet, the science part of the factory is quite small compared to the other things.

3 months ago - /u/kovarex - Direct link

Originally posted by JimmyDean82

600 trains was ages ago for me. And my base is only 1/5th done. Think Iā€™m at almost 2k trains.

Oh, I hope we get to do the train moving optimisation I'm planning for so long (we probably will), the more trains there is, the more it will help obviously.

3 months ago - /u/kovarex - Direct link

Originally posted by subjectivelyimproved

Are you planning to precalculate the routes for trains as part of building rails and scheduling trains, instead of pathfinding on-the-spot?

Or are you referring to collision checks?

Consider me teased either way

The slowest part now is the collison checks of the moving trains, as every train needs to calculate the potential collisions for ever wagon, which is often rotated every tick when it is moved. And also, it needs to re-register the entities of the wagon as they move every tick.

The problem is, that with all these checks, it almost always never hit anything. So the idea is, that in the very rare case something is on the rails (only player, biters or vehicles basically), it would specially register on the related rails. So the train moving on rails, would (almost all of the time), just check that there is nothing on the rails, and it doesn't need to check anything.

With this idea, the train moving could be much much cheaper.

3 months ago - /u/kovarex - Direct link

Originally posted by Fisherman_56

Were you considering integrating purely visual mods into base game?

Disco Science and Bullet Trails, while not changing anything gameplay-wise, make Labs and Gun Turrets look so much better.

We were considering it, but never did so, because it is really really hard to make that mod and different graphis can never change anything game play wise.

3 months ago - /u/kovarex - Direct link

Originally posted by buyutec

Did you slowly build up to 10K or planned for it? My biggest gripe with 1.0 is that you hit a certain SPM and you can't slowly increase from there (as increasing production of only 1 science is not useful), you have to plan the entire thing to hit a higher SPM. Does that change in 2.0?

Well, at some point, i built train based research production, and then just improved th emodules inserter qualities, lab qualities etc.
But at this point, increasing the lab production wouldn't be that hard, as I have modular scien production modules which I could theoretically just copy paste around.

3 months ago - /u/kovarex - Direct link

Originally posted by Ekgladiator

Elevated rails..... Is there a fff I can read more about this because it sounds interesting šŸ¤”

Sure, "fff elevated rails" google search leads right to this:
https://www.factorio.com/blog/post/fff-378

3 months ago - /u/kovarex - Direct link

Originally posted by Steeljaw72

I am very curious to see what scale you think the new bases are going to be in 2.0. I have found that scale is something the community struggles with when discussing the game. Some players think 100 trains on a rail network is huge while others would think 1k trains is barely entering the mid game.

In my modular train bases, 1.5-3k trains is pretty normal. In my centralized bases, 1-1.5k is not unheard of.

Just from everything that has been said in the FFF, it sounds like you (the devs) expect bases to be way larger than what we are doing now. How many trains do you expect we will use at megabase level in 2.0? What size are your bases now (in 1.1) and how large are they in the current 2.0 build?

I have no idea. If megabase is basically as big as you can build without the game being too slow, then it depends how many optimisations can we do before the release.

3 months ago - /u/kovarex - Direct link

Originally posted by cube1234567890

How consistently will we have to name train stops? Will we have the ability to provide a signal to a train stop to determine its purpose, such as a positive value for an item signal making it a "pickup" station and a negative value making it a "dropoff" station? It's how I imagine you'd be able to make stops that want or supply different items without enforcing a naming convention from on high. Maybe we want Train stop is full of bees to supply our iron :3

That way you could use some clever circuitry to request different trains too...

We didn't do a system to be able to change the name of the stop by a circuit network, if you asked that.

It is something that would make sense to do eventually, but we have a lot of things to juggle, and we are now really trying to cut on adding things, so we can actually finish everything in time.

3 months ago - /u/kovarex - Direct link

Originally posted by buyutec

Yes but you could do that in 1.1 as well. What Iā€™d want is, after hitting, say 100spm for all sciences, increasing only the red science production to 200 to be useful so I get some benefits before I increase all else to 200.

Thanks for the answer!

The point is, that it now depends what infinite research you mean, because not all of them nead everything.

The mining productivity research for example doesn't need any planet research even with the expansion, while most of the planets have some of its own specific infinite research. So if you improve just one thing, you can then do the one infinite research better.

But if you want to improve every research production at the same time, it actually get worse.

3 months ago - /u/kovarex - Direct link

Originally posted by 19wolf

so we can actually finish everything in time

In time for when?!

For the release.