[Resolved 0.4.1] Train Crash

This subforum contains all the issues which we already resolved.
Post Reply
Aza-Industries
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Tue Apr 02, 2013 12:51 pm
Contact:

[Resolved 0.4.1] Train Crash

Post by Aza-Industries »

Hey I'm just following what the popup told me to do..
The game has crashed twice when I've tried to send a train from one station to another.

I have a screenshot of the area the problem is occurring and I spliced in the popup at the top left.
So basically the train is leaving the "from here" area and once it hits those green lights the game crashes.

EDIT: Also the train does start moving away from the stations, it's just crashing when it hits those green signal lights.
and I haven't actually read the wiki yet how this stuff works, I was jut messing around, so sorry if this crash was something you expected.

Also where it is going my station was actually on the other side of the line, I just took a screeny of the save before I changed that.

EDIT 2: I'm guessing it's because my train system isn't looping, I'm fixing it up now and I will soon find out. If that is the case I can see making stations at ends of railways a pain if you don't have any room to work with, especially with the huge turning arc of the tracks. I'm pretty sure there are trains that can go backwards, but don't hold me to that...

EDIT 3:
Looking back my first railway design was pretty retarded.. which is weird because I played Open TTD for years building complex rail networks. I have my rail system working now but I guess my first venture wasn't a total waste. We discovered the current system can't handle a horribly designed rail system and then decided to close the game for you for being silly. I could see an S bend moving 1 track to the left helping this situation a lot.

Still, the turning arcs are proving to be annoying when I want to build smaller stations.
Right-Click -> View Image to see the full image.
Image

MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

Re: [0.4.0] Train Crash

Post by MF- »

Aza-Industries wrote: I'm pretty sure there are trains that can go backwards, but don't hold me to that...
TL;DR: An monologue with a theme "what might be the reasons why real world trains don't go backwards, while the in-games trains might appears to do so"


Well.. it's not that simple and depends on the level of simplification.
The locomotive needs to be at the head of the train (mechanical and historical reasons)

I tried to think about some..
CZ cargo trains use only pneumatic braking signalling, which is not spreading instantly (which means that the wagons closer to the locomotive start braking a little bit earlier than the more distant one). When the locomotive is the first, then the train compresses a bit during braking, easing up the joints and actually allowing the personal to disconnect them easily by hand.
That also means that the wagons don't have any wires ran though them, so there would be no way of reliably connecting the "train head" to the supposed locomotive at the back. Even the automatic train needs to have a module that reads the traffic signals at the head of the train.
It somehow works better when the train is pulled instead of pushed if the train is longer
(it's AFAIK OK for short trains and/or short distances - one of the guys simply hops on the wagon that is at the front and reports the status using radio)

In real world the train could have locomotives on both ends (Where both are actually active when getting the giant train to move, but only the front one for maintaining the speed. In past there was simply a 2nd guy in the back locomotive and they coordinated by radio)
Those trains can naturally go backwards

@simplifications.
Larger stations have more that one track inside.
When the train has to turn around, then the locomotive simply detaches, leaves the station, enters on another track, passes by the train, leaves, enters on the same track, attaches to the train on the other end.
Some games simplify that process.. The train magically rides though itself. The train disappears and reappears reversed. etc.
However, that would look pretty wrong in factorio

If there was an automatic way of detaching the locomotive and letting it travel to the other end of the train via a parallel track and then attach, I would favour it.
However, I am not sure that all players would like such details.

MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

Re: [0.4.0] Train Crash

Post by MF- »

Well.. making real-like multi-track stations is kinda possible.. with a catch...
Image

It is actually possible to make the density maximal, but then it needs some extra rails behind the station...
Image

↓↓↓ Why is the attachment tag penalized in this stupid way??? ↓↓↓
stations.png
stations.png (658.75 KiB) Viewed 7494 times
Attachments
dense.png
dense.png (375.94 KiB) Viewed 7473 times
Last edited by MF- on Sat May 04, 2013 12:15 pm, edited 2 times in total.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.0] Train Crash

Post by kovarex »

Do you have a save where this happends? This would help us a lot.

MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

Re: [0.4.0] Train Crash

Post by MF- »

