The International Simutrans Forum

 

Author Topic: [patch] Load all vehicles in station  (Read 3870 times)

0 Members and 1 Guest are viewing this topic.

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
[patch] Load all vehicles in station
« on: November 18, 2008, 09:36:12 PM »
This patch changes one small aspect of loading: before, the loop checked until last connected part of same station. Now it goes on, allowing loading more parts of convoi even if there is a "hole" in station…


---####\
---####/

or

---##-##--

Before: only first half of train loads
After: Only parts of train in the curve don't load

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10638
  • Languages: De,EN,JP
Re: [patch] Load all vehicles in station
« Reply #1 on: November 18, 2008, 10:44:15 PM »
Well, it will not work with harbours. But I will look into it. The problem with doing it this way was, that it did not work with shorter vehicle length directly on a curve before the station. (It should be loaded, but it did not.) It was like that before though.

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [patch] Load all vehicles in station
« Reply #2 on: November 18, 2008, 10:48:57 PM »
So, a special case for ships?

I don't understand why shorter lengths should not work - this checks tile under vehicle against station, so theoretically if you have more vehicles on one tile, it should work too? But I didn't look at how shorter vehicles "own" tiles.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10638
  • Languages: De,EN,JP
Re: [patch] Load all vehicles in station
« Reply #3 on: November 18, 2008, 11:17:17 PM »
Due to alignment isuues (or rather drawing issues) the vehicle drive in West and North 8 and in the other directions 15 steps until stopping. Thus a different number of vehcile will be loaded, depending on station orientation.

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: [patch] Load all vehicles in station
« Reply #4 on: November 19, 2008, 01:35:41 PM »
Well since offset is working now, correcting the graphics (via the .dat files) should be easy enough, so you could try and make things the same for all directions (stations and signals and all) again, could you not?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10638
  • Languages: De,EN,JP
Re: [patch] Load all vehicles in station
« Reply #5 on: November 19, 2008, 02:37:03 PM »
No, this is due to the isometric engine. A vehicle must enter the tile in front before the first pixel is over that tile. On the same time, a vehicle must leave a tile (which is to the front) only after no pixel is on that tile. Therefore west/east and north/south vehicle positions must be offsetted by half a tile (and this is the reason, why vehicles longer than half a tile (=8) cuase severe graphics errors on everything not a ground tile.)

Simutrans tries to make this less severe by first drawing the normal ground including ways and then all other objects. This works as long as there are no bridges, tunnels, station or slopes, where the ground becomes a normal objects. Hence the graphics errors with longer vehicles.

To conclude: In an isometric pixel engine, the moving objects will be allways offsetted half a tile in north/south and east/west direction. A train going east-west would have one car, which is always loaded but but never unloaded. I spent half a month in thinking around this, but there is no better way around.

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [patch] Load all vehicles in station
« Reply #6 on: November 19, 2008, 02:48:08 PM »
Then just drop it. The same can be done by following the way longer than last tile, only not so easy - more exercise for me :)
« Last Edit: November 19, 2008, 02:51:22 PM by VS »