[MOD 0.15] SmartTrains 2.0.5

Topics and discussion about specific mods
cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.0

Post by cid0rz »

doxsroxs wrote:
Choumiko wrote:
doxsroxs wrote:Is it possitble to remove the train routes completely and just send the train to a station number?
As in a train only has one station in the schedule (the depot) and gets sent to whatever station number is sent over the circuit network? The train would add the station to the schedule go there and wait for another station to go there etc (removing the non depot station whenever it leaves)?
By removing the routes you mean making the goto station rule available for each train individually?
Yes Choumiko, I want to be able to order any train to go anywhere from any existing station. (Im really surprised this is not in the base game already)

I do not see the need for a depot though since it could become a throughput bottleneck. I want to build a peer to peer system where the circuits to handle all train orders. (including refuel if needed)
I guess the stations will also need a unique station # that can be read and referenced even when they are not in a trainline.
The best scenario would be if new stations are assigned a unique station # when placed.
Hello, in my build I have around 40 stations. So is not exactly the same case. First is all, what you are aming for with a dispatch system is a better usage of your mobile material. In my old base I have "normal" network so each pair of stations have a train to move things from one to other. In some cases l have more than one provider to serve one requester but they work so as soon as the cargo is empty they go and refill the train and come back so the twin is busy on it's assignment nearly all the time. In my smart system it continously poll the stations, find requests, then find a provider capable of delivering what it is needed and lastly sending a number of trains according to what was requested. I placed the depot somewhere between production and consumption. Normally the trains are not a problem since I always make chests buffers to coup with demand peaks. A trick to gain performance is to put all the providers in the beginning of the train schedule so they will be polled first and normally if it is properly dimensioned the trains will be delivered without having to go till the end of the list of stations. For a distribute system you'd have to do basically the same but for a subsystem so I cannot see the advantage vs a non-smart approach. What I'd do in your case is make 2 or 3 depots and serve different parts with different networks. I'm out now but I can elaborate and show you my system if you are interested in case it can help you. We can develop a new one also maybe ^^. I have a couple of features I'd like to include but once it is working so nice I'd better start a new base with the new system.

Cheers!
doxsroxs
Fast Inserter
Fast Inserter
Posts: 160
Joined: Mon Aug 01, 2016 4:19 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.0

Post by doxsroxs »

cid0rz wrote:
doxsroxs wrote:
Choumiko wrote:
doxsroxs wrote:Is it possitble to remove the train routes completely and just send the train to a station number?
As in a train only has one station in the schedule (the depot) and gets sent to whatever station number is sent over the circuit network? The train would add the station to the schedule go there and wait for another station to go there etc (removing the non depot station whenever it leaves)?
By removing the routes you mean making the goto station rule available for each train individually?
Yes Choumiko, I want to be able to order any train to go anywhere from any existing station. (Im really surprised this is not in the base game already)

I do not see the need for a depot though since it could become a throughput bottleneck. I want to build a peer to peer system where the circuits to handle all train orders. (including refuel if needed)
I guess the stations will also need a unique station # that can be read and referenced even when they are not in a trainline.
The best scenario would be if new stations are assigned a unique station # when placed.
Hello, in my build I have around 40 stations. So is not exactly the same case. First is all, what you are aming for with a dispatch system is a better usage of your mobile material. In my old base I have "normal" network so each pair of stations have a train to move things from one to other. In some cases l have more than one provider to serve one requester but they work so as soon as the cargo is empty they go and refill the train and come back so the twin is busy on it's assignment nearly all the time. In my smart system it continously poll the stations, find requests, then find a provider capable of delivering what it is needed and lastly sending a number of trains according to what was requested. I placed the depot somewhere between production and consumption. Normally the trains are not a problem since I always make chests buffers to coup with demand peaks. A trick to gain performance is to put all the providers in the beginning of the train schedule so they will be polled first and normally if it is properly dimensioned the trains will be delivered without having to go till the end of the list of stations. For a distribute system you'd have to do basically the same but for a subsystem so I cannot see the advantage vs a non-smart approach. What I'd do in your case is make 2 or 3 depots and serve different parts with different networks. I'm out now but I can elaborate and show you my system if you are interested in case it can help you. We can develop a new one also maybe ^^. I have a couple of features I'd like to include but once it is working so nice I'd better start a new base with the new system.

Cheers!
I have used Siggboys system that works roughly like you describe. The problem is you cannot get a high throughput in such a system, especially not after a couple of hundred stations are added.
And yes, we tried different depots, but segmenting the system like that removed most of the advantages of such a system in the first place.

A peer to peer system where each requester station has logic to handle its own requests would be able to handle much higher throughput and scale better into a larger system.
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663
cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.0

Post by cid0rz »

