Page 1 of 1
Display train's ID number on scheduler UI
Posted: Sun Jan 26, 2020 1:07 am
by JasonC
I would like to see the currently selected train's ID number on the train schedule UI (or anywhere else that's accessible from the map).
More generally, I would like to be able to determine the ID number of a train without having to be near the train. The schedule UI seems like a reasonable place to put the ID (maybe in the title bar or up top somewhere):
- blueprints.png (916.72 KiB) Viewed 5624 times
The train stop UI would also work as an alternative:
- abc.png (340.21 KiB) Viewed 5624 times
Re: Display train's ID number on scheduler UI
Posted: Mon Jan 27, 2020 11:21 pm
by ssilk
Frankly I don't understand the usage case, why everyone wants to use the train-id.
Because when I play my trains are often eaten by biters. If I would set to usage of train-Id I would have many problems in such cases (cause I need to redefine how stations work in such a case). I can redefine the trains name, but not it's ID.
Re: Display train's ID number on scheduler UI
Posted: Tue Jan 28, 2020 6:24 am
by picklock
+1
To see the train ID in the train UIs would be helpful for me, too.
In areas with radars you can zoom in the map and hover over the train. Then you see the train tool tip with the train ID. But to see it direct in the train UI would be faster and easier.
Re: Display train's ID number on scheduler UI
Posted: Tue Jan 28, 2020 6:30 am
by leadraven
Trains have IDs?) Never noticed. And what is the use of them to the player?
Re: Display train's ID number on scheduler UI
Posted: Tue Jan 28, 2020 8:37 am
by picklock
You can read out the train IDs on train stations und work with them with combinators. For example you can make a circuit to load / unload items depending on the train ID.
Re: Display train's ID number on scheduler UI
Posted: Tue Jan 28, 2020 9:54 pm
by JasonC
leadraven wrote: ↑Tue Jan 28, 2020 6:30 am
Trains have IDs?) Never noticed. And what is the use of them to the player?
They're useful for taking train specific actions at a train station. For example, one time I had to modify a stop to accept two bi-directional trains of different lengths, which meant the location of the rear car for refueling depended on the train. The train ID was handy for that. I also once had a stop that loaded copper and oil but then I added a train that stopped there had a sometimes-empty tanker for petro gas instead of oil in the same position as the oil tankers on other trains; so I used the ID to prevent putting oil in the car since it was easier than splitting up the stops.
I'm pretty sure in the majority of situations where you can use the ID you can come up with a pretty straightforward solution that doesn't require IDs (e.g. add additional stops, inserter tricks, inventory slot filters in train cars, etc.) but they definitely come in handy in more situations than I expect.
When you set a train stop to "read train", the value of the signal it outputs is the current train's ID.
Re: Display train's ID number on scheduler UI
Posted: Tue Jan 28, 2020 10:01 pm
by JasonC
ssilk wrote: ↑Mon Jan 27, 2020 11:21 pm
Frankly I don't understand the usage case, why everyone wants to use the train-id.
Because when I play my trains are often eaten by biters. If I would set to usage of train-Id I would have many problems in such cases (cause I need to redefine how stations work in such a case). I can redefine the trains name, but not it's ID.
Well, two things, lol:
1. Maybe you need to protect your tracks better or add some artillery cars
2. That's a nice case for allowing trains to emit a configurable signal that can be read by stations, which would be awesome, but is a separate feature request (and something I'd really like to have but I haven't made an actual post about it and it's different from this).
Re: Display train's ID number on scheduler UI
Posted: Thu Jan 30, 2020 4:35 pm
by ssilk
to 1: IMHO too much effort for low effect and a lot of complications. Can transport less, train is longer, longer train stations, more locomotives...
to 2: using an ID for anything else than internal game design is from information view nothing, which can be generalized. I guess this could work well for 20, 30 maybe 40 trains, or some freak it out more. Sooner or later it’s not longer manageable. Hm. The “right way” to do this is in my opinion some kind of constant combinator which can be installed/configured on the locomotive.
Re: Display train's ID number on scheduler UI
Posted: Thu Jan 30, 2020 6:50 pm
by Pi-C
JasonC wrote: ↑Tue Jan 28, 2020 10:01 pm
2. That's a nice case for allowing trains to emit a configurable signal that can be read by stations, which would be awesome, but is a separate feature request (and something I'd really like to have but I haven't made an actual post about it and it's different from this).
Check out
TrainsSignalSender! I'm using it for the same purpose (marking train types etc. with signals).
Re: Display train's ID number on scheduler UI
Posted: Fri Jan 31, 2020 2:55 am
by Tekky
The Train ID would be a lot more useful if it were possible for the user to supply his own Train ID, maybe even encode properties of the train in the Train ID (for example whether it is an iron or copper train), which can then be read by the circuit network. This has been suggested in the following thread:
viewtopic.php?f=6&t=46969 Constant Combinator for Locomotive
Re: Display train's ID number on scheduler UI
Posted: Fri Jan 31, 2020 3:16 am
by Olacken
Tekky wrote: ↑Fri Jan 31, 2020 2:55 am
The Train ID would be a lot more useful if it were possible for the user to supply his own Train ID.
You only think that because they chosed to show the train Id.
I bet the train Id is not just something they show but somthing that is used internally and if you alllow user to change the value it would introduce a lot of problem of for exemple a user using the same Id twice even though the Ids are supposed to be unique
Or a user using the same id twice even though it break things internally
Or a user using the same id twice to simplify his circuit logic to realise that he can't because devs thought about the fact that it would break things and go complain on the forum that you can't put the same Id twice.
Id are generated by the machine and should stay that way (For any application whatsoever)
If for any reason you want to let your users edit it then it is no longer an id and shouldn't be treated as one or it's bad design and it will break things.
Worst an Id shouldn't be modified in any circumstance (There may be exception for that but they are very specific and very rare) or you risk breaking everething.
Showing an id to the user is also in most case a bad idea the reason why factorio does it is probably because player asked to be able to diferenciate between train and internally there was already an id so they let player read it.
What you want is tags or a user id (I now realise that is probably what you meant but I already wrote my book and I don't wan't to flush it) and I think I would like it too
Re: Display train's ID number on scheduler UI
Posted: Fri Jan 31, 2020 11:00 pm
by Tekky
Olacken wrote: ↑Fri Jan 31, 2020 3:16 am
I bet the train Id is not just something they show but somthing that is used internally and if you alllow user to change the value it would introduce a lot of problem of for exemple a user using the same Id twice even though the Ids are supposed to be unique
I don't consider this a problem, but rather a feature. If I want my circuit network to treat both trains exactly the same way, then I will set both trains to emit exactly the same signal(s).
Olacken wrote: ↑Fri Jan 31, 2020 3:16 am
Or a user using the same id twice even though it break things internally
Of course, the internal train ID would have to remain unique. However, this internal train ID only has to be visibile to the game engine and to mods, but not the player. The signals (Train IDs or whatever you want to call it) the player sees a train emit don't have to be the same as the game's internal Train ID. So a player changing a Train ID would not cause the game's internal Train ID to be changed.
Olacken wrote: ↑Fri Jan 31, 2020 3:16 am
What you want is tags or a user id (I now realise that is probably what you meant but I already wrote my book and I don't wan't to flush it) and I think I would like it too
The suggestion that I linked to actually goes further than a mere user id. It was suggested that every locomotive should have a constant combinator. That way, a train would not only be able to emit one single signal (Train ID), but several signals, just like any other constant combinator. A sub-suggestion of that thread even went further, stating that the signal the train emits should be dependant on the train's current order.
Re: Display train's ID number on scheduler UI
Posted: Fri Jan 31, 2020 11:53 pm
by Olacken
A user defined Id why not but not an antire combinator it would add too much complexity to an entity that is in my opinion already the most complexe entity of the game, in the number of feature it as.
I would be fine with a constant combinator cargo though that could do the same thing just not on the locomotive.(I only have basing knowledge of the mod API but it should be easly doable as a mod.)
Re: Display train's ID number on scheduler UI
Posted: Sun Feb 02, 2020 10:04 pm
by Mifczu
+1 for this idea
Re: Display train's ID number on scheduler UI
Posted: Mon Feb 03, 2020 7:44 am
by ssilk
A user defined ID is a name. (Seen from informatic aspect)
We already have train names, we just need a hash function that maps names to integers.
Re: Display train's ID number on scheduler UI
Posted: Mon Feb 03, 2020 7:36 pm
by JasonC
ssilk wrote: ↑Mon Feb 03, 2020 7:44 am
A user defined ID is a name. (Seen from informatic aspect)
We already have train names, we just need a hash function that maps names to integers.
I just want to see the current ID on the map. This feature request wasn't really for an expanded feature set.
That said, on the subject of user-defined IDs: That seems clunky and also a little off-theme as far as the current circuit networks go. What I would much rather see, which I think would be both useful and game-appropriate, would be:
- Give each train one (or more, dunno) signal slots (with values or just 1/0), just like a constant combinator.
- Add a "read train's signal" option to stations (note this isn't a functional replacement for current "read train presence", since this outputs a train-specific signal not a station-specific signal).
- When the train is present at the station if the stations option is checked it outputs the trains defined signal.
Basically just give trains a built in constant combinator that the station can read.
Since were thinking about it.