kovarex wrote:Do you have a save where this happends? This would help us a lot.
** I think **
that he simply built two stations at the rail ends and configured a train to go back and forth.
And that the crash occurred when the only way the train could go to the next station was to "go backwards"

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.4.0] Train Crash

Post by SilverWarior »

I belive that the problem is that game couldn't find sutable path from one station to another.
Based on his picture the train would either need to stop and reverse the direction after it pases the first junction to get to the desired train station.
Or it would need to pas through that rail circle so it can reverse direction this way. But this second approach wouldn't work becouse the pathfinding algorithm probably wouldn't treat that as valid path since the train would need to travel twice on the same rail section (pathfinding algorithm would probably threat such scenario as eliminating unecessary path loop).
So for making such scenario as his to actually work would require modifying pathfinding algorithm so that it doesn't treat traveling through same rail section in oposite direction as traveling on same path (traveling from node A to node B is not considered as to be on the same path as traveling from node B to node A). The easiest way for implementing this would be so that you have seperate node system for both directions. This way you could also easily force trains to be able to travel only in one direction at certain train sections.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.0] Train Crash

Post by kovarex »

SilverWarior wrote:I belive that the problem is that game couldn't find sutable path from one station to another.
Based on his picture the train would either need to stop and reverse the direction after it pases the first junction to get to the desired train station.
Or it would need to pas through that rail circle so it can reverse direction this way. But this second approach wouldn't work becouse the pathfinding algorithm probably wouldn't treat that as valid path since the train would need to travel twice on the same rail section (pathfinding algorithm would probably threat such scenario as eliminating unecessary path loop).
So for making such scenario as his to actually work would require modifying pathfinding algorithm so that it doesn't treat traveling through same rail section in oposite direction as traveling on same path (traveling from node A to node B is not considered as to be on the same path as traveling from node B to node A). The easiest way for implementing this would be so that you have seperate node system for both directions. This way you could also easily force trains to be able to travel only in one direction at certain train sections.
The pathfinding is built with the ability to run through one rail in both directions from the start, but thank you for the suggestions.
We tried to reproduce the crash, but without any success.

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.4.0] Train Crash

Post by slpwnd »

This doesn't look like the pathfinding problem. When pathfinding can't find the path the train will not move at all.

The error message you got is the result of how internals of train moving within a tick work. There is a concept of a "ghost train" which is just like the regular train, however not changing the game state. First the logic tries to move the "ghost train" and then it checks whether there has been any collisions. If so then the regular train is not moved. Only in case of no collisions the regular train is moved. This assures the atomicity of train movement within a tick.

Aza-Industries
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Tue Apr 02, 2013 12:51 pm
Contact:

Re: [0.4.0] Train Crash

Post by Aza-Industries »

MF- wrote:
kovarex wrote:Do you have a save where this happends? This would help us a lot.
** I think **
that he simply built two stations at the rail ends and configured a train to go back and forth.
And that the crash occurred when the only way the train could go to the next station was to "go backwards"
yeah pretty much, since then I've made a really complex smoothly running multi-train multi-station automated system... I think I was just having a brain fart.

Also sadly I don't have the saves anymore. =(
Really sorry I should have thought of that.

Maybe I'll try replicating it. But first, bed time!

EDIT: Didn't go to bed.. O.o

Tried replicating the problem and I couldn't do it. I remember it occurred more then once. And I thought I would help by listening to the message and letting you know. But I guess it didn't help at all..
I tried the exact same thing and it didn't crash as the train hit the green lights like it did before. I remember I had to keep telling it to go to the station and pushing pause/play a few times before it did anything and started moving.

I'll try some more tomorrow, bed time for real this time.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.4.0] Train Crash

Post by kovarex »

Well, I think I already found the cause of this problem while solving different bug, it was probably caused by riding train with some of its vehicles rotated on non-circular track.

Aza-Industries
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Tue Apr 02, 2013 12:51 pm
Contact:

Re: [0.4.0] Train Crash

Post by Aza-Industries »

kovarex wrote:Well, I think I already found the cause of this problem while solving different bug, it was probably caused by riding train with some of its vehicles rotated on non-circular track.
Ok I'm glad you were able to find it, Sorry I couldn't be more help.

On another note, I'm loving the update! My factory is nearly 100% solar running through the night now. =P
So many accumulators. O.o

So good work all round guys!

Post Reply

Return to “Resolved Problems and Bugs”