Yes I remember reading Siggboy's before starting to develop my own but as far as I remember it was based on offer more than demand but anyways. In my system I made it so it'll loop on all the stations I think it takes 8 ticks total round, this could be optimized slightly. Once it finds some station requiring something it'll start polling all the stations again from beginning to end (this is why having providers in the beginning of the list makes things work better) and then it will continue from where it stopped[\b] so it won't poll the stations already asked on that round. In my medium size factory the bottleneck was never on the train system but elsewhere. I made it also to be able to accept multiple deliveries, so one requester can recieve any number of trains delivering anything. In general my requesters are single element but for the factory I made a station capable of getting and filtering all the "raw" products I need, like redcards, greencards, copperwire, steel, etc. This sometimes got a bit problematic since the input from the station to the main in buffer for the factory got too busy. Once this is said (so I think a system with a depot can work even in a 200 station map),the problems for a distributed system that I see are:
  1. You need every station to know if it has a train available to be sent somewhere, well this can be done I think
  2. You need this station to communicate with the requesting station , you need also to know if the requester station is free or busy, you could have the previous delivery still sitting there waiting to be sent for other mission
  3. You need to be sure that this is ONLY done by one of your stations or you'll send many trains to do the same.


I can think on some ways of doing this but not very easy, you'd also like the closest train to be sent for the mission but I cannot think on a way of doing this. You could put maybe some signal that increases with distance on the train stops and make some calculation with it, but finally throughput will be always be diminished if we increase complexity. I will create a post with my build not to spam in Choumiko's thread. Sorry for the disturbance by the way, if you want we can move this elsewhere.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.0

Post by Choumiko »

Updated to SmartTrains 2.0.2
  • fixed Autorefuel constantly adding and removing the refuel station if all locomotives didn't have any fuel
That was an interesting one, SmartTrains considered a train that didn't have any fuel item left as being full with fuel :D

doxsroxs wrote:
Choumiko wrote: Yes Choumiko, I want to be able to order any train to go anywhere from any existing station. (Im really surprised this is not in the base game already)

I do not see the need for a depot though since it could become a throughput bottleneck. I want to build a peer to peer system where the circuits to handle all train orders. (including refuel if needed)
I guess the stations will also need a unique station # that can be read and referenced even when they are not in a trainline.
The best scenario would be if new stations are assigned a unique station # when placed.
Depot can be any station really. What i meant is that a train always have to have at least 1 station in the schedule, else it wont move in automatic mode. As i see it right now there are 2 ways to implement your request:
  • A train has exactly one station (call it Depot, Base, Whatever) in the schedule when being started. At this station he recieves the # for the next station (call it Station 1) to go to. At Station 1 he recieves the next # (Station 2). When leaving he removes Station 1 and goes to Station 2, etc. (When opening the schedule you'll always see 2 stations)
  • Send a train to any station. He recieves the # and leaves for the station, upon leaving he removes the old station (Except for 1 tick there's only ever 1 station in the schedule)
My guess is that the second option comes closer to what you have in mind.
User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 687
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by StoneLegion »

I assume the update did this but warning go to all your refuel stations and rename them ASAP after the update. if you don't the trains will just add Refuel rather then the correct name/format.
doxsroxs
Fast Inserter
Fast Inserter
Posts: 160
Joined: Mon Aug 01, 2016 4:19 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.0

Post by doxsroxs »

Choumiko wrote:Updated to SmartTrains 2.0.2
  • fixed Autorefuel constantly adding and removing the refuel station if all locomotives didn't have any fuel
That was an interesting one, SmartTrains considered a train that didn't have any fuel item left as being full with fuel :D

doxsroxs wrote:
Choumiko wrote: Yes Choumiko, I want to be able to order any train to go anywhere from any existing station. (Im really surprised this is not in the base game already)

I do not see the need for a depot though since it could become a throughput bottleneck. I want to build a peer to peer system where the circuits to handle all train orders. (including refuel if needed)
I guess the stations will also need a unique station # that can be read and referenced even when they are not in a trainline.
The best scenario would be if new stations are assigned a unique station # when placed.
Depot can be any station really. What i meant is that a train always have to have at least 1 station in the schedule, else it wont move in automatic mode. As i see it right now there are 2 ways to implement your request:
  • A train has exactly one station (call it Depot, Base, Whatever) in the schedule when being started. At this station he recieves the # for the next station (call it Station 1) to go to. At Station 1 he recieves the next # (Station 2). When leaving he removes Station 1 and goes to Station 2, etc. (When opening the schedule you'll always see 2 stations)
  • Send a train to any station. He recieves the # and leaves for the station, upon leaving he removes the old station (Except for 1 tick there's only ever 1 station in the schedule)
