News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

90° turns

Started by Rollmaterial, October 19, 2015, 11:09:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rollmaterial

I'd like to request an option to completely disable 90° turns for trains. It's not only unrealistic but also very annoying when a train has to slow down and block its path for a relatively long time. Besides, have there been improvements to the reverse schedule AI at stations with central passing lines?

jamespetts

Hello - welcome to the forums. Thank you for your feedback, although I confess that I am having a little trouble understanding you. Can you elaborate on what you mean by disabling 90° turns for trains? Do you mean that they should not be able to go around 90° corners, or that they should be able to go around 90°, but do so just as fast as on straight track; or do you mean something else?

Also, what do you mean by the reverse schedule AI?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

I mean that it should be possible to completely disable 90° corners without affecting other pathfinder settings. I've understood changing the weighing factor for 90° corners affects all means of transportation. By 90° corners I mean only when a train corners from one diagonal directly to the other, not the 2x45° corner from one straight direction to the other. Speed restrictions at corners are a very welcome feature to me and should stay, even though a 192 km/h restriction for 320 km/h track is a bit harsh. :)

As for the reverse schedule, I mean that in 11.35, at a station with platforms on both sides of platformless passing lines, the pathfinder doesn't route the train automatically to a platform on the other side when running the reverse schedule as it does at simple double-track stations. When the default platform can't be accessed from the other direction, the train is routed through the next cross-over opportunity to the opposite line to access it from the opposite direction (which often includes a 90° corner). The temporary solution is to allow the train to cross over to the default platform, which in turn blocks the path for trains in the opposite direction running through. Even with a choose signal, the intended platforms are only used when the default platform is occupied.

DrSuperGood

90 degrees turn is a concept from OpenTTD. There you could disable trains from using right angled track sections. However due to the way corners were handled (diagonals) they were more pronounced.

Simutrans does not really have 90 degree turns in that there is still a gradual turn, however just with quite a small turning circle.

Rollmaterial

Quote from: DrSuperGood on October 19, 2015, 02:01:46 PM
Simutrans does not really have 90 degree turns in that there is still a gradual turn, however just with quite a small turning circle.

I don't really understand you. In Simutrans, trains can take a single 90° turn when coming from one diagonal and cornering to the other at the limit between two tiles.

jamespetts

I am still not quite sure what you mean by disabling 90 degree corners: what would the practical effect of "disabling" a corner be? One can have something that is, in a sense, a 90 degree corner in that one can turn 90 degrees in 3 tiles, but the intermediate tile is always at a 45 degree angle to the others, tile 1 being at 90 degrees to tile 3. The speed restriction is based on the calculated radius of the turn: in 125m/tile, an 90 degree turn in 3 tiles is treated as a curve with a radius of 125m (and in 4 tiles a curve with a radius of 250m, etc.).

As to the situation that you describe with paired by use quadruple track and the automatic finding of a station in the reverse schedule, I now understand what you mean in respect of that. Can you upload a saved game in which this issue can be reproduced so that I can look into whether it can be fixed relatively easily?

Thank you again for your feedback!

Edit: Reading your post again, are you actually referring to 135 or 180 degree turns?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood


That is what he means I think. A 90 degree turn from OpenTTD, something simutrans does not really support since train track is always in the centre of a tile in Simutrans.

Rollmaterial

#7
Quote from: DrSuperGood on October 19, 2015, 09:34:06 PM

That is what he means I think. A 90 degree turn from OpenTTD, something simutrans does not really support since train track is always in the centre of a tile in Simutrans.

You can perfectly recreate this in Simutrans by linking the two tiles. Please don't make me insult you...

jamespetts

Rollermaterial, can you upload a screenshot of what you mean to clarify?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

I don't have access to the game right now unfortunately, but that screenshot from OpenTTD really is what I'm talking about and trust me, it CAN be recreated in Simutrans. You create such corners all the time, simply by building a cross-over between two parallel tracks. What I'd want is an option to disable trains from taking such corners.

Isaac Eiland-Hall

Quote from: Rollmaterial on October 19, 2015, 09:46:26 PM
Please don't make me insult you...

That is not tolerated in our community. Please refrain from such comments in the future.

Václav

