[MOD 0.15] SmartTrains 2.0.5

Topics and discussion about specific mods
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Choumiko wrote:Updated to 0.3.98 for Factorio 0.13
Brunzenstein sent a luxurious cake to the Factorio team. You deverse one (or two) as well. Great work.

For me 0.13 has not happened until now :).

(By the way, 0.3.94 runs very reliably now in 0.12; my base has grown to some size, 20 trains and 50 stations all doing their work with a setup that is not trivial any longer; I've had it produce rockets for an hour without even a hitch. Let's hope we can reach this state in 0.13 soon, too.)
JumpToSignal: Checks the value of the signal set in the lamp when a train with gito Signal # leaves the station. The signal condition of the lamp is ignored. If the train leaves due to passed time, the value is ignored too (same behaviour as 0.12 versions)
Wait, what? Noooo.

What happens if you put more than 1 signal on the lamp? How does the station know which one is the relevant signal number?
Can I not set a condition anymore? Is the condition that there is some signal on the lamp?

I really, really need to be able to set a condition and have the lamp to be active only if the condition is met -- and then only interpret the signal that is mentioned in the condition.

Otherwise we'll lose a lot of flexibility and it would really make using the signal more complicated.

Use cases to illustrate this:
  • I have a multi-lane depot. Destination signals are put on all lanes simultaneously, but the lanes themselves filter them by only reacting to "their" signal (e.g. lane 1 has signal "A", lane 3 has signal "C", etc.)
  • I usually have the destination signal on the wire and possibly other stuff. I can still put the wire on the signal lamp and don't have to worry about the unrelated signals because I tell the lamp what signal it should listen to.
If this is not possible anymore I strongly urge you to reconsider :).
[*]Trains only update their schedule when arriving/leaving a station
How is this different from the current version? When I create a new train and add it to an existing line, will I not see the line schedule anymore before I send the train to a station and have it stop there? Or does that not apply when I mark a train as active for a line because that forces an update?
[*]added 2 new signals:
  • Station # : The # of the station in the schedule where the train is currently waiting
  • Destination: The # of the station in the schedule where the train is going (only set for 1 tick)
[/list]
You've already added this? Wow, nice, I'll test it right away. (The "station #" signal will be godsend, I have over 50 outposts now in my current game, and cleaning up is very taxing; also the double checking after setting up each station gets annoying. Just being able to plop down a new station and not having to worry about the signal number is going to be so amazing.)
I've been thinking about removing the lamp. As it is right now i could simply say: The first conditon rule in the schedule is the signal SmartTrains will check when getting the value for jumpTo, that would make space for a second combinator. Not sure yet.
If you remove the lamp, where do we connect the wire then for the input to the station? There must be some way to have a separate connector for the input and the output of the train station.

I also really like the lamp as an indicator, plus it looks pretty. Do not remove the lamp :o

Personally I don't mind the second combinator as long as it does have a different color, but I think it would confuse people that are not used to using SmartTrains.
Alright, then the current implementation isn't ideal. So the next should better be: "leaving tick" : set "train destination" signal and update cargo (so that it's exact), "leaving tick +1": unset all signals?
Yes, exactly that! Good point about updating the cargo. All the input from the station should be valid and exact, in case we want to use it during the "leaving tick".

The only thing that is important is that the train is guaranteed to actually leave the station when you send this (so all signals will be cleared in the very next tick and the train be on its way). I don't know if there's even another way, just mentioning it to make sure.

If you send bogus "leaving" signals and then the train remains at the station for any reason that would desync any circuit that relies on this information to reflect reality.
siggboy wrote:Yeah.. this isn't going to happen, besides the OPness, if there is more than one station named B i have no way of knowing where the train will go.
Oh, yeah, I forgot we're actually dealing with station names, and the numbers are not a unique identity of a station in the general case. Forget about it then, I was mainly brainstorming anyway.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Choumi, another thing, since I'm just browsing the GitHub repository:

