Page 1 of 1

Constant Combinator for Locomotive

Posted: Mon May 08, 2017 7:38 pm
by Aladrius
Add the functionality of a Constant Combinator to a locomotive to let it output arbitrary values to the circuit network when a train station has "read train contents" enabled.

This does two useful things: lets you set an unambiguous signal that a train is at the station, and lets you identify which train it is.

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 12:46 am
by Roxor128
Ooh! Now that has potential!

With a set of train identifiers, you could set the unloading machinery to behave differently depending on which train is dropping off cargo.

Or you could use it to send you your oil train back to the outpost and lock it down there once your main base's crude oil reserves are full so it's not cluttering up the station there.

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 1:19 am
by Tekky
A similar suggestion has already been made in the following threads:
viewtopic.php?f=6&t=26359 Trains numbers for circuit network in v0.13
viewtopic.php?f=6&t=39002 Train-IDs for the circuit network

Also, this bug report thread, in which one of the Factorio devs talks about outputting a signal, might be interesting.

By the way, all of this is already possible now, using a little workaround:

You can load train #1 with 1 fish of cargo, train #2 with 2 fish of cargo, etc. Just make sure to always use filter inserters when unloading the train, so you don't unload the fish by mistake. :)

Unfortunately, the "inventory full" and "inventory empty" waiting conditions of the train will not work with this setup.

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 1:30 pm
by Aladrius
I'm using the fish method at the moment, just feels like a kludge giving up inventory space for identification purposes, along with messing with the train full/empty conditions.

Reading the fuel in the locomotive as part of the signal would also be a potential way to differentiate trains -- using wooden boxes, telephone poles or some other odd burnable in the 3rd fuel slot to identify the train.

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 4:13 pm
by Tekky
I have good news. According to this post by a Factorio developer, the suggestion of the station outputting a unique train ID is going to be implemented.

However, as far as I can tell, this Train ID will not be user-defined, but rather an internal value. So it seems that, at least for the moment, the suggestion of the original poster will not be fully implemented.

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 7:18 pm
by Aladrius
Tekky wrote:I have good news. According to this post by a Factorio developer, the suggestion of the station outputting a unique train ID is going to be implemented.

However, as far as I can tell, this Train ID will not be user-defined, but rather an internal value. So it seems that, at least for the moment, the suggestion of the original poster will not be fully implemented.
This gets a big ole thumbs up for "close enough"!

Re: Constant Combinator for Locomotive

Posted: Tue May 09, 2017 7:24 pm
by Tekky
Aladrius wrote:Add the functionality of a Constant Combinator to a locomotive to let it output arbitrary values to the circuit network when a train station has "read train contents" enabled.

This does two useful things: lets you set an unambiguous signal that a train is at the station, and lets you identify which train it is.
Actually, the more I think about it, the more I really like this suggestion of the original poster.

In my opinion, the best solution would be to allow the user to specify an ID value for the train to send in the train orders window. That way, it would also be also possible for several trains to share an ID value if, for example, you want them to be treated the same way by the circuit network. However, if you want all trains to have a unique ID, you can do that too.

This would also allow grouping and assigning properties to trains. For example, I could assign all my iron ore trains an ID between 1000 and 1999 and all my copper trains an ID between 2000 and 2999. In other words, the first digit would define the type of train. Also, I could, for example, assign the length of the train to the second digit. That way, a train with an ID of 2348 would be a copper train with a length of 3. All of this information could easily be extracted by the circuit network simply by reading the ID of the train. The possibilities would be endless.

EDIT: Having to encode several properties into a single signal would actually not be necessary, because a constant combinator is able to emit several signals.

If the player is too lazy to assign a Train-ID to every one of his trains, the value sent by the train could default to either the number 1 (just a simple signal) or the internal Train-ID of the game, which would be a unique value for the train.
Aladrius wrote:This gets a big ole thumbs up for "close enough"!
In the bug report thread that I linked to in my previous post, I am trying to convince the Factorio developers that it should also be possible to specify a user-defined value. If we are lucky, in the end, it will be more than a "close enough", but rather a "fully implemented". :)

Re: Constant Combinator for Locomotive

Posted: Sat May 13, 2017 1:00 pm
by Tekky
Unfortunately, the Factorio devs decided to only implement the unique ID for version 0.15.11, but not the user-defined ID. However, I am sure that this will still give us a lot to play with, at least until version 0.16. :-)

I really hope that the original poster's suggestion will make it into version 0.16.

Re: Constant Combinator for Locomotive

Posted: Tue May 16, 2017 10:02 pm
by ssilk
I add this sub-suggestion (on demand of Tekky :) ) from here: viewtopic.php?f=6&t=39002#p271703
It would be super useful like so:
Any train has in it's interface a knob. If you press the knop the interface for a constant cominator opens and you can put in ANY signal-configuration you want.
When a train comes now to a train stop he emits that configured constant combinator as signal.

Now we can enhance that: Every train-schedule-entry has also that knob and depending on the train-stop it add the signal of the train's constant combinator to that of the current stop.

Now add also copy paste of "normal" constant combinator into that of the train and vice versa. :)

Re: Constant Combinator for Locomotive

