The International Simutrans Forum

 

Author Topic: Rail Alignment Help program  (Read 6235 times)

0 Members and 1 Guest are viewing this topic.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Rail Alignment Help program
« on: January 28, 2012, 07:13:59 PM »
Some time ago I started to code a program to help me aligning rail vehicles properly. This task is really tough when talking about @MUs. Now I wanted to paint some more EMU trains, so I have rescued the project and I have the aim to finish it before starting to paint those vehicles. I leave here a demonstration video, which will show much more than I can explain in words. I'd like to know if it would be worth to make this tool public, or adapt for other pak size (now it's only for 128), maybe to other vehicles also. Thank you in advance for your comments :)

Here, the video --> www.youtube.com/watch?v=7UQl2cnTjgA

First release: v0.1 r5 download
« Last Edit: February 04, 2012, 02:33:01 PM by Zeno »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Rail Alignment Help program
« Reply #1 on: January 28, 2012, 07:58:05 PM »
Most useful indeed.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Rail Alignment Help program
« Reply #2 on: January 28, 2012, 10:38:56 PM »
this is like a dream program for painters.

is the way file also loaded like the trains? I think it would be great if road vehicles were also possible.

I would definitely support this.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Rail Alignment Help program
« Reply #3 on: January 29, 2012, 10:35:12 AM »
Nifty! :)

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #4 on: January 29, 2012, 11:54:18 AM »
As long as some interest has been shown, I think I will make a code cleanup (now that it's still rather a small thing) and then upload to my sourceforge account.
Btw, just enabled remove and save vehicle functionalities, which were already implemented, and added new variable vehicle length support, so non-standard ( not 8 ) lengths are drawn properly.
I will be testing it by aligning the DMUs I have currently waiting to be re-aligned, so there is a possibility of an initial (beta?) release in a few days :)

I think it would be great if road vehicles were also possible.
I think it should not be difficult to adapt. There is a "hidden" functionality for background template loading... by using it, a road background could be drawn, then the program mechanics doesn't care of what you've painted: it will only paint what you load by using some calculated coordinates, no matter if it's a train or a bicycle :P
Considering that, it might be useful as well for road vehicles, trams and maglevs. Probably not very useful for airplanes and ships though...

The only problem I can see right now is that the program hasn't the ability to load the same object in different positions (this would apply if you want to load a loco then five wagons of same type to see how the convoi is drawn). It can be done by loading the same vehicle in different positions, but the program will allow to handle different offsets for each position and that would lead the user to confusion for sure. I will look for a workaround for that, if possible.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Rail Alignment Help program
« Reply #5 on: January 29, 2012, 09:20:50 PM »
I think the rails are a few pixel diffrent in the different paks, those alignment graphics background imges must be pak-dependent too, or?

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #6 on: January 29, 2012, 09:23:41 PM »
Yes, probably the rails will differ in different paks. Anyway, the templates are just plain images that can be easily loaded, so no matter the pak you use as long as you provide the proper background images, which can be easily built with a couple of screenshots and as few gimp knowledge as mine :)

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #7 on: January 30, 2012, 10:17:54 PM »
Well, I have everything ready for a first (pre-)release, let's say v0.1 :)
What about the name... Simutrans Align Helper sounds ok? Any proposal?
When I decide for a name I'll upload it to sourceforge.

At the moment you can download a minimum-functional version here.
I'm sorry this is a preliminar version and doesn't include any help file/documentation. You can mostly look at the video at the beginning of the thread to know how to use it. If you still have questions, ask here. If you can wait for some days, maybe I'm able to make a small help document or FAQ before end of the week.

Some tips/advices:
  • Use shades for aligning your single vehicles first. It's free, easy and cool!!
  • Then you can use this program to preview a convoi and/or fine aligning
  • ATTENTION!!! At the moment only a single PNG format and structure is supported!! Images must be in row 1 (second row) and must be in same order than the application arrows!!!!!
  • No possibility of changing the background templates yet :-(
  • No possibility of changing language yet :-(
  • It already allows loading some images, aligning them and finally save them. That's what it's supposed to, so don't expect much more.
And remember: make a backup of your images before playing with this!!! I warned you, so don't put the blame on me later!! ;-)
Please, let me know your thoughts, bugs, ideas, whatever :)

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Rail Alignment Help program
« Reply #8 on: February 03, 2012, 09:24:41 PM »
Zeno your programm it very hot!
Then your programm than be can to aligment road,tram,maglev,ships,plans and monrail.
and that in 64 pixells too.
Then have the simutrans modells devloper an Powertool with the work on new modells than go quick from the hand.
 :) :)

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #9 on: February 04, 2012, 12:06:52 PM »
The project is in sourceforge at https://sourceforge.net/p/vats/admin/

There is also a small help page (wiki) as well as a first program release. The installer can be downloaded here.
The help page does not tell much how it works, so you better get guided by the youtube video I previously posted.

Remember this version has still some important limitations:
* Only 128 sized stuff
* Non changeable templates
* PNG *MUST* be in the Pak128 standard structure
** first line only text
** vehicle views in second line
** order must be the same than application buttons)
« Last Edit: February 04, 2012, 02:32:11 PM by Zeno »

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Rail Alignment Help program
« Reply #10 on: February 04, 2012, 01:06:45 PM »
I'd call it ZAP
Zeno's Alignment Program.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #11 on: February 04, 2012, 02:35:03 PM »
Heh AEO... I don't feel like giving credits to myself through the program name :P
Anyway the period for naming proposals ended yesterday; from now on I feel too lazy to rename everything again. It's a mess, you know!
Thank you anyway for your proposal!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17765
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Rail Alignment Help program
« Reply #12 on: February 04, 2012, 04:00:01 PM »
I like the idea of this! I've had trouble in the past with alignment.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #13 on: February 05, 2012, 05:18:01 PM »
I am trying to give the program the option to use different pak sizes, but I'm finding trouble with the vehicle offsets.
I ask if there is someone familiar with the vehicle positioning code in simutrans to advice me if I am doing wrong; in my program I have an offset calculated based on the direction and tile size:
West: X offset is + vehicle_length * tile_size / 32;
West: Y offset is + vehicle_length * tile_size / 64;
North: X offset is - vehicle_length * tile_size / 32;
North: Y offset is + vehicle_length * tile_size / 64;
and so on...
 
Please, I'd like to be adviced if I am in the right path or not; maybe I'm confusing things, as I've having some undesirable results.

Another difficulty I can already spot is how will I manage the first position offset. As it's done now, it will be fixed and will force the background image to be moved/modified in order to fit the fixed initial offset. Maybe it's not the most elegant way to do it, and I'm not sure how can I handle such a thing...

Thank you in advance.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Rail Alignment Help program
« Reply #14 on: February 05, 2012, 09:29:37 PM »
Maybe it would be easier to just use the routines from simutrans ... from vehikel_basis_t::get_screen_offset



Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Rail Alignment Help program
« Reply #15 on: February 05, 2012, 09:40:17 PM »
Maybe it would be easier to just use the routines from simutrans ... from vehikel_basis_t::get_screen_offset
I will look into the svn for it. Thank you prissi.