News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Tram alignment issue

Started by jamespetts, January 11, 2014, 01:16:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

Having spent much time over Christmas re-scaling the trams (and adding many more), I have now compiled them and got them into the game and realised that they do not align properly with the tram track.

The trouble seems to be that tram track has a completely different alignment than railway track, to which I calibrated the automatic alignment in my adapted version of The Hood's adapted version of Zeno's automatic Blender rendering scripts. As can be seen, when the trams that I exported automatically run on the new tram track, they are so badly aligned that they have the appearance of monorail trains running on the far rail:



However, notice the tram in the background on ordinary railway track: that is perfectly well aligned. Notice also the obvious discongruity between tram and railway line, showing the extent of the misalignment: the far tram track appears to align almost exactly with the half way between the two rails of railway track.

The old trams seem to have coped with this by being enormously (and unrealistically) wide:



but even then, they were noticeably out of alignment on railway tracks:



I assume that tram tracks are so aligned as to be in the middle of the road as they currently are. However, this raises the question of why railway tracks are aligned as they are if the centre of a railway track is not the same as the centre of a road. In any event, trams and railways need to be able to use vehicles of the same alignment, as modern trams (such as those pictured in my examples above) use a mixture of reserved track (light railway lines) and street running (tram lines).

Does anybody know why things were set up this way, and have any suggestions for dealing with this situation?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

I would presume it is because the rail tracks are on an elevated bed, while tram tracks and road are not.

One fix would be to raise the road and tram track to match the height of the track, although this would be very labour intensive to fix, with all tram tracks, roads and crossings requiring some reworking. It might be easier to give all roads and tram tracks a one or two pixel offset upward, which should closely match the height profile of train tracks.

The least labour intensive fix would be to realign tram tracks to match rail tracks, at the cost of losing some alignment in the road.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

jamespetts

Hmm, I see. In reality, roads, too, have some height above base terrain, at least at the centre, so perhaps the most satisfactory solution would be to re-align the roads, but one then wonders how that would fit in with the buildings, given that roads, but not rail, occupy nearly the full tile.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

I think you would get lobsided sidewalks if the buildings and sidewalks aren't raised as well...
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

jamespetts

Hmm, so perhaps simply re-aligning the tram tracks is the way to go. I have not worked much with offsets - do you have any ideas as to what offset settings might work? We seem to be more than one or two pixels out - more like five or ten.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Fabio

Pak128 lowered train tracks, you folks might do the same ;)

Tough labor-intensive job, but worth it IMHO.


Sent from my iPhone using Tapatalk

ӔO

If I remember correctly, to go up right in simutrans, you need to put in " ,-2,4 " at the end of each image line in the dat.
eg [image][e]: filename0.1,-2,4

I think it was in the form of Y,X