When you work on that mod, can you make a more fine-grained history by commiting more often? (Or, not squash the history before making a release, if that's what you're actually doing.) The commit for 0.3.95 is so huge it makes it very hard to follow the changes (also since it's all in one file).

It would make it more easy to follow what changed between releases, and for what reasons (the reasons should be obvious from the commit or in the commit comment).

I know it's something that is not easy to get used to, I have to force myself as well quite a bit to create "clean" commits, but it would really help potential collaborators on your projects.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

xmnovotny
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jun 29, 2016 7:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by xmnovotny »

Choumiko:

Thank you for the update of this great mod.

But in the new version there is one problem - when there is a station in the schedule, that can't be reached from previous scheduled station, the train will not leave the station, even there is a reachable station in the station # rule. Train schedule is set to next station in the order and there is "No path" message.

I think it is caused that your mod waits until the train leave the station and after that it updates destination in the schedule. But when there is no path to the next station, train will not leave and right destination is not set.

That is little bit problem for me, because I have a system of loading stations and unloading stations for all ores and I have all these stations (include depot staions) in one schedule for all trains. Combinators system sends trains between loading and corresponding unloading stations. So now I need order stations in schedule, that always the next one is reachable by previous one. If will be great if it can be somehow solved.

And other small idea - I use stations maping and when I update train schedule, then I save changes to the line, after that line number is reset to 0 and the stations maping unchecks, so I have to recheck it (and if I forget to, it will mess my system :-) ). So it will be nice to preserve line number and stations mapping state.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Alright I just loaded my 0.12 save into 0.13 with the various mods updated, and hoped for the best.

The new signal checking behaviour is definitely causing havoc with my setup.

As I've mentioned, there are several copies of the depot (multiple lanes with all stations named "Depot"), and the destination signal gets distributed to all of these simultaneously. However, each lane reacts to a different signal name, i.e. the signal name is the identity of the station for that lane (e.g. signal "D" is for lane 4, signal "A" is for lane 1).

What happens, though, is that every lane does get the same signal condition. It seems like the first lane that got selected then copied the signal condition to all other lanes. So suddenly all the lanes would react to the condition "signal D > 0", so suddenly I have 10 copies of lane 4. This of course means that all the trains leave simultaneously and all to the same destination and game over...

The trains then also get stuck at their destination, but that might just be a consequence of the erratic behaviour above, or something else. I'll have to do more tests in a sandbox.

Currently I'm very afraid that the system is unusable for my purposes due to the new signals behaviour. I hope it can be changed.

Basically I need the old behaviour back: when a train is set to leave "on signal", then leave if and only if the signal on the station meets the condition; it should also not be affected, or affect other stations with the same name, but only the station where the train is waiting. Please tell me that is still possible in 0.13 ;)

