Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Feb 21, 2017 7:05 pm

All times are UTC




Post new topic  Reply to topic  [ 1884 posts ]  Go to page 1 2 3 4 595 Next

How do you use the regional parameters?
Only one region enabled 14%  14%  [ 12 ]
Multiple regions (but not all) enabled 29%  29%  [ 25 ]
All regions enabled 57%  57%  [ 50 ]
Total votes: 87
Author Message
 Post subject: [OTTD] 2cc TrainsInNML
PostPosted: Sun Jan 12, 2014 9:17 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
Hi all,

The old 2ccTrainSet is a great set, but the main coder has not been seen in quite some time and nobody seems to understand the code left behind, making it near impossible to improve the set. Therefore I made an attempt to code it again from scratch in NML and hopefully in such a way that more people can understand and work on it. This conversion is mostly complete, and the focus is now more towards adding new features.

The DevZone-project can be found here and you can download this set from here. Most vehicles from the old set have been included since the 28th of May (version v5261 and newer).

Some Q and A stuff that might be interesting:

Q: Will this set be compatible with the old set?
A: No, that would require such an amount of work because it is very easy to break stuff, that it would be easier to start from complete scratch and not consider compatibility. However, I will try to keep vehicle properties the same as much as possible.

Q: I want to help, what can I do?
A: You could just play with this set and report any problems you find. You could also translate this set to your language using the web translator or sending the file directly to me.

Q: I want feature X or Y, can it be included?
A: As the current conversion to NML is more or less complete, it is time to look at new features. Currently planned are:
  • Even more vehicles
  • Vehicle animations

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Last edited by Transportman on Thu Jul 09, 2015 4:46 pm, edited 16 times in total.

Top
   
PostPosted: Sun Jan 12, 2014 11:12 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Mar 30, 2004 12:30 pm
Posts: 16662
Location: Almere, The Netherlands
Transportman, a big thank you for doing this. :bow:

_________________
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."


Top
   
PostPosted: Sun Jan 12, 2014 11:13 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
Oh finally!

OK, a small help from me... the templating system explanation.

Sprite #1 - engine going up - aligned always to the top

Sprite #2 - engine going up+right - aligned always to the bottom right + 1px upwards for every 1px shorter sprite (i.e. lenght 8/8 is aligned to the bottom, 7/8 is 1px up, 6/8 is 2px up etc.)

Sprite #3 - engine going right - aligned always to the bottom right

Sprite #4 - engine going down+right - aligned always to the bottom right

Sprite #5 - engine going down - aligned always to the bottom

Sprite #6 - engine going down+left - aligned always to the bottom left

Sprite #7 - engine going left - aligned always to the bottom left

Sprite #8 - engine going up+left - aligned always to the bottom left + 1px upwards for every 1px shorter sprite (i.e. lenght 8/8 is aligned to the bottom, 7/8 is 1px up, 6/8 is 2px up etc.)
---


Also, there are 4 separate templates for locomotives - as explained in pic #1 below:
Attachment:
Pic1.PNG
Pic1.PNG [ 13.58 KiB | Viewed 20375 times ]


Purchase menu sprites are ALWAYS included at the bottom of these templates.
---

As for passenger/mail coaches, there is only one template looking like this:
Attachment:
Pic2.PNG
Pic2.PNG [ 11.29 KiB | Viewed 20375 times ]


99,99% of pax/mail coaches has only the first row as they look always identical, loaded or not. Indian coaches have people hanging out from windows and doors and sitting on the roof and these sprites have different loading stages and therefore occupy all 3 rows of the template.

As for 4 variants - the idea is that the first variant receives 60-70% chance of appearing when buying the coach, others appear in the remaining 30-40% (10-15% each). Their stats do not differ, this is for eyecandy purpose only. This is a random effect that cannot be influenced in any way other than buying and buying coaches until you get what you want. (i.e. You want 10 variant-3 coaches? Buy coaches until you get 10 of them and then sell the others...)

Also - passenger/mail coaches have their P-menu sprite in a SEPARATE FILE, usually named as <coach name>-P.png.

---

Freight wagons have only two templates - one is the same as pax/mail coaches (with 3 rows), the other template has 4 rows.

