The International Simutrans Forum

 

Author Topic: Simutrans 102.3-r3190 level crossing  (Read 5528 times)

0 Members and 1 Guest are viewing this topic.

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Simutrans 102.3-r3190 level crossing
« on: June 03, 2010, 05:49:43 PM »
There is nothing on the level crossing but the train can't advance ... and cars often pass before the train on level crossings (the train could reserve the level crossing before).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10818
  • Languages: De,EN,JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #1 on: June 03, 2010, 08:07:53 PM »
If you click on the crossing, simutrans will tell you the state.

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Simutrans 102.3-r3190 level crossing
« Reply #2 on: June 03, 2010, 08:28:28 PM »
Maybe it can't reserve track after the crossing? Maybe even for normal reasons?

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #3 on: June 03, 2010, 08:30:44 PM »
The track after the crossing was reserved until the next signal but it was reserved for this train ... I had this problem with many others crossings (caused by citycars ...).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10818
  • Languages: De,EN,JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #4 on: June 04, 2010, 08:28:04 AM »
Signals directly on crossing cause wierd behaviour. But if you have a map where reservation reproducibly fails, I would be very interesting to obtain this to actually debug this. Reservation with busy maps from savegames from previous versions fail (but sadly not reproducably and only very rarely).

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #5 on: June 04, 2010, 12:29:48 PM »
so if I remove signals on level crossings, it will be fixed ?

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20915
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans 102.3-r3190 level crossing
« Reply #6 on: June 04, 2010, 01:45:23 PM »
Perhaps if signals near level crossings fail, it should not be possible to build a signal next to an existing level crossing, or a level crossing next to an existing signal?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10818
  • Languages: De,EN,JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #7 on: June 04, 2010, 09:03:02 PM »
No, the reservation is only delayed, when a signal is on a level crossing. It should not end with unreserved tiles. Please provide a savegame, if the error is reproducable.

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #8 on: June 05, 2010, 02:39:44 PM »
I'll try to reproduce it in another savegame.

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #9 on: June 06, 2010, 09:06:02 AM »
The problem now is simple and you can easily reproduce it : the reservation of the level crossing by the train is far too late, I have 100 km/h trains which reserve the crossing only three or four tiles before, but there are slow cars staying on the crossing and the train is forced to brutally stop in front of the crossing whereas in the real life it's rare to see a train stop at a crossing to let cars pass ... (it's rather the contrary ...).

plus : cars often stop behind each other on a crossing, they should wait at the entry of the crossing and not on it.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Simutrans 102.3-r3190 level crossing
« Reply #10 on: June 18, 2010, 06:21:02 PM »
The problem now is simple and you can easily reproduce it : the reservation of the level crossing by the train is far too late, I have 100 km/h trains which reserve the crossing only three or four tiles before, but there are slow cars staying on the crossing and the train is forced to brutally stop in front of the crossing whereas in the real life it's rare to see a train stop at a crossing to let cars pass ... (it's rather the contrary ...).
Hmm.  If someone can point me to the location in the code where the level crossing is reserved, it will probably be easy to reserve it further in advance....

Quote
plus : cars often stop behind each other on a crossing, they should wait at the entry of the crossing and not on it.
Oh, I've noticed this problem.  Traffic jams should definitely NOT back up across crossings, that's very dangerous.  :-)  Anyway, that was actually the cause of some gridlock I had: trains were getting permanently stuck because of this.  Now, how do we tell the cars not to enter the level crossing unless they can clear it?

Offline TrainMith

  • *
  • Posts: 60
Re: Simutrans 102.3-r3190 level crossing
« Reply #11 on: June 18, 2010, 07:19:46 PM »
Actually, I would expect the level crossing reservation to be dependent upon the max. speed of the track, if this is possible at all.  I would also assume that if there were a mixture of different track speeds that the lowest would be used, when considering each section of track at and within a speed-determined radius from the crossing?

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Simutrans 102.3-r3190 level crossing
« Reply #12 on: June 18, 2010, 08:27:28 PM »
Actually, I would expect the level crossing reservation to be dependent upon the max. speed of the track, if this is possible at all.  I would also assume that if there were a mixture of different track speeds that the lowest would be used, when considering each section of track at and within a speed-determined radius from the crossing?

