vortex1967 wrote: by vortex1967 » Sat Aug 19, 2017 11:07 am
Hi all,
Sorry, in advance for the long post. There is a lot involved in getting this mod to work automatically with no, or very little intervention by the player.
The station at the smelters uses an expanded and adapted version of the outpost design.
All the following images are taken from the station at the smelters.
At the moment designs have been laid out into sections for ease of trouble shooting.
Blueprints...I am using the 'Lighted Power Pole Mod' and all the signal wires are run along these poles. I will have to redo all the logic stuff onto vanilla poles.
Any chance you could give a little explanation about how you got rail signals to work in conjunction with this mod?
I have a small system set up where a pair of locomotives brings in empty cars and swaps it for full cars, but the whole system is one big block, which is a bad plan long term.
Your screenshots seem to have signals on the tracks. How do you get your locomotives to approach parked rolling stock and successfully connect?
Re: [0.15] Automatic Coupler
Posted: Wed Aug 30, 2017 11:22 am
by TalAntilles
GotLag, I just wanted to say that this mod is fantastic. It's the only working automatic coupler mod I can find and it makes trains so much more interesting.
I've also just run into a multiplayer desync involving a train coupling to a few cars (in my case, two locomotives coupling to four item cars). No other mods installed. I have attached a desync report to this post if that is any help. Has anyone else found a solution to this?
Re: [0.15] Automatic Coupler
Posted: Wed Aug 30, 2017 2:31 pm
by Ruben_NL
TalAntilles wrote:GotLag, I just wanted to say that this mod is fantastic. It's the only working automatic coupler mod I can find and it makes trains so much more interesting.
I've also just run into a multiplayer desync involving a train coupling to a few cars (in my case, two locomotives coupling to four item cars). No other mods installed. I have attached a desync report to this post if that is any help. Has anyone else found a solution to this?
i have the same problem. since today(maybe because an upgrade in server hardware, but i don't think so.)
It happens also when i setup an multiplayer server local, with only me on it.
Re: [0.15] Automatic Coupler
Posted: Wed Aug 30, 2017 2:38 pm
by Nexela
If this is easily reproducible can you post the save where it happens?
Re: [0.15] Automatic Coupler
Posted: Wed Aug 30, 2017 9:52 pm
by TalAntilles
Yes, I will post the save and a guide to reproducing it later tonight. I have gotten it to happen 3-4 times now, though I am the only one (of three total) on the server affected. Although the other two are on the same network, so that may be a factor as well. If I find a solution I will post it, and any other things people find that work would be awesome to read.
Re: [0.15] Automatic Coupler
Posted: Sun Sep 03, 2017 8:02 am
by TalAntilles
Apologies for taking longer than anticipated, but I have attached the save. Only mod used is Automatic Coupler. You will want to look at the Southeast corner, specifically the railyard-in-progress right next to a large iron refinery. It is disconnected from the main rail line. It can be reproduced by having a shunter vehicle on automatic connect to a train of just cargo cars that is more than one car long.
In the meantime I have done a little more testing. It appears to select the player it desyncs at random. It is confirmed to not be the most recent player to join the server. It is also unrelated to the player that actually sets the orders. I suppose it could be based on ping, but can't test that theory yet. I have not yet tested it with fluid train cars either. All the cars tested have been empty as well, if that matters. It works fine on singleplayer.
Hope this helps!
Re: [0.15] Automatic Coupler
Posted: Tue Sep 05, 2017 1:17 am
by vortex1967
Hi ransburger,
Sorry for the delay in replying.
Connecting to rolling stock.
To connect double header locomotives to wagons a rail signal can be placed between the wagon and the stop(as close to the stop as possible).
I place 4 signals to prevent what is happening on one side of a train stop from getting transferred to the other side.
My example has 2 stops but signals can be placed either side of 1 stop and it still works.
This does not work for locomotives. This works for wagons only with a...But...(see the next spoiler).
The 4 combinators are so I could set couple and uncouple signals separately to get the positioning of the wagons correct from either side.
Signal Placement.jpg (191.14 KiB) Viewed 8382 times
Signal Placement_Wagon.jpg (218.1 KiB) Viewed 8382 times
The But...and an Also.
The But...
Occasionally, situations arise where the wagons seem to get uncoupled in a slightly different position.
In the following image I noticed this had occurred at the smelters when I was going to take a screen shot to explain your question.
The 2 signals circled in blue show that the top signal is green, which is correct.
While the bottom signal is red, which is incorrect. It should be green, there are wagons to pick up.
The way I fix it is to attach a locomotive to the other end of the wagons and give them a tweak away from the stop.
Occasionally this happens.jpg (429.57 KiB) Viewed 8382 times
and the Also...
Another situation that I have noticed happening:
I connect 16 wagons to the back of 3 locomotives to transport empty wagons to an outpost and return with 16 full wagons to the smelters.
The connection sometimes fails and the 3 locomotives return with no wagons attached. I haven't yet figured out why it happens.
The wagons are in position behind the locomotives but the connection just fails. As a result the wagons are not in the correct position for the next cycle so it requires intervention from the player.
I have safety measures in place to prevent trains smaller than 3 locomotives-16 wagons from entering either the
smelters or the outposts to compensate for the derpiness of train path finding. It also helps when a connection fails because the 3 locomotives can't enter back into the smelters
and take more empty wagons out.
In my O.P. I made a comment of ”There is a lot involved in getting this mod to work automatically with no, or very little intervention by the player.”
These situations are the “...or very little intervention by the player.” side of this using mod.
Connecting to the back of locomotives.
To connect wagons to the back of locomotives signals can't be used in the area where the connection takes place.
Trains can travel from non-signaled zones into signaled zones quite easily, the problem occurs when trains try to
travel from a signaled zone back into the non-signaled zone if there is a train(my snake joiner) in the non-signaled zone...it's that last signal.
To overcome that last signal I use what I dubbed “The Bridge”. If you look closely at the smelters overview about a third of the way down on the far left there are 2 wagons.
Those 2 wagons actually sit on top of that last signal.
When locomotives connect to those wagons they effectively hop over that signal because the front of the locomotives has now moved to the front of the wagons,
the locomotives are now in the non-signaled zone.
Smelters overview.jpg (291.17 KiB) Viewed 8382 times
The locomotives then proceed to the next stop I have placed to uncouple the wagons.
The next stop in the schedule after the uncoupling is placed at the point where the locomotives were connected to the wagons.
Because the stop is placed at the front of the locomotives the locomotives effectively don't move.
They then wait for a condition to be met, which is the wagons being removed.
Just after that stop there is a junction, hence the use of 2 wagons. They provide room for the junction.
There is a double header train who's sole purpose is to remove the wagons from in front of the locomotives and reset
the wagons back over that last signal ready for the next locomotive to connect to.
Re: [0.15] Automatic Coupler
Posted: Wed Sep 06, 2017 8:19 am
by driver
You usually need three stops for uncoupling ("end"-stop to change direction and two stops for decoupling/coupling, because trainstops don't always properly align to each other. To better understand this, you could take a look at Nifty Maniacs video https://www.youtube.com/watch?v=fQAgWssR2aY
his mod worked similar.
Something I tried recently is this:
A train with 4 waggons (2x coal and 2 more or less empty waggons for copperore) enters the station at the right border, unloads some coal, then goes backwards to an "end"-stop, then forwards to the next stop for decoupling and decouples the 2 waggons for copperore (which ideally should be empty), goes to the stop at the right border again and then backwards to the station to couple two waggons with copperore and leaves.
The second pair of locomotives which provides the two full copperore waggons is still blocked and can only continue the path if the 4-waggon-train takes the 2 full waggons with copperore and leaves. No circuits involved.
Re: [0.15] Automatic Coupler
Posted: Wed Sep 27, 2017 9:56 am
by cid0rz
Hello all, I'm trying this mod. Very nice indeed! I liked the one with pieces of rail that break or join the train but of course with signals it is much more flexible!
I'm trying to do a classification staiton. In this station trains with mixed wagons should arrive in different composition from the factories. So one can bring 3 wagosn of ironplate + 2 wagons of greencards for example. And then in this station the wagons would be stacked, classified and when needed a train according to factory demand would be assembled. It is a proof of concept so the complete operation cycle is not totally defined yet.
I managed to make it work sequentially, so it was not easy but I managed to place the couplers and uncouplers to perform the tasks I wanted. The problem is I'm using the Smarter Trains mod to be able to direct the wagons to their corresponding stock railways "programatically". When I couple or uncouple the wagons, they are taken out form the "line" of the smarter trains so they start going to the stations sequentially (like normal facotrio trains do). My question is, is it possible to keep the locomotives that couple or stack in the smarter trains line? I don't know how the internals of the mods work so any help on this directioon would be appreciated. I modified the layout wit the smart stops so I cannot show you images of it let's say working but I attach one so you have an idea.
Re: [0.15] Automatic Coupler
Posted: Wed Sep 27, 2017 6:57 pm
by cid0rz
I made a small video to show functionality. i had to implement it with "dumber" trains. The problem with this approach is you loose a lot of flexibility and you need one locomotive for each operation instead of one for all. If I counld use the gotosignal# of smarter trains the build would have more combinators and less locos ^^
I don't think Smarter Trains can be used to sort wagons by their contents.
I came up with a design to see if it was possible to automatically sort random composition trains.
It uses 1 double header locomotive to do the sorting.
Wagons can be delivered any length(adjust length of the delivery station to suit)
No requirement to split wagons before sorting.
The sorted wagons can be any length(adjust length of the sorted stations to suit)
Ready to sort
1Ready to Sort.jpg (1.34 MiB) Viewed 8257 times
Midway sorted
2Midway.jpg (1.32 MiB) Viewed 8257 times
Last wagon to sort
3Last Wagon.jpg (1.32 MiB) Viewed 8257 times
Sorting complete
4Sorting Complete.jpg (1.3 MiB) Viewed 8257 times
Re: [0.15] Automatic Coupler
Posted: Wed Oct 04, 2017 7:19 pm
by cid0rz
Hi Vortex,
Very interesting design, very similar to what I have. I think smarter trains can be used to send the locomotive where you want, following a program that could also change the other signals, including the coupling and uncoupling signals. It was to explore more complex logic when sorting and composing new trains. I've used smarter trains to create a system that can deliver trains on demand, calculating number of trains needed, if the stock is available, it resets if it does not find a suitable provider, etc. So i think wit the ability to change your train itinerary by a signal you can build more complex stuff. Nevertheless it is very nice to try to solve this limitation by other means, like your design. I was just asking, I imagine as it gets changed to manual mode and then automatic again, smarter trains take it out of the line (like it does with trains set to manual). I stopped using the decoupling since I got desync errors when playing online with a friend, but this is a functionality that I'd love to have in Facotrio.
Re: [0.15] Automatic Coupler
Posted: Sun Oct 08, 2017 2:19 pm
by laku
First of all, thank you for this mod
I kept thinking for quite a while now, how i would use this mod and finaly made up my mind. So i started looking at your code and changed
line136
it works with the following train setup, for decoupling = -2
<>CC (<,> are locomotivs showing the direction; C are cargo wagons)
but i dont fully understand it yet
Re: [0.15] Automatic Coupler
Posted: Sat Oct 28, 2017 11:49 pm
by Krazycat2012
I have a question, it seems i can not get a train to go down the same path to pick up the wagons after they are full, and pull them to the drop off zone. the rail signals will not change to green. Any way some one can do a in detail basic set up of this, how to set up the logic that goes with it please.
Is it possible to have hauling trains (locomotives included) being moved by shunter engines? Like saving/restoring the schedule/id of the hauler vial signals?
Re: [0.15] Automatic Coupler
Posted: Mon Nov 06, 2017 3:02 am
by vortex1967
Hi all,
Sorry it has taken so long, life got in the way, but here is a map(Factorio version 15.28) with two of my outpost designs set to work in a loop showing what controls and safety measures I have used.
One outpost is for loading the wagons and the other is for unloading the wagons.
Robots are used to transfer items. Currently there are 1000 bots in the network, when you open the map the player is
near a red lamp, Constant Combinator and a steel chest, in the steel chest there is another 2000 bots.
It gets very busy with 3000 bots flying around in such a small area.
There are two mods that are required:
Automatic Coupler by GotLag.(obviously)
and
Inventory Sensor by Optera(without which the detection of wagons and wagon contents breaks)
To start, turn off the Constant Combinator just below the red lamp(near player).
If you turn on the Constant Combinator again after the 3 locomotives have moved, one cycle will be completed and
the 3 locomotives will stop at their current position again.
If you leave the Constant Combinator off the whole thing will run continuously.
Eventually the two problems I have encountered and have described in my previous posts occur.
When using this mod, every couple and uncouple that occurs increases the trains ID by one.
The map I'm playing now, my train ID has just passed 25,000.
Hi Fahrradkette,
I wanted to do this also but currently it's not possible.
Hi Krazycat2012,
Hopefully the map will help.
Edit: removed map download. New version 1.0.1 of mod broke map.
Re: [0.15] Automatic Coupler
Posted: Tue Jan 02, 2018 10:13 pm
by kickbackman1277
Is there any chance this could be updated for 0.16. I am desperate to try it in my current build. Than you
Re: [0.15] Automatic Coupler
Posted: Wed Jan 03, 2018 9:25 am
by bitbased
kickbackman1277 wrote:Is there any chance this could be updated for 0.16. I am desperate to try it in my current build. Than you
I haven't tested a full setup yet but seems the only change needed for 0.16 is to set the factorio_version to 0.16 in `info.json` and add `icon_size = 32,` to each signal in `signals.lua`