1st row - empty wagon - driving/loading sprites
2nd row - half-full wagon - driving/loading sprites
3rd row - full wagon - driving/loading sprites
4th row (if applicable) - driving sprites - if wagon i.e. opens doors when loading then these are sprites with closed doors meant for travelling

4 variants - same as for pax/mail coaches
P-menu sprite - same as for pax/mail coaches

EDIT: I forgot - freight wagons have a separate file for EACH CARGO!

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield


Top
   
PostPosted: Sun Jan 12, 2014 11:16 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 8999
Location: Sol d
VoyagerOne, it's probably better when you attach the templates individually instead of aggregating an image which shows all. As we now have another template ;)
(yes, might take more posts, but well :) )

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Sun Jan 12, 2014 11:18 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
Sorry planetmaker, I don't understand. Are you saying I have to re-template all these things? Is there another template? Please don't scare me... :|

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield


Top
   
PostPosted: Sun Jan 12, 2014 11:22 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 8999
Location: Sol d
Voyager One wrote:
Sorry planetmaker, I don't understand. Are you saying I have to re-template all these things? Is there another template? Please don't scare me... :|

No, don't be scared.

All I tried to say: attach the templates. Rather than attaching one file which shows the templates (where they naturally have different offsets from the origin of the file than being alone). Anyway, doesn't matter, if it is clear that you didn't show an *actual* template but an image which shows them all.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Sun Jan 12, 2014 11:25 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
Aha! *relieved sound*

Ouch! Re-templating would be a mission impossible... :lol:

BTW, Jake had problems finding these on devzone so...


Attachments:
Pax-mail.zip [1.63 MiB]
Downloaded 148 times
Freight.zip [3.07 MiB]
Downloaded 160 times

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
Top
   
PostPosted: Sun Jan 12, 2014 11:52 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
Purno wrote:
Transportman, a big thank you for doing this. :bow:

Don't thank me yet, I haven't done anything yet.

Voyager One wrote:
OK, a small help from me... the templating system explanation.

Thanks for the information. I found some offsets in the NFO files, so that should be okay with templating in the code. Only thing to watch out for is that the back engines have a different order than the rest.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Sun Jan 12, 2014 11:54 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Mar 30, 2004 12:30 pm
Posts: 16662
Location: Almere, The Netherlands
Transportman wrote:
Purno wrote:
Transportman, a big thank you for doing this. :bow:

Don't thank me yet, I haven't done anything yet.


Of course I'm thanking you. If you quit, you'll dissapoint me, wouldn't want that, would you? :mrgreen:

_________________
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."


Top
   
PostPosted: Sun Jan 12, 2014 6:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
Transportman wrote:
Only thing to watch out for is that the back engines have a different order than the rest.

Yeah, I forgot about that. All 8 sprites are orientated identically, regardless whether the engine/wagon should face the other way... So, 1st sprite is always up, 5th sprite is always down etc...

BTW, I don't know if you've seen wiki pages of the 2ccTS, maybe you can find some additional info on how things were supposed to look like, i.e. regional parameters, loading speeds etc.

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield


Top
   
PostPosted: Sun Jan 12, 2014 8:04 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 6895
i might be biased, but i've made excellent experience with generating the nml code from a simple table, since 99.9% of the vehicles use the same code over and over, with very little variations.

adding a new vehicle would be as trivial as adding a new row to the table.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Tue Jan 14, 2014 10:24 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
Transportman wrote:
Thanks for the information. I found some offsets in the NFO files, so that should be okay with templating in the code. Only thing to watch out for is that the back engines have a different order than the rest.

Spoken too soon. The templates I found do not match the graphics, so I need to work on figuring out the correct offsets.

Voyager One wrote:
BTW, I don't know if you've seen wiki pages of the 2ccTS, maybe you can find some additional info on how things were supposed to look like, i.e. regional parameters, loading speeds etc.

Yes, I've seen that. Also found an Excel sheet with most properties for most trains. Regional parameters and running costs that depend on speed are things that I want to do later. First I want to get the trains over to the new set as good as possible.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Tue Jan 14, 2014 5:30 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
Transportman wrote:
Spoken too soon. The templates I found do not match the graphics, so I need to work on figuring out the correct offsets.