Couple of other points:
  • The signal lamp and combinator are even harder to click than in 0.12. The selection box seems to be really small (probably because of overlap with the selection box of the actual station entity. Probably not easy to fix at all without breaking the update path due to repositioned entities.
    Also, depending on the orientation of the station, the combinator is basically not visible (you only see it when you know it's there).
  • Using the signals "S" and "D" for the station number and destination should not be permanent. I'm assuming you're planning to change this and these are only place holders until the icons are ready.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Choumiko »

siggboy wrote:Wait, what? Noooo.

What happens if you put more than 1 signal on the lamp? How does the station know which one is the relevant signal number?
Can I not set a condition anymore? Is the condition that there is some signal on the lamp?

I really, really need to be able to set a condition and have the lamp to be active only if the condition is met -- and then only interpret the signal that is mentioned in the condition.

Otherwise we'll lose a lot of flexibility and it would really make using the signal more complicated.

Use cases to illustrate this:
  • I have a multi-lane depot. Destination signals are put on all lanes simultaneously, but the lanes themselves filter them by only reacting to "their" signal (e.g. lane 1 has signal "A", lane 3 has signal "C", etc.)
  • I usually have the destination signal on the wire and possibly other stuff. I can still put the wire on the signal lamp and don't have to worry about the unrelated signals because I tell the lamp what signal it should listen to.
Hm, that's a good point. Right now it's like this: The train leaves due to the condition(s) in its schedule becoming true. SmartTrains notices the train leaving, checks the signal (e.g. "A") set at the lamp for the value and if that is a valid schedule number it changes the trains destination. So lets say your line uses "green signal" > 0 in the schedule as a condition. What you then would have to do is convert the "A" to "green" and send it to the trainstop. So each trainstop of your multilane depot would only send the signal if their own signal is set. That should work i think? I'm gonna change it a bit, so that the condition on the lamp is checked. If it's true then the signal value is used, otherwise it is not and the train is sent to the next station?
siggboy wrote: How is this different from the current version? When I create a new train and add it to an existing line, will I not see the line schedule anymore before I send the train to a station and have it stop there? Or does that not apply when I mark a train as active for a line because that forces an update?
Trains in manual mode update their schedule when you close the GUI, the only difference to the old version that trains waiting at a station don't try to update the schedule
siggboy wrote:If you remove the lamp, where do we connect the wire then for the input to the station? There must be some way to have a separate connector for the input and the output of the train station.

I also really like the lamp as an indicator, plus it looks pretty. Do not remove the lamp :o
I like the look too :D And as i wrote above, i might actually keep it, since i think multilane depots require them. You can (actually you must) connect the trainstop directly with wires to make it leave on a circuit condition.
siggboy wrote:The only thing that is important is that the train is guaranteed to actually leave the station when you send this (so all signals will be cleared in the very next tick and the train be on its way). I don't know if there's even another way, just mentioning it to make sure.

If you send bogus "leaving" signals and then the train remains at the station for any reason that would desync any circuit that relies on this information to reflect reality.
Since i set the signal after receiving the on_the_path event, the train has already left the station :D
siggboy wrote:It would make it more easy to follow what changed between releases, and for what reasons (the reasons should be obvious from the commit or in the commit comment).

I know it's something that is not easy to get used to, I have to force myself as well quite a bit to create "clean" commits, but it would really help potential collaborators on your projects.
Yes, i try to do that, but this update i made so many half completed changes to different areas that smaller commits would only contain unfinished changes :o :D


xmnovotny wrote:But in the new version there is one problem - when there is a station in the schedule, that can't be reached from previous scheduled station, the train will not leave the station, even there is a reachable station in the station # rule. Train schedule is set to next station in the order and there is "No path" message.

I think it is caused that your mod waits until the train leave the station and after that it updates destination in the schedule. But when there is no path to the next station, train will not leave and right destination is not set.
Is the train leaving due to the time being passed or does it leave early? If it leaves due to time the station# rule is ignored (as it was in all versions before i think)
xmnovotny wrote:And other small idea - I use stations maping and when I update train schedule, then I save changes to the line, after that line number is reset to 0 and the stations maping unchecks, so I have to recheck it (and if I forget to, it will mess my system :-) ). So it will be nice to preserve line number and stations mapping state.
That sounds like a bug.


siggboy wrote:Alright I just loaded my 0.12 save into 0.13 with the various mods updated, and hoped for the best.

The new signal checking behaviour is definitely causing havoc with my setup.

What happens, though, is that every lane does get the same signal condition. It seems like the first lane that got selected then copied the signal condition to all other lanes. So suddenly all the lanes would react to the condition "signal D > 0", so suddenly I have 10 copies of lane 4. This of course means that all the trains leave simultaneously and all to the same destination and game over...

The trains then also get stuck at their destination, but that might just be a consequence of the erratic behaviour above, or something else. I'll have to do more tests in a sandbox.
Can you post a screenshot of the trainschedule with the depot selected so i can see the conditions in the schedule? I tried to migrate the SmartTrains rules to the vanilla conditions and might have messed that up.
siggboy wrote:Currently I'm very afraid that the system is unusable for my purposes due to the new signals behaviour. I hope it can be changed.

Basically I need the old behaviour back: when a train is set to leave "on signal", then leave if and only if the signal on the station meets the condition; it should also not be affected, or affect other stations with the same name, but only the station where the train is waiting. Please tell me that is still possible in 0.13 ;)
Should still be possible (with a few changes to the setups)
siggboy wrote: Couple of other points:
  • The signal lamp and combinator are even harder to click than in 0.12. The selection box seems to be really small (probably because of overlap with the selection box of the actual station entity. Probably not easy to fix at all without breaking the update path due to repositioned entities.
    Also, depending on the orientation of the station, the combinator is basically not visible (you only see it when you know it's there).
  • Using the signals "S" and "D" for the station number and destination should not be permanent. I'm assuming you're planning to change this and these are only place holders until the icons are ready.
I could decrease the selection box of the trainstop, that would at least make them easier to select. If i reposition them it would only be for newly placed trainstops.
Yes, they are temporarily, didn't feel like starting up gimp last night :D

xmnovotny
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jun 29, 2016 7:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by xmnovotny »

Choumiko wrote:
xmnovotny wrote:But in the new version there is one problem - when there is a station in the schedule, that can't be reached from previous scheduled station, the train will not leave the station, even there is a reachable station in the station # rule. Train schedule is set to next station in the order and there is "No path" message.

I think it is caused that your mod waits until the train leave the station and after that it updates destination in the schedule. But when there is no path to the next station, train will not leave and right destination is not set.
Is the train leaving due to the time being passed or does it leave early? If it leaves due to time the station# rule is ignored (as it was in all versions before i think)
The train was set to leave when there is a full inventory. When the next station in schedule was reachable that worked fine - train was heading to the station with right station#. But when I have changed the next station to one which was not reachable, then after condition was met, the destination of train was next station (with "No path message") and not the station with station#.

And one question (I don't know if it is bug or I'm doing something wrong). How vanilla station signal condition works? I try set signal condition as only condition at station, but train always leaved whenever signal condition was met. I try this with both vanilla and smart train stop, but train didn't wait.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Choumiko »

xmnovotny wrote:The train was set to leave when there is a full inventory. When the next station in schedule was reachable that worked fine - train was heading to the station with right station#. But when I have changed the next station to one which was not reachable, then after condition was met, the destination of train was next station (with "No path message") and not the station with station#.
Ah, that makes sense.. I think i can workaround it. Currently SmartTrains detects when a train goes from "wait at station" to "moving", if i change it to also detect "wait at station" -> "no path" it should work.
xmnovotny wrote: And one question (I don't know if it is bug or I'm doing something wrong). How vanilla station signal condition works? I try set signal condition as only condition at station, but train always leaved whenever signal condition was met. I try this with both vanilla and smart train stop, but train didn't wait.
Take a look at the attached Demo (it also shows that multilane depots still work). Basically you set the condition in the schedule and connect the trainstop itself to the network.
One thing i forgot to mention: Right now the SmartTrain stop connects the lamp to the station with red+green wire when it is build (and in fact when updating to the latest SmartTrains version) Not sure whether this was such a good idea.
Attachments
MiniDemo.zip
(5.49 MiB) Downloaded 103 times

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Alright, I've done a bit of homework, long reply incoming :).

I've also found a few bugs and have some suggestions for changes, but first the reply to what you've written.
Choumiko wrote: Hm, that's a good point. Right now it's like this: The train leaves due to the condition(s) in its schedule becoming true. SmartTrains notices the train leaving, checks the signal (e.g. "A") set at the lamp for the value and if that is a valid schedule number it changes the trains destination. So lets say your line uses "green signal" > 0 in the schedule as a condition. What you then would have to do is convert the "A" to "green" and send it to the trainstop. So each trainstop of your multilane depot would only send the signal if their own signal is set. That should work i think?
Yeah, I understand now how it works. Your suggestion of using another combinator to recolor the different lane signals to one unique signal is good. I've already tried this, it seems to work. Unfortunately my circuit is apparently broken in 0.13 (probably due to the changes in the decider combinator), so I can't test a running system, but the lane selection should work with that change you've suggested.
Trains in manual mode update their schedule when you close the GUI, the only difference to the old version that trains waiting at a station don't try to update the schedule
OK, so if my train is currently waiting at the Depot (for a signal), and I add a new station to the line, will the train know about that new station when it leaves?

I'm asking because in practice I have (lots) of trains waiting at the depot and I make changes to the Main Train Line, for example when I add a new outpost or requester. Then I need the trains waiting in line in front of the depot to recognize this change when they leave. That is, if a train that has been waiting is sent to that new outpost that I've just added then it must be able to find it. Will that be possible?

It worked fine in 0.12 (I simply picked any train at random in order to make the change to the main line, but all the trains somehow picked it up.)

(About the lamp.)
I like the look too :D And as i wrote above, i might actually keep it, since i think multilane depots require them.
I don't think that multilane depots require the lamp -- I was mistaken about that because I misunderstood how the new condition checking works. But the lamp is nice because it lights up when the signal condition is active, and I'd very much like to retain that (even if it has to be done differently now, I don't know).
Can you post a screenshot of the trainschedule with the depot selected so i can see the conditions in the schedule? I tried to migrate the SmartTrains rules to the vanilla conditions and might have messed that up.
No, the migration looks fine. In the Depot (which exists 10 times, one on each lane), the condition that was chosen is "signal 6 > 0", so it sort of arbitrarily copied the condition from lane 6. That's fine, though, there's only one Depot now, so there can be only 1 condition. The old implementation simply does not work any more. I have to change this as you've suggested above (using "foo > 0" and then converting the unique signal to "foo" on each lane).

I guess this can't be migrated cleanly, the player has to reset the condition in the schedule and change the circuit for multilane anyway.
siggboy wrote:it should also not be affected, or affect other stations with the same name, but only the station where the train is waiting. Please tell me that is still possible in 0.13 ;)
Should still be possible (with a few changes to the setups)
Well if several stations share the same name, then they're treated as the same station. In 0.12 the condition was not affected by this, since it was all handled by SmartTrains, in 0.13 it's different. But the stuff that I want to do is still possible, just a bit different.
I could decrease the selection box of the trainstop, that would at least make them easier to select. If i reposition them it would only be for newly placed trainstops.
The selection box of the train station needs to be made (a lot) smaller. Right now the gap that you have to click into is really small even if you're zoomed in all the way. So it's very difficult to hit the combinator if you want to attach a wire to it.

Having a real, custom entity, that replaces the train station entirely, and does have the same footprint (2x2), but easily recognizeable connectors, would of course be perfect. Sadly I can't provide you with that since I'm not a graphic artist.
(The signals "S" and "D") Yes, they are temporarily, didn't feel like starting up gimp last night :D
Actually I like the letters, theyre' so easy to recognize and to remember. Sadly they'll collide with existing circuits that use them... so we need custom signals.

Ok, now here's a few other things that I've found:
  • The combinator is placed in the wrong location when the migration from 0.12 is done. If you mine the station and then replace it, it will appear in the correct location. You should fix this if possible, or you'll have a lot of people running around their maps replacing stations (Xeteth will probably go insane, but even in my smallish map I have 50 train stations I'd have to replace manually...).
  • You should swap the locations of the lamp and the combinator, this will look better in 3 of the 4 possible orientations, and it will still look OK in the remaining one. The problem right now is that the "connector" sprite on the lamp that has been added can be easily confused with the connector sprite of the station -- and the players won't really know what's what and be confused. Especially since connecting to the lamp doesn't really do anything and you have to connect to the station proper.
  • Connecting the lamp to the station automatically with green and red wire is not a great idea (as you've said yourself already). I also don't think it does help with anything so you should remove that.
  • Now for a really weird bug. I'm not sure if this is a bug in Vanilla or in the mod, haven't tested yet: I have a train waiting at the depot, for the circuit condition. No wait timeout has been set. Now, as soon as I remove a rail in front of the depot -- which would change the path to the next station in the schedule, since they're all reachable from the depot -- as soon as I remove that rail, all the trains leave the stations. So the changed path somehow triggers the trains to leave. This is also what caused all my trains to run to the first station in the schedule (station #2), when I first tried the save in 0.13; because I've change some rail somewhere on the map and this made all the train leave and run amok. So maybe this is something that is caused by the Vanilla game, or by SmartTrains. If you can't reproduce it I can send you my save, where it's definitely reproducable.
    Obviously this is a complete showstopper and needs to be fixed :).

    Edit: Just found out that the bug is triggered even if the change to the rail network is not connected to the main line. I've placed an isolated train stop along some rail (from a blueprint), not connect to any other rails, and the trains immediately left the depot.
I'll now try to fix my thingy so it will actually schedule trains again and then I'll probably be back with more input later.
Last edited by siggboy on Sun Jul 03, 2016 1:30 pm, edited 1 time in total.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

xmnovotny
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jun 29, 2016 7:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by xmnovotny »

Choumiko wrote:
xmnovotny wrote: And one question (I don't know if it is bug or I'm doing something wrong). How vanilla station signal condition works? I try set signal condition as only condition at station, but train always leaved whenever signal condition was met. I try this with both vanilla and smart train stop, but train didn't wait.
Take a look at the attached Demo (it also shows that multilane depots still work). Basically you set the condition in the schedule and connect the trainstop itself to the network.
One thing i forgot to mention: Right now the SmartTrain stop connects the lamp to the station with red+green wire when it is build (and in fact when updating to the latest SmartTrains version) Not sure whether this was such a good idea.
Thank you for the demo, now I see, that there is some bug in my savefile (or maybe some mod collision), because for me it is not working and the train leaves station immediately even circuit condition is not met. I try hard reset Smart train, remove train from track and put it back, but nothing helps.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

xmnovotny wrote:Thank you for the demo, now I see, that there is some bug in my savefile (or maybe some mod collision), because for me it is not working and the train leaves station immediately even circuit condition is not met. I try hard reset Smart train, remove train from track and put it back, but nothing helps.
Maybe it's related to the bug I've found (train is waiting for circuit condition, I remove a rail from the network, and suddenly the train leaves). Sounds like it, or you've found another, similar, bug.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Nexela »

xmnovotny wrote:
Thank you for the demo, now I see, that there is some bug in my savefile (or maybe some mod collision), because for me it is not working and the train leaves station immediately even circuit condition is not met. I try hard reset Smart train, remove train from track and put it back, but nothing helps.
I am having the same problem in my save migrated from .12.35 to .13.3 I can't figure it out for the life of me! New worlds created in .13.3 the circuit conditions work fine. Hopefully I am able to figure out a fix for this or it magically gets fixed in the next factorio update :) My next step is possibly to remove smart trains from my 12.35 and then migrate that way and see if it fixes it.

I also have the rail/signal placing bug.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Choumiko »

siggboy wrote:OK, so if my train is currently waiting at the Depot (for a signal), and I add a new station to the line, will the train know about that new station when it leaves?

I'm asking because in practice I have (lots) of trains waiting at the depot and I make changes to the Main Train Line, for example when I add a new outpost or requester. Then I need the trains waiting in line in front of the depot to recognize this change when they leave. That is, if a train that has been waiting is sent to that new outpost that I've just added then it must be able to find it. Will that be possible?

It worked fine in 0.12 (I simply picked any train at random in order to make the change to the main line, but all the trains somehow picked it up.)
I'm answering with a careful yes. When leaving it gets the signal value, then checks if the line needs updating and updates and then does the jump. So it should work, if not it's a bug.
I don't think that multilane depots require the lamp -- I was mistaken about that because I misunderstood how the new condition checking works. But the lamp is nice because it lights up when the signal condition is active, and I'd very much like to retain that (even if it has to be done differently now, I don't know).
Lamp behavior is staying as is for a while, if a player doesn't use goto signal# or doesn't care if it lights up or not he just doesn't to connect it.
No, the migration looks fine. In the Depot (which exists 10 times, one on each lane), the condition that was chosen is "signal 6 > 0", so it sort of arbitrarily copied the condition from lane 6. That's fine, though, there's only one Depot now, so there can be only 1 condition. The old implementation simply does not work any more. I have to change this as you've suggested above (using "foo > 0" and then converting the unique signal to "foo" on each lane).

I guess this can't be migrated cleanly, the player has to reset the condition in the schedule and change the circuit for multilane anyway.
Yes, i didn't think of multiple stations with the same name, right now the condition will be the signal from the last built trainstop with the name, but that should be ok i guess.
siggboy wrote:In 0.12 the condition was not affected by this, since it was all handled by SmartTrains, in 0.13 it's different. But the stuff that I want to do is still possible, just a bit different.
Yes, 0.13 SmartTrains is quite different, but after the migration work is done and we're used to the new vanilla stuff i think it should be much better (performance wise it already is :D )
siggboy wrote: Having a real, custom entity, that replaces the train station entirely, and does have the same footprint (2x2), but easily recognizeable connectors, would of course be perfect. Sadly I can't provide you with that since I'm not a graphic artist.

Actually I like the letters, theyre' so easy to recognize and to remember. Sadly they'll collide with existing circuits that use them... so we need custom signals.
Neither am I :lol:
The signals only have the same icon, but are different/new signals, so no collisions.

siggboy wrote:
  • The combinator is placed in the wrong location when the migration from 0.12 is done. If you mine the station and then replace it, it will appear in the correct location. You should fix this if possible, or you'll have a lot of people running around their maps replacing stations (Xeteth will probably go insane, but even in my smallish map I have 50 train stations I'd have to replace manually...).
  • You should swap the locations of the lamp and the combinator, this will look better in 3 of the 4 possible orientations, and it will still look OK in the remaining one. The problem right now is that the "connector" sprite on the lamp that has been added can be easily confused with the connector sprite of the station -- and the players won't really know what's what and be confused. Especially since connecting to the lamp doesn't really do anything and you have to connect to the station proper.
  • Connecting the lamp to the station automatically with green and red wire is not a great idea (as you've said yourself already). I also don't think it does help with anything so you should remove that.
  • Now for a really weird bug. I'm not sure if this is a bug in Vanilla or in the mod, haven't tested yet: I have a train waiting at the depot, for the circuit condition. No wait timeout has been set. Now, as soon as I remove a rail in front of the depot -- which would change the path to the next station in the schedule, since they're all reachable from the depot -- as soon as I remove that rail, all the trains leave the stations. So the changed path somehow triggers the trains to leave. This is also what caused all my trains to run to the first station in the schedule (station #2), when I first tried the save in 0.13; because I've change some rail somewhere on the map and this made all the train leave and run amok. So maybe this is something that is caused by the Vanilla game, or by SmartTrains. If you can't reproduce it I can send you my save, where it's definitely reproducable.
    Obviously this is a complete showstopper and needs to be fixed :).
  • (My) migration didn't change locations of old trainstops, i did change the locations for new ones though. And apart from being in strange positions it shouldn't affect the way they work (i think), so replacing can be done lazily
  • In the picture below which ones do you mean? The lamp of the eastern one looks odd, but i could erase the overlapping part of the trainstop sprite. Other than that i think it looks halfway decent, considering that i simply slapped them in there :)
  • In the update below it won't connect anymore, existing stops stay connected though
  • That's (luckily) vanilla: viewtopic.php?f=7&t=28042