Posted: Sat Jan 13, 2018 10:13 pm
by Tekky
One other thing I like about the original poster's suggestion is that the constant combinator should be attached to the individual locomotive and not just the train. That way, if the train composition changes, for example due to manual coupling or automatic coupling using this mod, you will not have to reset any combinators due to the train ID having changed, as the sum of all locomotive constant combinator signals can still be a meaningful signal.

However, I also like ssilk's idea of attaching a constant combinator to individual train's orders, which is train specific and not locomotive specific.

Re: Constant Combinator for Locomotive

Posted: Sun Jan 14, 2018 1:41 am
by golfmiketango
I have a dream about implementing logistic outpost proxies and I have the loading part all worked out so I can request arbitrary precise quantities of stuff to be loaded into a train. But without running a wire out there, I am kind of stuck. How does the train communicate the needs of the outpost back to the main-base? Here I am stuck trying to figure out how to "compress" the logistic needs of the outpost down to just a few bits of information I can afford to convey by loading superfluous cargo onto the train (this cargo can not potentially be trash from the outpost or else trash conveyance would be compromised). It's a very hard problem which a settable-from-circuit-network constant combinator would solve perfectly.

Re: Constant Combinator for Locomotive

Posted: Sun Jan 14, 2018 6:32 pm
by Tekky
golfmiketango wrote:I have a dream about implementing logistic outpost proxies and I have the loading part all worked out so I can request arbitrary precise quantities of stuff to be loaded into a train. But without running a wire out there, I am kind of stuck. How does the train communicate the needs of the outpost back to the main-base? Here I am stuck trying to figure out how to "compress" the logistic needs of the outpost down to just a few bits of information I can afford to convey by loading superfluous cargo onto the train (this cargo can not potentially be trash from the outpost or else trash conveyance would be compromised). It's a very hard problem which a settable-from-circuit-network constant combinator would solve perfectly.
I agree that it should not be necessary to lay circuit network wire around the whole world, in order for outposts to be able to communicate with the main base. However, I don't think that trains should be used for transmitting signals. In the following threads, is has been suggested that there should instead be a wireless circuit network:

viewtopic.php?f=6&t=49317 Radio Links for signals transmission
viewtopic.php?f=6&t=47429 global circuit network

The first thread contains a link to a mod which implements this. This mod seems to have been updated for 0.16. I haven't tested it, though.

Re: Constant Combinator for Locomotive

Posted: Mon Jan 15, 2018 9:02 pm
by golfmiketango
Tekky wrote:
golfmiketango wrote:I have a dream about implementing logistic outpost proxies and I have the loading part all worked out so I can request arbitrary precise quantities of stuff to be loaded into a train. But without running a wire out there, I am kind of stuck. How does the train communicate the needs of the outpost back to the main-base? Here I am stuck trying to figure out how to "compress" the logistic needs of the outpost down to just a few bits of information I can afford to convey by loading superfluous cargo onto the train (this cargo can not potentially be trash from the outpost or else trash conveyance would be compromised). It's a very hard problem which a settable-from-circuit-network constant combinator would solve perfectly.
I agree that it should not be necessary to lay circuit network wire around the whole world, in order for outposts to be able to communicate with the main base. However, I don't think that trains should be used for transmitting signals. In the following threads, is has been suggested that there should instead be a wireless circuit network:

viewtopic.php?f=6&t=49317 Radio Links for signals transmission
viewtopic.php?f=6&t=47429 global circuit network

The first thread contains a link to a mod which implements this. This mod seems to have been updated for 0.16. I haven't tested it, though.
I've used that mod and it seems pretty nice. To me it feels a bit cheat-ey. Not sure why, as it's perfectly reasonable to imagine that the engineer is able to encode and address circuit-network signals as some kind of point-to-point digital radio-frequency protocol.

Here's a bit of bike-shedding: what I really would love to have for this are something like Hollerith tabulators, which could be used to encode a sequence of circuit network signals into an ordered deck of punched cards. But I'm not sure the modding interface exists to create custom stackable individual-snowflake items like that (I mean, items like blueprints or power-armor which start out generic, but once customized, persistently retain their custom configuration as individual items, not just as entities). I guess you could package them into boxes at the tabulator and make the boxes the individual snowflakes, using the damage-as-unique-ifier hacks...? If it could be done, one could do all sorts of interesting stuff by putting your punched cards on belts...

Type of train

Posted: Mon Aug 26, 2019 12:23 am
by Mucmep
Good day. I read it Train type sensor, but I have some different idea.
Player can specify the type of train in the locomotive menu.
This will allow don't use special ID items in the wagons and will make working with universal stations more convenient.

Re: Type of train

Posted: Wed Aug 28, 2019 1:43 pm
by Tekky
I think the following suggestion offers a more flexible solution:

viewtopic.php?f=6&t=46969 Constant Combinator for Locomotive
EDIT: The above link now points to the current thread, because the threads have been merged.

That way, the type of train and other properties (e.g. its length and number of locomtives) could be made a signal in the constant combinator.

Re: Type of train

Posted: Sat Aug 31, 2019 2:25 am
by Mucmep
O, i didn't see this topic. Yes, it is better and more functional.

Re: Constant Combinator for Locomotive

Posted: Sat Aug 31, 2019 5:24 am
by Koub
[Koub] Then merging both topics