News:

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

Graphical alignment query

Started by jamespetts, December 31, 2011, 10:02:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I notice that all the vehicles in Pak128.Britain (with the possible exception of some vehicles that I have added) are aligned so that the lower left of the 128x128 tile is the lower left point of the vehicle. In many cases, this means that vehicles are not centred on the tiles. In pak64, by contrast, the vehicles all seem to be centred on the tiles. Might I ask why it was done this way in Pak128.Britain?

I suspect that this design is behind some problematic behaviour, including trains appearing to stop just beyond signals, and large gaps appearing in trains in Experimental when reversed.

Edit: Another question - how does one align vehicles in Blender to work in this way? I have been aligning them to the centres of tiles in the past, which has caused problems in some cases, as it is inconsistent with the rest of the set - I must confess, I only really noticed the issue properly this evening when trying to calculate whether I'd made some railway carriages too long.
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.

prissi

In pak64 all vehicels are aligned, so that they can drive half a tile without entering into the next tile. That gave the least errors graphically with the old algorithm. The new should deal better with any alignment, as long as it is consitent.

jamespetts

Ahh, thank you; that is useful information. (Although I have found that, in Experimental, pak64 works better with reversing than Pak128.Britain, so I suspect that, in Experimental at least, the pak64 system works better).

In order to obtain consistency, however, I am still very interested to know from The Hood how he manages to get vehicles aligned in Blender that way for automatic exporting using the rendering scripts.
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

As far as I can remember (although really the person who needs to give the definitive answer here is kierongreen) vehicles are aligned as follows:

Imagining a tile split into 1/16ths (as per the length= parameter in the dat file), the first release of the British Rail add-on for pak128 (the precursor to pak128.Britain) was from the days where only length=8 was allowed (i.e. half tiles).  The vehicles were aligned so that the centre of the vehicle was the centre of the tile.  When the set was redrawn after the advent of variable lengths, alignment continued so that length=8 was unaffected, and IIRC shorter or longer vehicles were aligned so that the front of the vehcicle was always in the same place regardless of length.  In blender this should be straightforward, as the pak128.Britain template .blend is set up so that one small square on the grid corresponds to 1/16th of a tile (1 length increment).  Therefore the front of all vehicles should be four grid squares forward of the centre line.

One thing though is I'm not sure how good this is in game - a definite problem of never having time to actually play and test the set. I'm also not sure how this compares to other sets, or if this is what should happen. If someone has the time and inclination to either reposition the graphics or edit the dat files to realign all images using offsets, then they would be welcome :)

jamespetts

Thank you for that helpful indication - that is most useful. I must confess, I have not hitherto delved much into offsets, which might be a very useful way of re-aligning large sets of vehicles whose alignment is inconsistent with other vehicles. How would one specify an offset in the front/back direction in the .dat files?
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

Offsets are defined using commas after the image definition.  See this topic where I was grappling with the same issue:  http://forum.simutrans.com/index.php?topic=3346.msg32667#msg32667

prissi

The front in the center of the tile is only true for north and westbound. In the other directions, it shoudl be 8 steps further away.

jamespetts

Another question, if I may - are steam locomotive tenders treated in any special way, or are they aligned just as any other vehicle?
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

I aligned them the same as others, but sometimes allowing for the fact they link under the main loco, e.g. garretts.  I always checked the alignments afterwards and altered them - tedious but necessary.

kierongreen

As The Hood has said, alignment goes back to British Rail addon for pak128 and therefore the aim was to ensure that vehicles were aligned in a similar way to the rest of pak128 vehicles.

jamespetts

Ahh, I see, interesting - so Pak128 is done the same way?
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

I assume so - there was a bit of trial and error in setting up alignments originally.

VS

Oops, sorry, I deleted the post but James already replied to it. Anyway, pak128 assumes the default vehicle would be aligned with front at center of tile. The remark was that I'll have to take a look at what Prissi said and revise this.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!