Image


Updated to SmartTrains 0.3.99

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Nexela wrote:
xmnovotny wrote:
Thank you for the demo, now I see, that there is some bug in my savefile (or maybe some mod collision), because for me it is not working and the train leaves station immediately even circuit condition is not met. I try hard reset Smart train, remove train from track and put it back, but nothing helps.
I am having the same problem in my save migrated from .12.35 to .13.3 I can't figure it out for the life of me! New worlds created in .13.3 the circuit conditions work fine. Hopefully I am able to figure out a fix for this or it magically gets fixed in the next factorio update :) My next step is possibly to remove smart trains from my 12.35 and then migrate that way and see if it fixes it.

I also have the rail/signal placing bug.
I've just tested it. Here's your problem (I've disabled SmartTrains for my tests so it's definitely not related to SmartTrains, it's a Vanilla feature/bug).

If there is no wire connected to the train station, and you set a "circuit condition", then the train station simply ignores the condition and the trains don't wait at all. As soon as you connect a wire to the station you "activate" the condition. You can even remove the wire afterwards and it still stays enabled (train waits forever then). It does not matter what's on the wire, it can be an empty wire just connected to an electric pole.

Apparently the station needs to become part of any circuit network otherwise it won't recognize the condition.

I think it's pretty dumb and I consider it a bug (it's probably not intended). Maybe somebody should make a report if that has not already happened.