Quote from: Rollmaterial on October 19, 2015, 09:46:26 PM
Quote from: DrSuperGood on October 19, 2015, 09:34:06 PM

That is what he means I think. A 90 degree turn from OpenTTD, something simutrans does not really support since train track is always in the centre of a tile in Simutrans.
You can perfectly recreate this in Simutrans by linking the two tiles.
As DrSuperGood says, such turn is not possible in Simutrans - because between diagonal tiles of different direction (horizontal vs. vertical) is always used one common (central) tile of south-north or west-east direction.




On that bottom screenshot (both are borrowed from old editions of screenshot contest) it is visible a bit better, because it is in (?almost) basic zoom. And even if tracks of pak128 (and pak128.Britain) got new shape, behaviour is the same.

I tried to recreate it in pak96.comic too - and result was that there was central tile between two diagonal tiles.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní


Václav

But this is something a bit different from what was understood at first.

Yes, these turns of trains and trams don't look splendid - but at this time it is not in capabilities of community to fix it. Because it would mean a bit deeper impact into code.



And in such changing of meaning of all topic, I have to ask admins for merging with topic linked in previous post.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Dwachs

Despite popular belief 90 degree turns exist in simutrans. They do not look that pretty, of course.
Parsley, sage, rosemary, and maggikraut.

Rollmaterial

They don't just look bad, they become a real nightmare in combination with reverse schedule and choose signals. Hence I would recommend an alternative weighing factor for trains as a temporary solution.

jamespetts

The sort of 90 degree turn (i.e. on a diagonal) to which Dwachs refers should in principle be treated the same as any other sort of 90 degree turn as far as speed is concerned. I am still not sure precisely what the original request means, however, as the thread to which Rollermaterial linked contained screenshots of a very complex junction in which it was not clear to which specific turns that reference was being made (and I did not fully understand the nature of the request in that thread, either).

Rollermaterial, can you clarify?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

The request is an option to totally disallow trains to take diagonal-to-diagonal 90° corners as seen in the top left-hand corner of Dwachs' screenshot. I'm not requesting any change in their speed limit behaviour, but the option of disallowing trains to take them in the first place. Anyway, I think the game is in need of a new pathfinding algorithm in the long term.

jamespetts

May I ask why you think it important that trains should be prevented from taking diagonal to diagonal 90 degree turns, but not other 90 degree turns? It is not clear what the rationale is for this feature request. Indeed, would it not be confusing for players if it were possible to build tracks not possible to be traversed?

As for the pathfinding algorithm, can you elaborate on what you think that the problems are such that you think that it needs to be totally renewed? It is hard to think what other than A* with some weighting adjustments, as is currently in use, could ultimately work better, unless you have any other specific ideas...?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

I am unsure but I think what he is saying is that he wants to make a single schedule list set as reversible to do a double track with through station configured line. Currently it will reverse into the one direction platform by turning 180 over 2 tiles which is very slow due to the physics. Instead he wants the choose signal to not see the target platform (by blocking the 180 over 2 tile turn) and instead see only the platform straight in front.

This sounds like a bit of a hack to support double track through stations. A better solution would be a schedule option to take nearest platform only, disable the choose signal from sending trains through a potential station platform to reach another platform or even make it so choose signals always choose the nearest platform even if the scheduled one is empty.

jamespetts

The code is designed to find the nearest platform if the convoy is running its schedule in reverse, and choose signals will always choose the nearest free platform (where "nearest" here means nearest in route distance). If it is not doing this in specific situations, this may be a bug, and I will need instructions to reproduce and a saved game to which those instructions apply.

Rollermaterial, can you confirm whether you really mean 90 degree turns, or are in fact referring to what amount to 180 degree turns?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

I am indeed referring to what amounts to 180°, in which a 90° corner as mentioned is involved. For saved games I will have to wait until monday. Until then I'll try to describe. The layout is a station with passing lines in the middle and platforms on lines on each side like most of the stations on french high-speed lines. Here's an attempt to draw it in text:
                  Platform
               ____________
___>___/_____________\_____
___<______________________
             \_____________/
                  Platform

In reverse schedule, the trains still attempt to go to the default platform, even though it's on the opposite side.

