News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

More image options for way way-objects / catenaries

Started by Flemmbrav, December 02, 2022, 07:29:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Flemmbrav

Hello everyone,

I'd love to use some extra image options for catenaries.
Specifically these are:
- underground images
- extra images for stations

when building catenaries in Simutrans, the following image might be familiar to you:



Now there are a couple of collisions between the catenary (poles) and other objects:



In the green circle you can see a catenary pole being placed above the wall of the tunnel.
At the pink circle you can see a catenary pole being placed in front of a station roof.
And the red circle shows a catenary pole being placed on the platform.

A proper solution for the situation can be seen here:



The poles in the tunnel are cut off properly and the poles at the station swap sides depending on the image type of the platform.
Another benefit is the better looking catenary inside the tunnels, as it doesn't use poles standing on the ground, but hanging from the ceiling instead.
And then there are third rails, which you'd usually not place on the same side as the platform. With these additions, the game could just place them on the correct size as well.


Now these images aren't mock-ups, but build with 3 different way objects.
So in case someone'd like to help me out here, feel free to use them for your testing etc.!
Link to the source files (CC-BY-SA 3.0): https://github.com/Flemmbrav/Pak192.Comic/tree/Standard/AddOn/danish/wayobj

Best Regards
Flemm

Leartin

I agree on the tunnels. Though it might be achieved by restricting wayobj to overground/underground (much like stations and arguably ways are), and adding a special case for electrification to be replaced by another electrification of the same speed if you build through a tunnel from overground. This is because electrification is the only type of wayobj that has gameplay attached to it and building it shouldn't become harder, while all other wayobj are ornamental, thus graphics may be more important for them than ease of use.

As for the poles switching sides: Note that there is rotation in the game. Rotate the view by 180 degrees, and both your catenaries will be on the outside on top of the station. For this to work, you need to switch catenaries every second rotation. This pretty much are the often suggested "directional way graphics", and then on top an automatic detection which side to use. Perhaps it would be smarter to get directional way graphics that enable us to build this manually (without rotation bugs), and only then think on how Simutrans may automate it?

Flemmbrav

I can't really follow your thoughts on the poles for the stations.
I'd want them to share the same direction, as the station image (or at least be related to the station image). So a station that's build behind the tracks always has the catenary poles in front of the tracks and vice versa.

prissi

Many of these issues would be solved by directional wayobj, which is on the eternal todo list. That would also allow for highways with single-directional roads immediately visible by the graphics too. Still no so easy to add, unfortunately.

Leartin

Quote from: Flemmbrav on December 05, 2022, 06:25:12 PMI can't really follow your thoughts on the poles for the stations.
I'd want them to share the same direction, as the station image (or at least be related to the station image). So a station that's build behind the tracks always has the catenary poles in front of the tracks and vice versa.

Yeah, you'd want that.
Say there are no changes to how objects are encoded. Your request could be 'solved' by adding logic that does just that - whenever a piece of catenary is built, check if it's built on a station, if so, check if that station is in the back, and if so, build the second catenary object (drawn in front of tracks) instead.
Obviously, you'd also check each time a station is built whether it's built on a track with catenary, if so, check if the station and the catenary is in the back (if so, delete the catenary and rebuild the other catenary object) OR if the station and the catenary are in the front (again, if so, delete the catenary and rebuild the other catenary object). With that, you'd get pretty much exactly what you ask for.
But then - what if you rotate the map by 180 degrees? If there are no changes in that behaviour, stations will be on the other side of the track, but catenaries will stay. Checking all stations or all catenaries on the map to see whether they align with a potential catenary/station on the same tile is hardly the way to go.
But there is another neat trick: Normally on rotation, all NS-images turn into EW-images, and all EW-images into NS-images of the same object. You could instead make it so all NS-images of a "behind-track-catenary-object" turn into correspondive "infrontof-track-catenary-objects"and vice versa (not touching rotation EW to NS).
This would work. To make it faster, I guess you'd not use two magically linked catenary objects, but additional graphics in the same catenary object.

So you'd essentially add "SN" and "WE"-Rotations in addition to existing NS and EW. Perhaps more - EN in addition to NE etc. - and as soon as you do that, you create directional ways/wayobjects. Which would be awesome even if there was no way to manually place "WE"-pieces just for the prospect of building "EW" and turning the map 180 degrees to get what you want.


Long rambling short: Your idea pretty much requires directional wayobject. Once those exists, your idea of auto-choosing is a nice no-brainer, like auto-placing curves vs. diagonals. Without them, I can't even think of a non-hack way to implement it. It's like asking for a swimming pool in the middle of a desert - it's a hard sell without a pipeline, and if you build that pipeline, easy water is huge even without the pool.



Octavius

(Apologies for necroposting)

My real-world experience is that on double track electric lines, the poles are normally (but not always) on the outside. If there's a station with platforms on the outside, this may be a reason to move the poles to the inside, but certainly not always. It's common to find the poles on the platform. Or, with gantry-style poles (two poles with a single beam connecting them, spanning both tracks), the beam may be lengtened to put the poles on the outside edge of the platforms, but even that doesn't always happen. In particular if the platform was built after the line was electrified, the platform is often simply built around the pole, which is left in place.

Of course, if the poles are on the platform, they still have to be shortened by the height of the platform, which isn't necessarily the same for all platforms. Now life would be easier if we had proper depth maps. Aren't those on the eternal todo list too?