Edit: I'll test if it also happens in a newly created world, and then I'll make a bug report.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

xmnovotny
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jun 29, 2016 7:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by xmnovotny »

siggboy wrote:
Nexela wrote:
xmnovotny wrote:
Thank you for the demo, now I see, that there is some bug in my savefile (or maybe some mod collision), because for me it is not working and the train leaves station immediately even circuit condition is not met. I try hard reset Smart train, remove train from track and put it back, but nothing helps.
I am having the same problem in my save migrated from .12.35 to .13.3 I can't figure it out for the life of me! New worlds created in .13.3 the circuit conditions work fine. Hopefully I am able to figure out a fix for this or it magically gets fixed in the next factorio update :) My next step is possibly to remove smart trains from my 12.35 and then migrate that way and see if it fixes it.

I also have the rail/signal placing bug.
I've just tested it. Here's your problem (I've disabled SmartTrains for my tests so it's definitely not related to SmartTrains, it's a Vanilla feature/bug).

If there is no wire connected to the train station, and you set a "circuit condition", then the train station simply ignores the condition and the trains don't wait at all. As soon as you connect a wire to the station you "activate" the condition. You can even remove the wire afterwards and it still stays enabled (train waits forever then). It does not matter what's on the wire, it can be an empty wire just connected to an electric pole.

Apparently the station needs to become part of any circuit network otherwise it won't recognize the condition.

I think it's pretty dumb and I consider it a bug (it's probably not intended). Maybe somebody should make a report if that has not already happened.

