Let us restrict the number of trains a train stop can accept

Suggestions that have been added to the game.

Moderator: ickputzdirwech

Post Reply
GrayMage
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Feb 05, 2017 8:48 pm
Contact:

Let us restrict the number of trains a train stop can accept

Post by GrayMage »

Hi.

I've been playing this great game for a while now, and in my last game I've tried to implement an on-demand resource supply system.
The idea is really simple: all loading train stops share the name of resource it provides ("Iron", "Copper", "Oil", etc). Trains are waiting at circuit-controlled semaphore in some sort of a stacker and they leave it only if the factory needs resources. Once a resource drops bellow certain amount, the semaphore turns green, and the train chooses one of the resource providing train stops (which opens it's entrance semaphore only when it has enough resource stored in it's chests), goes there, picks up the resource, comes back to unloading station and finally goes to train stacker.
The problem: when stacker opens it's semaphore, all waiting trains go to the same loading station even if that station can supply only one train (which is common for oil outposts).
Possible solution: let us restrict the number of trains a train stop can accept. I'd like to send a signal to train stop which would say it to accept only specified amount of trains. If train stop is not connected to circuit network it can accept unlimited number of trains (default behavior). Otherwise train stop is visible to the specified number of trains (which can already be enroute to this train stop) and is not (disabled) for all other trains.

Thanks :-)

GrayMage
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Feb 05, 2017 8:48 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by GrayMage »

I've actually implemented this train stop behavior using the pdb file, which comes along with factorio executable and made this video..

I could share the source code of my DLL implementing this behavior but I need explicit permission from devs to do so.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by ssilk »

Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

metacreamy
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Feb 06, 2017 8:36 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by metacreamy »

Logistic Train Network is nice mod but it sticks us with predefined logistic and schedules.
Its just turn trains in some kind of high capacity drones.
While with proposed solution and logic network we could create greater variety of way to ruin everything deliver goods.
For example using Logistic Train Network is hard to organize warehouse avoiding direct delivery from deposit and almost impossible to prevent empty trains going between exchanging stations.

It would be cool to have such mod allowing to restrict number of trains simultaneously going to station by sending logic signal but unfortunately afaik mod api doesn't capable to that kind of things.
I hope 0.15 train stop disabling will work this way ;)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by ssilk »

metacreamy wrote:Logistic Train Network is nice mod but it sticks us with predefined logistic and schedules.
And this suggestion does not? Or what? ;)

Well, I think you are wrong here.

Right target is viewforum.php?f=28 Modding interface requests
or the already mentioned thread about Logistic Train Network Mod.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by Rseding91 »

GrayMage wrote:I've actually implemented this train stop behavior using the pdb file, which comes along with factorio executable and made this video..

I could share the source code of my DLL implementing this behavior but I need explicit permission from devs to do so.
I'd be interested in seeing what ever code you've managed to create :)
If you want to get ahold of me I'm almost always on Discord.

GrayMage
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Feb 05, 2017 8:48 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by GrayMage »

Rseding91 wrote:I'd be interested in seeing what ever code you've managed to create :)
So can I treat those words as explicit permission to post my code on Github? ;)

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by posila »

GrayMage wrote:So can I treat those words as explicit permission to post my code on Github? ;)
Yes, you can :)

GrayMage
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Feb 05, 2017 8:48 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by GrayMage »

Uhh... I finally managed to post the source code on GitHub. Here. Test maps included. Hope you guys will have a look at what I've done and consider implementing this in future release. :P

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by posila »

Twinsen said he already did it in 0.15, but I haven't checked

GrayMage
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Feb 05, 2017 8:48 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by GrayMage »

Yay! Can't wait. Thank you. :D

waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by waduk »

Are these feature is still on the line ?
I really wish this feature.
Recently i've been playing with Concurrent Train Restriction mod,
https://mods.factorio.com/mod/Concurren ... estriction
And i can't help but amazed how simple yet powerful this train restriction feature are, this really should be in vanilla.

It solves many "problem" with various train mod, in some part of of it, all of them still requiring us to naming train stop with unique identifier (Coal1, Coal2, Iron1, Iron2, etc)

But this mod, is working EXACTLY just as the original suggestion, it doesn't need a unique identifier.
All train stop that have same purpose can share a same name.
And it's so very simple to setup, can even dynamically adjust number of train (based on supplied signal)

The only problem with this mod, well, the author rarely active, so it crash often under certain circumstances.

Darinth
Filter Inserter
Filter Inserter
Posts: 323
Joined: Wed Oct 17, 2018 12:17 pm
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by Darinth »

Huh. Another thread with this idea, though this one has an interesting detail that it looks like this was a feature that was supposed to be in 0.15. I wonder what happened. o.O

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Let us restrict the number of trains a train stop can accept

Post by Bilka »

This was added in 1.1.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented Suggestions”