You should be able to get them from the existing code fairly easily. Example: http://dev.openttdcoop.org/projects/2cc ... lhead.tnfo
Note that NML swaps the ysize and xsize columns. It will be annoying to copy everything, but it will be less time-consuming than realigning everything yourself.

Also this: http://dev.openttdcoop.org/projects/dut ... plates.txt
I believe that these are all the unique combinations in the 2cc set. I do vaguely remember that the Dutch Trainset aligns it's vehicles differently in the blue boxes than the 2cc Trainset, but I'm not sure. I'm sure Voyager knows. If it's the same, then you can grab the templates from the Dutch Trainset.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Tue Jan 14, 2014 5:55 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
FooBar wrote:
Transportman wrote:
Spoken too soon. The templates I found do not match the graphics, so I need to work on figuring out the correct offsets.

You should be able to get them from the existing code fairly easily. Example: http://dev.openttdcoop.org/projects/2cc ... lhead.tnfo
Note that NML swaps the ysize and xsize columns. It will be annoying to copy everything, but it will be less time-consuming than realigning everything yourself.

If switching ysize and xsize is the only difference, this should be correct:
Code:
//dmu / ice / tgv / wagons back
template template_2cc_dmu_back(x, y) {
    //[left_x, upper_y, width, height, offset_x, offset_y]
    [x+88 , y,  8, 24,  -3, -12]
    [x+97 , y, 22, 18, -14, -10]
    [x+120, y, 32, 14, -16, -10]
    [x+153, y, 22, 18,  -6, -10]
   [x    , y,  8, 24,  -3, -12]
    [x+9  , y, 22, 18, -14, -10]
    [x+32 , y, 32, 14, -16, -10]
    [x+65 , y, 22, 18,  -6, -10]
}

And the whole bunch of other templates and the normal direction. On top of that, I don't get white pixel errors (nor any other graphical glitches), so the sizes are good, but the offsets are wrong.


Quote:
Also this: http://dev.openttdcoop.org/projects/dut ... plates.txt
I believe that these are all the unique combinations in the 2cc set. I do vaguely remember that the Dutch Trainset aligns it's vehicles differently in the blue boxes than the 2cc Trainset, but I'm not sure. I'm sure Voyager knows. If it's the same, then you can grab the templates from the Dutch Trainset.

The Dutch Trainset aligns them differently. I realigned a lot of the vehicles from the original set to the new template, and it is different then the 2cc template.

[EDIT]Only the depot sprite seems to be wrong now[/EDIT]

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Last edited by Transportman on Tue Jan 14, 2014 6:28 pm, edited 1 time in total.

Top
   
PostPosted: Tue Jan 14, 2014 6:25 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
FooBar wrote:
Dutch Trainset aligns it's vehicles differently in the blue boxes than the 2cc Trainset, but I'm not sure. I'm sure Voyager knows.

The 2cc set indeed has a different alignment system - don't ask me why, DJ requested that. It is explained in my first post in this thread.

viewtopic.php?f=26&t=69826#p1108628

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield


Top
   
PostPosted: Tue Jan 14, 2014 8:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
Voyager One wrote:
It is explained in my first post in this thread.

viewtopic.php?f=26&t=69826#p1108628

Ah, my bad. I didn't bother to read properly, as it seems.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Tue Jan 14, 2014 9:06 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
I got it fixed now, pushed my work so far to the repo.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Wed Jan 15, 2014 10:16 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
Just a question regarding MUs:
Should I use the old way with regards to consist length (free to make a consist as long as you want, using the MU/Maglev wagon and use a new engine for a new consist), or use fixed consist lengths (like for example the Dutch Trainset and was considered at some point for the old 2cc set)?

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Wed Jan 15, 2014 10:51 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Dec 28, 2009 9:47 am
Posts: 10893
Location: Rijeka, Croatia
Definitely non-fixed consists. That was also one of the major features of this set.

_________________
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield


Top
   
PostPosted: Wed Jan 15, 2014 11:33 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2448
Voyager One wrote:
Definitely non-fixed consists. That was also one of the major features of this set.

And then using the same method as the old set (MU/Maglev wagon), or could I leave it out and have players place engines behind each other?

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1884 posts ]  Go to page 1 2 3 4 595 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.