The International Simutrans Forum

 

Author Topic: stiff coupling/longer vehicles  (Read 343 times)

0 Members and 1 Guest are viewing this topic.

Online Leartin

  • Devotee
  • *
  • Posts: 1054
  • PAK-DEV P192C
  • Languages: DE, EN
stiff coupling/longer vehicles
« on: September 28, 2018, 05:27:48 AM »
The length a vehicle can have is limited, since too long vehicles would cause graphical glitches as it becomes hard to determine if they are in front or behind something on completely different tiles. A common solution for long vehicles is to create them in two parts; also seen in pakH0 with pretty much every vehicle. The downside is that in curves, multipart vehicles bend.

I wonder if it's possible to introduce a "stiff coupling" that does not bend. You'd add up the length of all vehicles with "stiff coupling" and act as if they were one vehicle. When it comes to drawing them, their position and rotation would be inferred from that virtual vehicle and can be on different tiles, in case of curves they could even be on tiles without tracks, since the rear (and front) of a long vehicle would swing out quite a bit.

Instead of having several vehicles in a 'virtual vehicle', you could also have several 'parts' in a vehicle; The basic idea would be exactly the same, but you'd have stats for the long vehicles instead of stats for each part etc. (that's even better, but a bit harder to explain - "stiff coupling" probably makes more sense to most)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: stiff coupling/longer vehicles
« Reply #1 on: September 28, 2018, 06:02:40 AM »
I think your first sentence pretty much sums up why this is a bad idea, although there is also the fact that a vehicle sticking mostly outside of the track when it turns, and leaving a corresponding gap to the following vehicle, does not look any better than a vehicle bending where it should not. There are already vehicles demonstrating this.

The only solution to this problem would be giving vehicles a lot more images representing various rotations. For long vehicles, the bogies would then be "virtual vehicles" with the "physical" vehicle drawn between them. However, things spilling out of a tile causes serious problems for Simutrans drawing system. I think the only way to do this would be to scrap it and come up with something new.

Online Leartin

  • Devotee
  • *
  • Posts: 1054
  • PAK-DEV P192C
  • Languages: DE, EN
Re: stiff coupling/longer vehicles
« Reply #2 on: September 28, 2018, 08:23:31 AM »
things spilling out of a tile causes serious problems for Simutrans drawing system.
Which is why they shouldn't - draw the physical vehicle as if it was on the tile it's position indicates, no matter where the virtual vehicle actually is.

a vehicle sticking mostly outside of the track when it turns, and leaving a corresponding gap to the following vehicle, does not look any better than a vehicle bending where it should not.
I beg to differ, for two reasons.
1) While the gap does look odd, it's something unavoidable, especially notable with larger-scale paksets. It's "normal" to Simutrans, and you need to get used to it anyway. Bending vehicles on the other hand, especially if they are ripped apart as well, are an additional oddity. Even if it wasn't worse (which I think it is), you could still reduce two strange oddities down to one.
2) Pak.H0 has about the same size of trains as pak192.comic, but due to it's 64 tile size, the vehicles are cut in parts, even if they would only be length8 in pak192. How bad the gap is depends mostly on a vehicles shape, not on it's ratio to tile size. While pak.H0 is currently special in this regards (and I figure it's mostly because nobody want's bending vehicles), IF the multitile citybuilding patch gets implemented, I could see paksets downsizing, using the same scale on a smaller grid - one major concern would be vehicle length.

That's not to say an approach with more rotations would be unwelcome. If you were to do something like this, you would probably need to know the position of the couplings between vehicles (each vehicles beginning and end point), which could help determining stopping positions for signals and stations, which AFAIR are still a bit hackish. It could be groundwork to later have non-straight paths on a tile, but actual curves, etc. And it wouldn't technically matter how many rotations a vehicle would have, as the "virtual" vehicle would have a certain angle and simply pick the image closest to that.
I wouldn't expect something like pak64 or pak128 to ever embrace such changes, but eg. pak128britain should have all vehicles as 3D files, so creating more rotations would be relatively simple (compared to pixel them manually).
That's a detour though. For now, just avoid that aweful bending.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: stiff coupling/longer vehicles
« Reply #3 on: September 29, 2018, 08:11:11 AM »
The best solution for now is to scale the vehicles down so that they fit. It's not like Simutrans is to scale in any way.