News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Make it possible for ways to draw stuff right in front of the vehicle (not tile)

Started by Nazalassa, August 24, 2024, 08:55:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

As of now ways can draw their images in two locations: behind the vehicle (backImage) and in front of everything on the tile. Both can find uses (be it specific or general).

However, I think there should be a third location available: right in front of the vehicles, but behind the other frontImages of the tile (i.e right after the vehicles in the drawing order). Such an "image location" could be useful in the following situations:

  • In the pak48.bitlit, the tunnels are tube-shaped, and use the way's frontImage to draw the part of the tube that is in front of the vehicles. However, since the way's frontImage is drawn above everything on the tile, including any building's frontImage, this may lead to ugly graphics. In the example below, the station does not give too bad a result, but the depot does - the tunnel's frontImage gets drawn above its frontImage whereas it would be better if it did not.

    bitlit.gif

    Thus I think in this situation it would be better if the tube's front was drawn at the new location I suggest, right in front of the vehicle, but behind any building's frontImage.
  • I have made some sort of "experimental" way which has a "wall" on both sides (to avoid the vehicles getting off the track). Thus the front wall hides part of the vehicle. This means it has (with the current system) to be a frontImage, which gives the following result when a building is added:

    box.gif

    The front wall would go better at the new location I suggest, right in front of the vehicle, but behind any building's frontImage.

Such an "image location" would thus be used e.g for whatever part of the way that is supposed to hide only (part of) the vehicles.
Making paksets since October 2023  |  pak48.bitlit | MLM for pak64

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

prissi

A thrid position is very difficult to realise. One could however tweak the order so than stations' and depots' forntimages are drawn before the ways' frontimages. That would apply to all ways and all graphic sets. However, I thing it should make more sense this way as it is like real stations and depots appear.

Please test it in r11402

Leartin

Quote from: prissi on Yesterday at 12:07:28 AMit should make more sense this way as it is like real stations and depots appear.

I don't think that can be generalized. In the given examples, the station is broader than the way, so the frontimage of the way should be behind the stations frontimage. But you could have ways that are as broad as the tile, with narrower stations, then it makes more sense for the wall to cover the station. And there are more dimensions - some frontimages are meant to be "above" the way, while stations are often "in front, but rather flat on the ground".

Same is true for backimages, to be honest. In the second example above, if you turn it to see the opening, you'd probably want the wall to continue into the depot. But if the way is all flat on the ground, but reaches the tile borders, you want the depots backimg to cover the ways backimg.

That being said, I suppose I can finally add the snowpoles to my roads that I dropped due to exactly this issue...


prissi

One could have this configurable per way or per pakset as it needed only one change in recalculating the image after construction or season changes.

Nazalassa

Quote from: prissi on Yesterday at 12:06:03 PMOne could have this configurable per way or per pakset as it needed only one change in recalculating the image after construction or season changes.

Or configurable per building? Then perhaps it would also be good to have an option not to display the way's FrontImage for some buildings, such as this "station":

station.gif
Making paksets since October 2023  |  pak48.bitlit | MLM for pak64

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

prissi

Actually, I was hiding the front image on stations and depots in r11402 not changing the drawing order. That was too complex.. Did you checked it?