My guess is that the second option comes closer to what you have in mind.
Yes, option 2 would work for as long as stations have station numbers even when they are not attached to a trainline :)
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663
AndrewIRL
Fast Inserter
Fast Inserter
Posts: 240
Joined: Fri Mar 24, 2017 2:17 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by AndrewIRL »

Wow, a refueling mod for trains? I need to install this.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by Choumiko »

Kane wrote:I assume the update did this but warning go to all your refuel stations and rename them ASAP after the update. if you don't the trains will just add Refuel rather then the correct name/format.
I can't reproduce that one. A few things you can do:
1. Open a trainstop, if the Refuel stations don't show up in the station mapping gui something went wrong somewhere :roll:

2. Console commands:
Rename at least 1 station to the correct name before running them:
/c remote.call("st", "saveGlob", "preFind")
/c remote.call("st", "findStations")
/c remote.call("st", "saveGlob", "postFind")
Depending on the map size it may look like the game freezes.

If the trains still add the default name there are 2 files in script-output/st named debugGlobpreFind.lua and debugGlobpostFind.lua. Uploading these (or the map if it's not too much of a hassle) will help.
doxsroxs wrote:Yes, option 2 would work for as long as stations have station numbers even when they are not attached to a trainline :)
If you open a trainstop you can already assign numbers to trainstops that will be output to the combinator.
xBlizzDevious
Fast Inserter
Fast Inserter
Posts: 108
Joined: Mon Feb 02, 2015 10:15 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by xBlizzDevious »

Is there a video tutorial of exactly how to use this mod that shows off all features? I've searched Youtube but can only find people display vanilla train stops with "smart" circuitry.

Also, is there any real use to this mod other than dynamically refueling? I use electricly powered locos, charged at each train stop (a different type of power pole) so the refueling is useless to me.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by Choumiko »

xBlizzDevious wrote:Is there a video tutorial of exactly how to use this mod that shows off all features? I've searched Youtube but can only find people display vanilla train stops with "smart" circuitry.

Also, is there any real use to this mod other than dynamically refueling? I use electricly powered locos, charged at each train stop (a different type of power pole) so the refueling is useless to me.
There's an outdated (and not always accurate even for the presented version) spotlight by Xterminator: https://www.youtube.com/watch?v=qI8HiX36emU As far as i remember the latest SmartTrains can still do all the things shown in it
Xeteth has made some videos about his insane combinator setups with SmartTrains: https://www.youtube.com/channel/UCHu0ol ... iqA/videos

Then there's this thread about trains behaving like logistics robots with SmartTrains: viewtopic.php?f=193&t=25311

Before 0.15 SmartTrains was one of the few mods that allowed reading the trains cargo when it was at a station, allowed trains to skip stations in the schedule (which can now be done partially in vanilla but still not as powerful i think)

A lot of the usefullness of SmartTrains depends on how good you are with combinators.
There are some alternatives now: https://mods.factorio.com/mods/Optera/L ... ainNetwork (i would probably use that one if i weren't the author of SmartTrains :D ) and 2-3 mods from https://mods.factorio.com/mods/Hermios
xBlizzDevious
Fast Inserter
Fast Inserter
Posts: 108
Joined: Mon Feb 02, 2015 10:15 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by xBlizzDevious »

Choumiko wrote:
xBlizzDevious wrote:Is there a video tutorial of exactly how to use this mod that shows off all features? I've searched Youtube but can only find people display vanilla train stops with "smart" circuitry.

Also, is there any real use to this mod other than dynamically refueling? I use electricly powered locos, charged at each train stop (a different type of power pole) so the refueling is useless to me.
There's an outdated (and not always accurate even for the presented version) spotlight by Xterminator: https://www.youtube.com/watch?v=qI8HiX36emU As far as i remember the latest SmartTrains can still do all the things shown in it
Xeteth has made some videos about his insane combinator setups with SmartTrains: https://www.youtube.com/channel/UCHu0ol ... iqA/videos

Then there's this thread about trains behaving like logistics robots with SmartTrains: viewtopic.php?f=193&t=25311

Before 0.15 SmartTrains was one of the few mods that allowed reading the trains cargo when it was at a station, allowed trains to skip stations in the schedule (which can now be done partially in vanilla but still not as powerful i think)

A lot of the usefullness of SmartTrains depends on how good you are with combinators.
There are some alternatives now: https://mods.factorio.com/mods/Optera/L ... ainNetwork (i would probably use that one if i weren't the author of SmartTrains :D ) and 2-3 mods from https://mods.factorio.com/mods/Hermios

