Author Topic: Waiting vehicles enter in an intersection  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

Waiting vehicles enter in an intersection
« on: September 16, 2017, 06:17:02 AM »
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

Offline TurfIt

Re: Waiting vehicles enter in an intersection
« Reply #1 on: September 16, 2017, 10:06:27 PM »
Need a FAQ section for this one..

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.

Offline THLeaderH

Re: Waiting vehicles enter in an intersection
« Reply #2 on: September 17, 2017, 12:32:09 AM »
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?

Offline THLeaderH

Re: Waiting vehicles enter in an intersection
« Reply #3 on: September 19, 2017, 11:47:45 AM »
Were there any trials to solve this issue?

Offline TurfIt

Re: Waiting vehicles enter in an intersection
« Reply #4 on: September 19, 2017, 07:26:31 PM »
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...


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.



Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Waiting vehicles enter in an intersection
« Reply #5 on: September 20, 2017, 03:30:12 AM »
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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Waiting vehicles enter in an intersection
« Reply #6 on: September 22, 2017, 04:46:40 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Waiting vehicles enter in an intersection
« Reply #7 on: September 23, 2017, 02:54:55 PM »
And some stuff handling images at tunnels and slopes ...

Offline TurfIt

Re: Waiting vehicles enter in an intersection
« Reply #8 on: September 25, 2017, 02:00:37 AM »
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.