I am affraid that is not the problem. I tried to set various conditions and signals from constant combinator and I had station connected to the circuit network. And also I have connected my old smart stops to the controller network, but neither one worked.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

xmnovotny wrote:I am affraid that is not the problem. I tried to set various conditions and signals from constant combinator and I had station connected to the circuit network. And also I have connected my old smart stops to the controller network, but neither one worked.
Well, then you have found yet another bug I guess.

I've just confirmed the behaviour on a fresh map. The circuit condition does nothing at all until you've connected the train station to a piece of wire at least once. The it becomes active.

It does not affect the rail placing bug.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Choumiko wrote:Lamp behavior is staying as is for a while, if a player doesn't use goto signal# or doesn't care if it lights up or not he just doesn't to connect it.
Can you make the lamp require no power? It has always annoyed me that I have to connect the lamp to power or I'll have that stupid yellow signal blinking (even if I don't intend to connect the lamp at all). It also confused me for a long while because I assumed that the train stop itself needs power in order to work (it doesn't).

I don't know if it's possible to create a lamp that uses no power but if yes, then please do it.
Yes, 0.13 SmartTrains is quite different, but after the migration work is done and we're used to the new vanilla stuff i think it should be much better (performance wise it already is :D )
Right now they need to fix the bug that makes the trains leave when you place a rail, or I can't play any real game :).
The signals only have the same icon, but are different/new signals, so no collisions.
Ah OK, well, they need icons or you can't tell them apart from the actual "S" and "D" signals, lel. It's fine, though, I understand it's preliminary and I really like the features related to these icons :).
[*](My) migration didn't change locations of old trainstops, i did change the locations for new ones though. And apart from being in strange positions it shouldn't affect the way they work (i think), so replacing can be done lazily
Yeah, but you should point this out in the release notes, also because the migration leaves the constant combinator in a position where it's practically invisible (more or less "inside" the train station).
[*]In the picture below which ones do you mean? The lamp of the eastern one looks odd, but i could erase the overlapping part of the trainstop sprite. Other than that i think it looks halfway decent, considering that i simply slapped them in there :)
Image
The right one will look better, in the left one the "connector sprite" on the lamp will be covered up (but if you can erase that it doesn't matter I guess). The top one will look slightly better as well and for the bottom one it makes no difference.

The lamp will just be more visible and less covered up if you simply swap combinator and lamp in all cases.

It's not a huge thing, if you actually find it looks worse or makes no difference just leave it. Maybe I was nitpicking a little here.

(BTW you can inline pictures that you upload as attachments, that's easier than uploading them to imgur every time.)
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Nexela »

Yeah it seems to be a migration issue. mine is connected with a constant combinator to the station (either smart or regular) and it completely ignores the circuit condition. After my power nap I will see if I can trim down my map/ and mods in 12.35 reproduce and make a bug report.


On another note I had a moment of inspiration. Choumiko added a "station #" signal but also has a "train at station" signal. Couldn't the 2 signals be merged into 1 and have train at station output the station number? That way Only 1 more signal graphic would be needed and that could be solved by putting an arrow on the train at station one :)
Just a minor thought I had :)

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Nexela »

Oh yeah with .13 you should be able to suppress the flashing no electricity icon. But would probably still need power to make the lamp work.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by siggboy »

Nexela wrote:Oh yeah with .13 you should be able to suppress the flashing no electricity icon. But would probably still need power to make the lamp work.
How can you disable that? I also want to disable it when I work on large late game factories that are powered off. The blinking is very distracting then.

Normally you only need the blinking indicator when you're building something. As soon as it's all connected you don't need it anymore. Of course, the red indicator for actual power failure is still useful in all cases.
On another note I had a moment of inspiration. Choumiko added a "station #" signal but also has a "train at station" signal. Couldn't the 2 signals be merged into 1 and have train at station output the station number? That way Only 1 more signal graphic would be needed and that could be solved by putting an arrow on the train at station one :)
Just a minor thought I had :)
No, the "station #" signal needs to be always on, because if your circuit requires the information what station number it's connected to then it must always be available/readable, not only when a train is waiting. I have a complex setup that needs the station number, and it will make managing and setting it up a lot easier when I can read it from the combinator and don't have to set it manually every time I add a new station to the network.

