Make the logical operators in train & space platform schedule conditions more flexible

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

macdjord
Fast Inserter
Fast Inserter
Posts: 163
Joined: Fri Feb 22, 2013 4:26 am
Contact:

Make the logical operators in train & space platform schedule conditions more flexible

Post by macdjord »

TL;DR
Currently, in train and space platform schedules, 'AND' groups can only be nested within 'OR' groups, not the other way around. There are many common conditions for trains and platforms which are really awkward to express in this way. Give us the ability to put 'OR' within 'AND'; maybe even add 'NOT' or 'XOR'.
What?
Strictly speaking, any condition which can be constructed using any combination of ANDs and ORs can be expressed using the current AND-within-OR system (the formal name for which is 'disjunctive normal form') . However, that doesn't mean there aren't conditions which are easier to express in other ways. For example, let's say I have a space platform which transports four items from Vulcanus to Nauvis. I want it to head back to Vulcanus to pick up more supplies if it runs out of any of them; however, it must not leave unless it has enough ammo stockpiled to safely make the trip. Expressing this logically is simple and only takes five conditions: [Ammo >= 300] AND ([Item1 == 0] OR [Item2 == 0] OR [Item3 == 0] OR [Item4 == 0]). However, with the current system, implementing it requires 8 conditions: ([Ammo >= 300] AND [Item1 == 0]) OR ([Ammo >= 300] AND [Item2 == 0]) OR ([Ammo >= 300] AND [Item3 == 0]) OR ([Ammo >= 300] AND [Item4 == 0]).

Things get even worse if, say, we're talking about an Aquillo spaceship which needs both ammo and rockets: the expression goes from 6 conditions ([Ammo >= 300] AND [Rockets >= 50] AND ([Item1 == 0] OR ...)) to 12 (([Ammo >= 300] AND [Rockets >= 50] AND [Item1 == 0]) OR ([Ammo >= 300] AND...)).

(And yes, I know there are tricks you can pull with interrupts to implement this particular sort of schedule more easily. But a. this is just an example; there are other types of schedule where that's not an option, and b. interrupts are a relatively advanced topic and new players shouldn't need to have to figure them out to handle 'bring me these 4 things and get more when you run out'.)

Being able to nest AND and OR arbitrarily conditions would make this much, much simpler, at the cost of requiring a more complicated GUI to allow the user to organize and manipulate such nested groups. But once you have such a UI, it then becomes trivial to add other useful-but-not-necessary logic functions like NOT and XOR.
Why?
Factorio is a game about automation. Train scheduling, and in Space Age platform scheduling, are a big part of that automation. Making them as useable and expressive as possible makes everything better.
Post Reply

Return to “Ideas and Suggestions”