How to split networks using Network ID?

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
zloyvolkey
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue May 02, 2017 4:11 pm
Contact:

How to split networks using Network ID?

Post by zloyvolkey »

Can you please explain me how to use Network ID to separate networks?
Last edited by Optera on Sun Jan 21, 2018 11:54 am, edited 1 time in total.
Reason: split into properly named topic

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to split networks using Network ID?

Post 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

zloyvolkey
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue May 02, 2017 4:11 pm
Contact:

Re: How to split networks using Network ID?

Post by zloyvolkey »

Thanks!

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: How to split networks using Network ID?

Post 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? :)
Image

Transport Belt Repair Man

View unread Posts

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to split networks using Network ID?

Post 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. ;)

zggz
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Thu Dec 07, 2017 6:40 pm
Contact:

Re: How to split networks using Network ID?

Post 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?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to split networks using Network ID?

Post 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.

zggz
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Thu Dec 07, 2017 6:40 pm
Contact:

Re: How to split networks using Network ID?

Post by zggz »

Sounds bad. Thank you.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: How to split networks using Network ID?

Post 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

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to split networks using Network ID?

Post 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.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: How to split networks using Network ID?

Post by bcwhite »

Ah, didn't realize that was allowed. Makes sense, thanks!

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: How to split networks using Network ID?

Post 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 :cry:

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.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to split networks using Network ID?

Post 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 :cry:

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.

eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: How to split networks using Network ID?

Post 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.

julius1701
Inserter
Inserter
Posts: 33
Joined: Sun Dec 17, 2017 8:33 pm
Contact:

Re: How to split networks using Network ID?

Post by julius1701 »

What do i have to set if i want to decouple a small network from my main network?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to split networks using Network ID?

Post 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.

julius1701
Inserter
Inserter
Posts: 33
Joined: Sun Dec 17, 2017 8:33 pm
Contact:

Re: How to split networks using Network ID?

Post by julius1701 »

thanks i already got it working

peaveyyyy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Oct 01, 2019 9:52 am
Contact:

Re: How to split networks using Network ID?

Post 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.

Post Reply

Return to “Logistic Train Network”