Y, positive goes down, negative goes up
X, positive goes right, negative goes left (I don't remember which)

It might be easier to get left-right sorted out first, as I remember negative for Y axis goes up.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

jamespetts

AEO - thank you; I will look into that.

Fabio - is the tram issue the reason that Pak128 changed its rail alignment?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna

I think just raising the tram tracks would be the best and easiest course of action.

The Hood

I realised this when I did the tram tracks but decided at the time that the tram tracks looked better aligned relative to the road, hence the effect you see. The intention was, at some stage, to draw some additional tram-aligned tracks for off-road sections. After all most trams would be running on much lighter tracks than heavy rail. The rail graphics presumably look the way they do because the ballast and sleepers raise them some way off the ground level. If I was starting from scratch though I'd probably have all rails centred.

jamespetts

Hmm, I'm not sure that having differently aligned light rails makes a great deal of sense, especially as lighter rails are not used exclusively by tram vehicles, and tram vehicles do not exclusively use lighter rails. I am proposing to follow AEO and Junna's suggestions of re-aligning the tram track for Experimental, which might be better. It would not look too out of place for tram track not to be down the exact centre of the road, I think, as tram track very often was not.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

Give it a go and see how it looks. I'm still waiting for the day when a separate waytype gets introduced so we can have two-way trams on the streets - it is one of the most unrealistic aspects of simutrans at the minute and severely constrains the usefulness of trams in cities - either you have to have one-way systems or bulldoze loads of houses to make dual carriageways everywhere.

jamespetts

Quote from: The Hood on January 11, 2014, 06:45:10 PM
Give it a go and see how it looks. I'm still waiting for the day when a separate waytype gets introduced so we can have two-way trams on the streets - it is one of the most unrealistic aspects of simutrans at the minute and severely constrains the usefulness of trams in cities - either you have to have one-way systems or bulldoze loads of houses to make dual carriageways everywhere.

Yes, that is unfortunate indeed. If such a system were introduced, however, it would have to be compatible with railways in order to allow the modern tram/light rail type network.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I have now implemented AEO's suggestion (I needed to reverse the negative and positive to make it work). This is as close an alignment as I am able to get with offsets, having worked on the premise that both numbers need to be changed by the same amount for each movement to prevent undesirable diagonal movement. Images below:







Any thoughts? I am not quite sure what to do about depots, which show a little track in them which is now misaligned. Perhaps just remove the track, as with the railway depots?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

I think the track needs to go down by one pixel, and then it would be a perfect match.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Fabio


Quote from: jamespetts on January 11, 2014, 03:00:48 PM
Fabio - is the tram issue the reason that Pak128 changed its rail alignment?

Not exclusively, but a big factor behind my decision.


Sent from my iPhone using Tapatalk

jamespetts

AEO - ahh, yes, I think that I have a more accurate alignment now:

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

kierongreen

Bridges are a huge problem. A huge, huge problem.

The Hood

Quote from: kierongreen on January 12, 2014, 02:38:02 PM
Bridges are a huge problem. A huge, huge problem.

In the context of realigning rail tracks? Yes I agree entirely - hence my caveat above saying "if I was starting from scratch" - obviously that's not the case now so probably what James has done is possibly best. It would be interesting to see a screenshot for a road type with a dashed line down the middle - how the trams align with that now. It might not be altogether bad if trams did indeed travel down one lane of the road only. For realism then the player should of course make all such roads one way to road traffic too. As to the depots, I suggest removing the track entirely and dithering the entrance as on the rail and road graphics. The tram depots are an anomaly and I can't remember why I did it that way in the first place :s

jamespetts

#20
How is this for an image showing central road markings and a bridge all in one?



I assume, Kieron, that you mean that bridges would be a huge problem for re-aligning all rail tracks, rather than simply re-aligning tram tracks as I have done? As you can see, the bridge appears to work adequately as things now stand.

Edit:

I have modified the tram depots with road depot like half-toning, but I don't think that it works very well, as it does not have the underlying texture of the road:



Would plain black perhaps be better?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna

That does look pretty good.

Will you be resizing the other road vehicles as well to keep them in consistency with the now smaller trams?

greenling

Hello Jamespetts
I Think that the Tram not be in the mid of the road it.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

jamespetts

Quote from: Junna on January 12, 2014, 04:55:04 PM
That does look pretty good.

Will you be resizing the other road vehicles as well to keep them in consistency with the now smaller trams?

I plan to do so eventually, but this will be a lot of work (including modifying the rendering script to allow correct road vehicle alignments), so it is not likely before the next release.

Greenling - as discussed, the tram is no longer exactly in the middle of the road, but they were not always exactly in the middle of the road historically in any event.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

Ah now I remember why I did the depot as I did! I was also planning on creating a tram track graphic that included the pavement as an underlay. I think pak96.comic has something similar. It would allow nice graphics for trams on pedestrianised/reserved sections inside a city centre. That would presumably fix the depot problem. We could also stick pavement on the depot graphics.

jamespetts

That's an interesting idea, but I am not quite sure how to go about doing that (either the pavement base for the tram tracks that would be layered underneath a road when laid on a road or the correct orientation for pavement in the tram depot). Indeed, I do wonder whether this is advisable with earlier era (1860s-1880s) trams, where this sort of pavement would not have been commonplace (although perhaps the dirt road could be used as the underlay for earlier tracks). This would certainly address the issue of tram tracks looking silly when not laid on a road. Were you planning on doing that any time soon? If not, it might be best just to revert the depot entrances to plain black. If you were, then presumably the depot graphics could retain their half-toning as this pavement layer would be visible beneath the tram tracks.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

Code it as a rail track rather than tram track so it can't be built on roads. Just take the pavement image and then superimpose the various different tram track images on top of it in GIMP. Should be easy - but I've not quite got the time to do any drawing just yet.

jamespetts

Oh, so it is not possible to have a sort of background image for actual tram track? That is a shame. Tram track coded as railway track would be very confusing to players, I think, and would still leave actual tram track drawn other than on road looking silly. I think that we are probably better off having completely dark depot entrances for now.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

kierongreen

Yes I did mean bridges would be a problem for realigning railways. The annoying thing was that all railways were redrawn when double heights were introduced.

jamespetts

Re-aligning trams seems to have worked adequately for the present.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I have just replaced the tram depot halftoning in my latest Github commit. The tram depots now look as follows:



Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.