In real life (heh, heh) "constant warning time" crossings are a very new thing.  It has been common to have crossings trigger quite early based on assuming fast trains, and then wait for a long time for a slow train to arrive.  I'd be OK with trains reserving crossings too early and too often -- that has always been the way it works in real life.  The current situation is rather the opposite.

All this is academic unless I can figure out where in the code the crossing gets reserved....

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #13 on: June 19, 2010, 08:20:05 AM »
If you do these patches, you are the best developers ;)

Offline yobbobandana

  • *
  • Posts: 42
Re: Simutrans 102.3-r3190 level crossing
« Reply #14 on: June 21, 2010, 07:59:03 PM »
@neroden:

Trains reserve the crossing at the following place:
file vehicle/simvehikel.cc
line ~ 2582 (svn head)
in function wagon_t::ist_weg_frei
(translation: "is way free")

for cars: line ~ 1961 in automobil_t::ist_weg_frei
for boats: line ~ 2883 in shiff_t::ist_weg_frei

you can find them if you grep for "request_crossing" :)

Trains always check 3 tiles in advance for stops/crossings/signals/etc.

It looks like there is already some code to make sure cars can leave the crossing after entering. Perhaps it is not working correctly?

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Simutrans 102.3-r3190 level crossing
« Reply #15 on: June 29, 2010, 04:25:45 AM »
@neroden:

Trains reserve the crossing at the following place:
file vehicle/simvehikel.cc
line ~ 2582 (svn head)
in function wagon_t::ist_weg_frei
(translation: "is way free")

for cars: line ~ 1961 in automobil_t::ist_weg_frei
for boats: line ~ 2883 in shiff_t::ist_weg_frei

you can find them if you grep for "request_crossing" :)

Trains always check 3 tiles in advance for stops/crossings/signals/etc.

It looks like there is already some code to make sure cars can leave the crossing after entering. Perhaps it is not working correctly?


OK, I have two things to check.  Someone may have to remind me if I don't get to it in the next few months (life has been busy....)

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Simutrans 102.3-r3190 level crossing
« Reply #16 on: July 14, 2010, 11:46:36 PM »
The cause of the cars driving across the level crossing was found and fixed by z9999, though it's not in standard svn yet I believe.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4897
  • Languages: EN, DE, AT
Re: Simutrans 102.3-r3190 level crossing
« Reply #17 on: July 15, 2010, 07:29:28 AM »
?
Code: [Select]
r3535 | prissi | 2010-07-13 23:45:45 +0200 (Tue, 13 Jul 2010) | 1 line

FIX: (z9999+) avoid private cars stooping on railroad crossing during traffic jam

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #18 on: July 15, 2010, 02:23:50 PM »
Quote
FIX: (z9999+) avoid private cars stooping on railroad crossing during traffic jam

all road vehicles shouldn't stop on railroad crossings, not only private ones.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Simutrans 102.3-r3190 level crossing
« Reply #19 on: July 16, 2010, 06:03:12 PM »
all road vehicles shouldn't stop on railroad crossings, not only private ones.

I *believe* that player road vehicles were *already* not stopping on railroad crossings.  Tell me if player vehicles are getting stuck on railroad crossings.

Offline gauthier

  • Devotees (Inactive)
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Simutrans 102.3-r3190 level crossing
« Reply #20 on: July 16, 2010, 08:51:20 PM »
I don't know ... I have to check that  ;D

Offline Isaac Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3924
  • Providing hosting for Simutrans projects
    • pc2.io
  • Languages: EN
Re: Simutrans 102.3-r3190 level crossing
« Reply #21 on: July 17, 2010, 12:00:10 PM »
I just tested, and indeed, player vehicles will not stop on tracks when the tile beyond the tracks have a vehicle stopped.

In fact, brilliantly, a player vehicle will not enter a road/rail crossing tile if there is a vehicle crossing in front (i.e. multiple crossings next to each other): As a second test, I put five crossings side-by-side, with a line set up to force a traffic jam - but even though the tile beyond the five crossings was clear, the second bus waited until the first bus had cleared the crossings before entering the crossings itself.

Awesome. :D