The International Simutrans Forum

 

Author Topic: Graphical alignment query  (Read 3341 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18502
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Graphical alignment query
« on: December 31, 2011, 10:02:52 PM »
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.
« Last Edit: December 31, 2011, 10:08:15 PM by jamespetts »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
Re: Graphical alignment query
« Reply #1 on: December 31, 2011, 11:51:27 PM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18502
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Graphical alignment query
« Reply #2 on: January 01, 2012, 12:45:45 AM »
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.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Graphical alignment query
« Reply #3 on: January 01, 2012, 07:30:17 PM »
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 :)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18502
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Graphical alignment query
« Reply #4 on: January 01, 2012, 07:36:23 PM »
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?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Graphical alignment query
« Reply #5 on: January 01, 2012, 08:12:40 PM »
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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
Re: Graphical alignment query
« Reply #6 on: January 01, 2012, 09:11:10 PM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18502
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Graphical alignment query
« Reply #7 on: January 02, 2012, 08:57:53 PM »
Another question, if I may - are steam locomotive tenders treated in any special way, or are they aligned just as any other vehicle?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Graphical alignment query
« Reply #8 on: January 02, 2012, 09:18:35 PM »
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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Moderator
  • *
  • Posts: 2269
Re: Graphical alignment query
« Reply #9 on: January 15, 2012, 11:32:39 AM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18502
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Graphical alignment query
« Reply #10 on: January 15, 2012, 12:42:27 PM »
Ahh, I see, interesting - so Pak128 is done the same way?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Moderator
  • *
  • Posts: 2269
Re: Graphical alignment query
« Reply #11 on: January 15, 2012, 04:42:51 PM »
I assume so - there was a bit of trial and error in setting up alignments originally.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Graphical alignment query
« Reply #12 on: January 15, 2012, 05:18:17 PM »
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.