Václav

Choosing of right platform may be partly affected by usage of end-of-choose signals. It is not flawless - it cannot prevent all errors. But still it is better way than full separation of platforms for various taffic directions (that is nonsense in relation to real world where it is nonsense too).

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

jamespetts

I wonder actually whether this is just a bug in the automatic platform finder for reversed route code present in 11.35 but recently fixed in the development version?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

Quote from: jamespetts on October 21, 2015, 02:00:06 PM
I wonder actually whether this is just a bug in the automatic platform finder for reversed route code present in 11.35 but recently fixed in the development version?

This would answer that part of my question.

jamespetts

Is there another part? If trains do not turn back in this way unless they have no alternative, there does not seem to be any need to disable anything, and if a 180 degree turn is their only alternative, it would make no sense for the trains not to be able to find a route at all rather than to go but slowly.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

The remaining issue is the one described in the other thread: that choose signals can route trains over zigzag paths containing 90° corners instead of waiting for a straighter path, which would be faster.

jamespetts

Quote from: Rollmaterial on October 22, 2015, 09:18:44 AM
The remaining issue is the one described in the other thread: that choose signals can route trains over zigzag paths containing 90° corners instead of waiting for a straighter path, which would be faster.

Ahh, that is a conceptually very difficult one to fix, as there is no universal and simple way of determining whether any given alternative path is in fact slower than waiting, not least because the simulation has no way of knowing how long that the wait will be. It seems hard to imagine any sane track layout in which a 180 degree turn would be chosen by a choose signal, however; have you encountered this frequently?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

Now I'm not referring to 180° turns, they would only occur when the layout is flawed. Now it's just about 90° corners. One interesting thing is that the disabling setting isn't strictly necessary in OpenTTD since you can build layouts without tracks crossing each other at 90°, whereas in Simutrans it's impossible since it occurs at every cross-over.

jamespetts

Can you give an example of where this would (and does) cause problems?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Octavius

The 90⁰ turns discussed in this thread are the ones in this post by me, figure 2D, which are indeed sharper than the 90⁰ turns in figure 2C. When you calculate things accurately, you can see that the 90⁰ turns of this thread have a radius of curvature of 0, leading to a proper speed limit of 0, which should make this 90⁰ turn infinitely undesirable to the path finding algorithm. So I agree that they should be forbidden for trains.

Aquin

A 90° turn looks slightly nicer in pak128, but it is stupid desing by the user. The two tracks in the corner are not needed. The two tiles before the corner are already touching, so connecting these gives a nicer corner and uses 2 tiles less.

jamespetts

I am not sure that I really understand this issue: the V type of 90 degree turn is treated in Simutrans-Experimental in the same way (i.e. with the same maximum speed) as the L type turn. What exactly is the issue here?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Octavius

In isolation, there is indeed no use for a V type 90⁰ turn, but when building a crossover between two parallel tracks you get one for free, sandwiched between two 45⁰ turns as part of a 180⁰ turn. In a properly designed schedule the train should never take this turn, but choose signals (and sending a train to a depot) may sometimes send a train through turns like this.

Consider the attached picture. In reality, this would be a common track layout. Suppose tracks 1, 3 and 4 at the station are occupied.  Now comes a new train from the leftmost track. It will take the yellow route to track 2. As the train from track 1 leaves, another train comes from the line from the bottom. As there is no route to a free track, it will wait at the choose signal. But as soon as the train following the yellow path clears the central crossover, the green path to track 1 comes available. So the train goes that way, through two 90⁰ turns and blocking several tracks for a long time. By forbidding the V type 90⁰ turns the train would continue waiting until the more logical route to track 1 via the top crossover is free. Probably not very common in normal gameplay, but it may happen.

When calculating things consistently, the L type 90⁰ turn has a single tile of diagonal track, leading to a radius of curvature of (tile size)×0.854. The V type 90⁰ curve has nothing between two 45⁰ turns and has a radius of curvature of 0. Furtermore, L type 90⁰ turns are less likely to be created as a side effect of normal track layouts like crossovers and do find some practical use, especially in tram tracks.

Aquin

but that green route is a series of two 180° turns with r=0.5 tiles, isn't it?