News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Waiting vehicles enter in an intersection

Started by THLeaderH, September 16, 2017, 06:17:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

When a vehicle waits for a signal and stops in front of an intersection, the vehicle seems to cause collision because it goes too forward and enter the intersection when waiting for the signal.


Another type of bus shows the same phenomenon.



In both images, north-south is red and east-west is green.

~Test environment~
simutrans: r8293
pakset: pak128 version 2.6

TurfIt

Need a FAQ section for this one..

Quote from: TurfIt on July 10, 2017, 02:05:05 AM
It's a trade off by the pak author with how he aligns the graphics. Either the graphics jump when changing directions, or they overshoot the stop positions. When stopping at stations, north and westbound convois are special cased to stop half a tile short, but when stopping at signals or intersections, they graphically overshoot. This is a fundamental limitation of the tile-by-tile movement in the game engine - not likely to be changed anytime soon.

THLeaderH

Oops, I'm sorry for posting such a frequently asked question, but I couldn't find that thread. Could you tell me the topic thread in which this problem was discussed?

THLeaderH


TurfIt

Quote from: THLeaderH on September 17, 2017, 12:32:09 AM
Could you tell me the topic thread in which this problem was discussed?
Clicking on the 'Quote from:...' line takes you to the quoted post. That thread wasn't specifically about this problem, just the most recent occurrence of the question, hence fresh in mind. There should be several more times this has been brought up buried in the forum somewhere...


Quote from: THLeaderH on September 19, 2017, 11:47:45 AM
Were there any trials to solve this issue?
It's simple to solve. Just rewrite the vehicle movement code. All of it. Done. See you in 2 years.



prissi

The problem with simple isometric display is very very old and applies to other games like OpenTTD as well (which they solve by using deformed objects). You can somewhat use "better" positioned cars ith the current drawing code, becasue it reduces artefacts a lot. But there will be certain situations that are only properly solved by positioning car like this. (Also you need to realign all cars in a set, so better write a parse for the dat files.)

Depending on vehilce sizes you can greatly reduce the effect. Just pak128 has many alignments and lots of long buses, where it is very obvious.

Dwachs

The change in the code is rather trivial: Remove the special case for vehicles driving north/west to stop on the station half-way. Then all the images have to be realigned.
Parsley, sage, rosemary, and maggikraut.

prissi

And some stuff handling images at tunnels and slopes ...

TurfIt

The trivial removal of halfway stops and image realignment does indeed fix this specific problem. Do so and I can see the next complaint bug reports now on vehicles jumping as they pivot about their front bumper and hang their back ends out jumping sideways at every corner.

The simple single vehicle facing and linear position on each tile doesn't allow for 'nice' vehicle movements and stop positions in all cases. To look proper while cornering, the vehicle must continue straight until it's midpoint is over the tile boundary, then change facing and start moving in the new direction. The current alignments provide for this, albeit with the stopping position problem, which is much worse on some badly misaligned vehicles as shown in the OP.

Adding greater than tile-by-tile granularity to the facing and positioning of vehicles would be nice, but lots of work IMO. Could fulfill the requests for >1 convoi per tile perhaps too...
Alternatively, instead of eliminating the halfway stops in stations, extend them to stop halfway at intersections too. Currently the problem with this is when the vehicle checks for a clear tile ahead, sees one, and starts to move, it's still a halftile away allowing another convoi to steal the intersection. So, reserve the paths through intersections. The previously discussed intersection_t object to control path reservations with multilane roads would fit the bill. If the OTRP patch is to allow non-highway type constructions, it's required anyway IMHO to prevent no_cars_blocking() from becoming even more unmaintainable.