Thanks for all the info! I'll check it out in detail when I get home. The main reason I was asking is that I want to build a very large base based on trains but I want the trains to be "smart" and know when to go from one station to the next with a load still on or to fill up again at a smeltery or assembling factory.
HellNeko
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Oct 18, 2015 9:38 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by HellNeko »

The problem i am having after updating form 2.0.3 to 2.0.4 be it a existing line or a new line the train number that is shown to say how many there is assigned to that line when i add a train to a line now it adds 2 or 3 trains even though i just added one and if it's a new line the train that was used to make the new line is only counted once

I'm on Factorio version 0.15.16 and the mods I'm using are:
Foreman(2.0.4), F.A.R.L.(1.0.11), Helmod(0.5.3), RSO(3.3.2), SmartTrains(2.0.4), and The Fat Controller(2.0.9), YIR-Americans(0.5.7), Yuoki Industries-Railways(0.5.18)

when i disabled YIR-Americans(0.5.7), Yuoki Industries-Railways(0.5.18) i get this when trying to load the same map:
Error while running the on_configuration_changed: __SmartTrains__/control.lua:789: attempt to index field '?' (a nil value)
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by Choumiko »

HellNeko wrote:The problem i am having after updating form 2.0.3 to 2.0.4 be it a existing line or a new line the train number that is shown to say how many there is assigned to that line when i add a train to a line now it adds 2 or 3 trains even though i just added one and if it's a new line the train that was used to make the new line is only counted once
Will be fixed in the next larger update, since it requires rewriting how SmartTrains keeps track of trains. Besides the incorrect number shown it shouldn't affect the way SmartTrains works too much.
HellNeko wrote: when i disabled YIR-Americans(0.5.7), Yuoki Industries-Railways(0.5.18) i get this when trying to load the same map:
Error while running the on_configuration_changed: __SmartTrains__/control.lua:789: attempt to index field '?' (a nil value)
This is fixed in SmartTrains 2.0.5
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.2

Post by Optera »

Choumiko wrote:A lot of the usefullness of SmartTrains depends on how good you are with combinators.
There are some alternatives now: https://mods.factorio.com/mods/Optera/L ... ainNetwork (i would probably use that one if i weren't the author of SmartTrains :D ) and 2-3 mods from https://mods.factorio.com/mods/Hermios
Thanks, now I know I did something right with LTN. :D
ltl_king
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Sep 27, 2016 11:05 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by ltl_king »

Save is not compatible with current mod version.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

What Factorio version, installed SmartTrains version?
What version was the map saved in? Which SmartTrains version is in the save (can be seen in the load game screen)?
Hoefnix
Inserter
Inserter
Posts: 31
Joined: Thu Apr 28, 2016 12:59 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Hoefnix »

He Choumiko, I came across a bug today. Factorio 0.15.20 and ST 2.0.6.
I was setting up my mainline and for that i was naming 10 stations, assigning them mapping numbers, adding them to the train schedule, setting their rules and then removing the stations. That way later when I build the outpost, the station is all set up to go and trains can run once I name it correctly.
I noticed though that after a couple of sets of stations the mapping window wouldn't scroll past the 5th page. The next and go to last buttons are greyed out. On earlier pages go to last does put you on the last page, not on the fifth. From there you can only go down since the buttons are greyed out, untill you hit page 4 again. One of my viewers took a look and he thinks it has to do with me removing the stops again and ST taking the wrong value as maximum number of stations.

His conclusion was the following: "c" isn't scaled right. He gave some LUA references where he thought it might be:
https://github.com/Choumiko/SmartTrains ... #L425-L435 <-- values I'm talking about
https://github.com/Choumiko/SmartTrains ... i.lua#L466 where the fault is (he thinks)

Hope this helps, your mods are still amazing!
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by SHiRKiT »

Is it possible to make a Round Robin dropoff station?

Let's say I have 3 stations:
- 1 station named A to pickup Iron plates
- 2 stations named B to dropoff Iron plates

Now, let's pretend that the B that's closest to A is consuming all the plate it receives, so it never backlogs. I need the trains to dropoff on both stations, doesn't need to be a perfect match. Can I somehow tell to the trains to do a Round-Robin dropoff?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

Not with same named stations, with different named B's it's just a matter of using the "go to signal #" rule and coming up with a combinator setup that cycles through the station numbers
e.g. with the schedule:
  • A
  • B1
  • B2
you'd need a setup that outputs 2 as value for the leave signal for the first time, then 3, then 2, etc whenever a train departs from A.
The B stations would have "goto 1" as the rule
maxtim
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Apr 24, 2017 5:41 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by maxtim »

Is there an updated save for .15 for newbs like myself to learn how to use the mod? I just got the mod and will be reading the mod page to try to learn it. Also, is there an updated video on the subject as well? Anything I might have missed in my google search?
Post Reply

Return to “Mods”