News:

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

Vehicle offsets

Started by jamespetts, February 15, 2013, 02:06:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I am working on improving rail vehicle alignment in Pak128.Britian: see here for details. I have managed to create a set of universal offsets which prevent the vehicles hanging over the ends of the platforms/tracks at termini.

However, there is a difficulty when using this with Experimental. As some may know, Experimental has a feature which allows convoys to reverse without reversing all of the individual vehicles: for example, in a train hauled by a steam locomotive with a tender, the locomotive and tender's graphics will be reversed, but the graphics (and order) of the carriages will not be, to simulate the locomotive running around the carriages and being turned on a turntable. This gives rise to some problems, however, in that, because the alignments seem to be different when the vehicles are reversed, large gaps between locomotives and carriages can appear. Also, the effect of preventing trains from hanging over the ends of platforms when they reach a terminus is nullified when those trains are in reverse formation.

I should be very grateful for some information on quite how the alignment of vehicles is affected by reversing them, and how I might look into giving vehicles a special offset for when they are in a reversed state. I have found the vehikel_basis_t::get_screen_offset method, which appears to be relevant, but any guidance on how being in a reversed state affects the various offset settings would be very welcome.
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.