Page 1 of 1
How to split networks using Network ID?
Posted: Sun Jan 21, 2018 11:31 am
by zloyvolkey
Can you please explain me how to use Network ID to separate networks?
Re: How to split networks using Network ID?
Posted: Sun Jan 21, 2018 12:12 pm
by Optera
Encoded Network ID is a binary coded signal.
In other words LTN reads each bit of the integer value feed into the input as a on/off switch for that network. Factorio uses 32bit integer directly resulting in 32 possible networks.
Lets assume 4 networks:
A = b0001 = 1
B = b0010 = 2
C = b0100 = 4
D = b1000 = 8
Setting Encoded Network ID = 2 on a stop will make LTN only use other stops where the 2nd bit is set to service this stop.
Not setting Encoded Network ID defaults to -1 or all 1 in binary meaning it's part of every possible network.
Example:
Depot is not set = b1111
ProviderA is set to b0001 = 1
ProviderB is set to b0010 = 2
Requester is set to b0001 = 1
In this configuration only Provider A will ever be used.
Stops can be set to be part of multiple networks. Simply add the network IDs together.
Examples:
a stop being part of A and C would be b0101 = 5 = 1 + 4
a stop being part in all but C would be b1011 = 11 = 1 + 2 + 8
Re: How to split networks using Network ID?
Posted: Sun Jan 21, 2018 2:47 pm
by zloyvolkey
Thanks!
Re: How to split networks using Network ID?
Posted: Sun Jan 21, 2018 3:06 pm
by steinio
Nice.
I remember a time where Optera explicitly denied the network seperation.
I'm happy that you have fun to try new stuff in this mod.
Could be the loco refill station the next thing here? Who knows?
Re: How to split networks using Network ID?
Posted: Sun Jan 21, 2018 5:07 pm
by Optera
steinio wrote:Nice.
I remember a time where Optera explicitly denied the network seperation.
I'm happy that you have fun to try new stuff in this mod.
Could be the loco refill station the next thing here? Who knows?
I implemented it as solution to the Provider-Requester distance discussion.
viewtopic.php?f=214&t=55691
Having players assign subnetworks costs practically no performance and has the same effect as mapping the entire network.
Refill stations are already included. They are called depot.
Re: How to split networks using Network ID?
Posted: Mon Jan 22, 2018 10:23 am
by zggz
I want to use network ID to make 1 big network (Main) and some small networks (for smelters).
Is i need to set in all Main network stations (850psc) network it? For example 1. And for other networks - 2,3,4...etc.
Or just enought to set ID on the side networks?
Re: How to split networks using Network ID?
Posted: Mon Jan 22, 2018 12:24 pm
by mrvn
zggz wrote:I want to use network ID to make 1 big network (Main) and some small networks (for smelters).
Is i need to set in all Main network stations (850psc) network it? For example 1. And for other networks - 2,3,4...etc.
Or just enought to set ID on the side networks?
If you don't set a network ID then they are in all networks.
If your goal is only to prevent trains from one smelter to go to a different smelter then only setting the smelter will work. But not if you want to prevent trains from the main network to go to the smelter.
Note: networks are 1, 2, 4, 8, 16, 32, 64, ... It's a bitfield and 3 means the station is in network 1 and 2.
Re: How to split networks using Network ID?
Posted: Tue Jan 23, 2018 3:26 pm
by zggz
Sounds bad. Thank you.
Re: How to split networks using Network ID?
Posted: Thu Jan 31, 2019 10:42 pm
by bcwhite
LTN works by creating schedules that go to the provider station, the requester station, and then back to the depot.
The provider and requester stations have unique names and so the train can have only one possible destination. Every depot, however, has the same name so the train can choose any one, typically the closest.
I understand how the "network ID" influences LTN to chose what stations to visit, but how can it determine to what depot it goes when finished? As I understand it, LTN doesn't affect the train once its en-route and there's no way to indicate which depot at which to finish.
So while I can see how LTN determines where a train can go based on the network ID of the depot at which it starts, how can it guarantee that the train ends at a depot with a compatible ID?
-- Brian
Re: How to split networks using Network ID?
Posted: Fri Feb 01, 2019 5:49 am
by Optera
bcwhite wrote: ↑Thu Jan 31, 2019 10:42 pm
So while I can see how LTN determines where a train can go based on the network ID of the depot at which it starts, how can it guarantee that the train ends at a depot with a compatible ID?
Give depots in different networks different names.
Re: How to split networks using Network ID?
Posted: Fri Feb 01, 2019 3:26 pm
by bcwhite
Ah, didn't realize that was allowed. Makes sense, thanks!
Re: How to split networks using Network ID?
Posted: Fri Feb 01, 2019 5:51 pm
by GrumpyJoe
bcwhite wrote: ↑Fri Feb 01, 2019 3:26 pm
Ah, didn't realize that was allowed. Makes sense, thanks!
technicly you can give each depot a different name, have a dedicated depot for each train.
All thats gonna do is that you cant copy&paste initial schedules, they´ll still look into LTN the same way and distribute trains.
I´d even advise you to think about that (a few different names, not the above) when adding more depot blocks to you system.
Lets say you build a depot for 20 trains, you run out of space and make another, abit further away. Still in the same network.
Now your trains go wild, and 30/40 trains end up next to depot #1, fulfill their orders and wanna park (and get a new schedule), they´ll go to the next one if both blocks have the same station names. Viola, 10 trains on your main tracks
What i do is, that i build a depot, fill it with trains, make a schedule "go to depot X" and fire them up at the same time.
I never add trains when i need more, i add more depots
I never touch that depot´s trains again. Even if 10/20 are away, i know that one is "full", so i build another one.
Re: How to split networks using Network ID?
Posted: Mon Feb 11, 2019 10:31 am
by mrvn
GrumpyJoe wrote: ↑Fri Feb 01, 2019 5:51 pm
bcwhite wrote: ↑Fri Feb 01, 2019 3:26 pm
Ah, didn't realize that was allowed. Makes sense, thanks!
technicly you can give each depot a different name, have a dedicated depot for each train.
All thats gonna do is that you cant copy&paste initial schedules, they´ll still look into LTN the same way and distribute trains.
I´d even advise you to think about that (a few different names, not the above) when adding more depot blocks to you system.
Lets say you build a depot for 20 trains, you run out of space and make another, abit further away. Still in the same network.
Now your trains go wild, and 30/40 trains end up next to depot #1, fulfill their orders and wanna park (and get a new schedule), they´ll go to the next one if both blocks have the same station names. Viola, 10 trains on your main tracks
What i do is, that i build a depot, fill it with trains, make a schedule "go to depot X" and fire them up at the same time.
I never add trains when i need more, i add more depots
I never touch that depot´s trains again. Even if 10/20 are away, i know that one is "full", so i build another one.
I tend to give each depot stop a different name and then add N trains to it according with the space before the stop. I tried using the name name for all stops in a depot complex but then occasionally 5 trains would route to the first stop and only one to the second stop while each stop only has space for 3 trains. So 2 trains would wait at the entrance and block all other stops and passing trains. They might reroute to the other stop after a minute or 5 because they can get closer to that one but it isn't instantaneous. Using unique names avoids that problem.
The drawback is that trains always return to the same depot/stop. So the train goes from the depot to the iron smelter, to the circuit factory and then all the way back to the depot next to the iron smelter. Then the same train goes all way out to the circuit factory to pick up the produced circuit boards.
Would be nice if LTN could manage depots too and route trains to nearest depots or one near a likely next pickup place.
Re: How to split networks using Network ID?
Posted: Mon Feb 11, 2019 11:31 am
by eduran
What I like to do is attach dedicated depots to high-volume providers. Using network IDs, you can allow only the provider to draw trains from the depot, so the trains can't be "stolen" for other deliveries. If the depot is close to the provider, LTN will automatically assign trains from that depot first. If the dedicated depot runs out of trains, more trains can come in from shared depots.
Re: How to split networks using Network ID?
Posted: Wed Jan 15, 2020 2:33 pm
by julius1701
What do i have to set if i want to decouple a small network from my main network?
Re: How to split networks using Network ID?
Posted: Thu Jan 16, 2020 11:21 am
by mrvn
julius1701 wrote: ↑Wed Jan 15, 2020 2:33 pm
What do i have to set if i want to decouple a small network from my main network?
Short answer: the network ID.
For example give every stop in your main network ID 1 and the small network ID 2 and they become disjunct.
Re: How to split networks using Network ID?
Posted: Fri Jan 17, 2020 11:35 pm
by julius1701
thanks i already got it working
Re: How to split networks using Network ID?
Posted: Wed Dec 30, 2020 1:31 pm
by peaveyyyy
I feel dumb asking this but I don't see where to set the station's Network ID.
All I see are Circuit network and logistics network selectors, and neither have a Network ID setting.