But your suggestion has merit, the "train-at-station" signal could also carry the station number, and it could even cover the case where the station is part of more than one line (it would then display the correct station number for the specific train in question). It wouldn't be very useful though for my case, but maybe there are other cases where it's perfect. However, some contraptions are easier to make if you have a signal that can only be "1" or "0". So it would have downsides if you suddenly make it assume arbitrary positive values.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.30+] SmartTrains 0.3.95

Post by Choumiko »

siggboy wrote:Can you make the lamp require no power? It has always annoyed me that I have to connect the lamp to power or I'll have that stupid yellow signal blinking (even if I don't intend to connect the lamp at all). It also confused me for a long while because I assumed that the train stop itself needs power in order to work (it doesn't).
The lamp needed power in 0.12 versions, else it would return false when checked for the condition :D The icon is a bit annoying, true, if i can set it to no power or disable the icon i'll do so.
siggboy wrote:The right one will look better, in the left one the "connector sprite" on the lamp will be covered up (but if you can erase that it doesn't matter I guess). The top one will look slightly better as well and for the bottom one it makes no difference.

The lamp will just be more visible and less covered up if you simply swap combinator and lamp in all cases.

It's not a huge thing, if you actually find it looks worse or makes no difference just leave it. Maybe I was nitpicking a little here.

(BTW you can inline pictures that you upload as attachments, that's easier than uploading them to imgur every time.)
I'll keep thinking about it, especially since changing graphics requires a factorio restart to take effect. Imgur lets me upload from the clipboard, that's why i use it, no need to save them and end up with dozens of images that i'll never look at again :mrgreen:
Nexela wrote:On another note I had a moment of inspiration. Choumiko added a "station #" signal but also has a "train at station" signal. Couldn't the 2 signals be merged into 1 and have train at station output the station number? That way Only 1 more signal graphic would be needed and that could be solved by putting an arrow on the train at station one :)
Just a minor thought I had :)
siggboy wrote:No, the "station #" signal needs to be always on, because if your circuit requires the information what station number it's connected to then it must always be available/readable, not only when a train is waiting. I have a complex setup that needs the station number, and it will make managing and setting it up a lot easier when I can read it from the combinator and don't have to set it manually every time I add a new station to the network.
Currently Station # is only set when there's a train at the station, to make it output constantly i will have to add some way to tell it what to output, since the station can be on multiple lines in different positions. A checkbox in the trainlines window when a trainstop is being opened? So you can select in which line it should look up the number? if no line has it set it would not be set without a train. If the station has a mapping set then it would always output that number.
For the graphics i'll probably simply stick a "#" on top of the "train at stop" signal and be done with :mrgreen:

Post Reply

Return to “Mods”