The International Simutrans Forum

 

Author Topic: Canal/way alignment issues  (Read 2813 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18593
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Canal/way alignment issues
« on: December 24, 2012, 11:24:17 PM »
I am currently working, together with TygerFish, on an overhaul of the canals in Pak128.Britain, aimed at Experimental because of the ability to use way constraints, but nonetheless something which will hopefully be useful to Standard, too. I am working on the graphics and some of the research, and TygerFish will be assisting with the .dat files and also doing some research.

I thought that it would be a good idea to start with the largest of the new canals so that I could work out how much smaller that all the others need to be, so I started with something intended to be equivalent to the Manchester Ship Canal. The existing canals take up most, but not all, of the tile width, so I thought that the logical extension was a canal taking up just about all of the tile's width. I adapted the standard canal .blends in the latest version of Blender, and have so far produced a straight flat section, a diagonal flat section, a flat t-junction and a flat cross junction.

However, on exporting/rendering them, I have come across rather a problem, for, whilst when I test render them, I get properly aligned images such as these:





when I render the images for all four views using Zeno's script (which I long ago adapted for Pak128.Britain alignments, and have used successfully for vehicles for I think well over a year), I get horribly misaligned images such as these:









I should be very grateful for any insight into how to deal with this issue so that I can have properly aligned canals.

Edit: Looking into this further, I have managed to produce acceptable graphics by rotating them manually by using the transformations sub-menu accessed with the "n" key to set the 3-d cursor's position manually, setting it to 0,0,0 then selecting all on layer 1 and rotating on the z axis by 90 degrees (r, z, 90) before manually rendering (F12) and then saving (F3) each image.

I should still like to know why the automatic render will not work with this, however, but will work with vehicles. I am also unsure of whether I have got my alignments quite right even now, as there appear to be small discrepancies, but I have not tried to import the images into the game yet. Any assistance would be appreciated.
« Last Edit: December 26, 2012, 02:06:43 AM by jamespetts »

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Canal/way alignment issues
« Reply #1 on: December 30, 2012, 08:12:06 PM »
The canal blends predate the auto blender script by a number of years. I did everything manually back then (including getting the alignments in GIMP for the png). I've not done any ways since so you will probably need to get the alignments right from scratch. I'd be interested to know how you get on as my next major project will be to do elevated ways for road and rail, which will require getting this right!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18593
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Canal/way alignment issues
« Reply #2 on: December 30, 2012, 08:24:07 PM »
What I have found is that the .blender script (at least, the version that I have modified from your modification of Zeno's original to produce correct alignments automatically without having to align manually to templates) works only for vehicles. The alignment of ways is different to the alignments for vehicles.

As you might note, the images above are the corrected ones, as I had linked them from my .blends repository, then updated them. I have not looked at processing the images yet (TygerFish was going to look into doing that, but I have not heard from him in the last few days), but if you have any tips for how - even manually - to process way images I should be very grateful.

One of the particular challenges at present is how to align the way images correctly for canals that are narrower or wider than the existing canal images. Narrow gauge rail I know was done just by making the ballast bed just as wide as for standard gauge, and I have made the towpaths wider for the narrowboat and tub boat canals, but still not as wide as take up the whole space. In particular, I am not sure whether I have got the alignment of the diagonal correct, and should appreciate any tips on how to set that up in Blender.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Canal/way alignment issues
« Reply #3 on: December 30, 2012, 09:43:54 PM »
To be honest, I did way alignment by processing the image once in blender then just moving the image around in GIMP till it looked right. Tedious, but I didn't think of a better way.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18593
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Canal/way alignment issues
« Reply #4 on: December 30, 2012, 09:50:17 PM »
I see. How did you manage to get the diagonals aligned properly?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Canal/way alignment issues
« Reply #5 on: December 30, 2012, 09:53:13 PM »
Trial and error?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18593
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Canal/way alignment issues
« Reply #6 on: December 30, 2012, 09:54:19 PM »
Ahh, I see. And you don't remember now what you tried that worked?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Canal/way alignment issues
« Reply #7 on: December 30, 2012, 09:57:24 PM »
I don't know how to be more explicit: stick the rendered image into GIMP, try it, then if it looks odd in game move it a few pixels up/down/left/right until it works. Sometimes you need to delete a few pixels or copy a few to make the joins nice.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18593
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Canal/way alignment issues
« Reply #8 on: December 30, 2012, 10:00:45 PM »
Ahh, I see what you mean.