[OTTD] 2cc TrainsInNML

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply

How do you use the regional parameters?

Only one region enabled
20
14%
Multiple regions (but not all) enabled
43
31%
All regions enabled
75
54%
 
Total votes: 138

Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

[OTTD] 2cc TrainsInNML

Post by Transportman »

Important message:
Transportman wrote: 23 Feb 2020 18:20
Transportman wrote: 18 Jan 2020 19:38 I just released a new version (3.0-RC1) with two small fixes compared to the previous release. It is on BaNaNaS.

Somewhere next month I intend to make it a full release.
3.0 has been released, no changes compared to 3.0-RC1. With that I will stop development of this set, I just don't have the motivation to continue on it.
===
Original post:
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
Last edited by Transportman on 23 Feb 2020 18:21, edited 17 times in total.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: [OTTD] 2cc TrainsInNML

Post by Purno »

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."
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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:
Pic1.PNG
Pic1.PNG (13.58 KiB) Viewed 70625 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:
Pic2.PNG
Pic2.PNG (11.29 KiB) Viewed 70625 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
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [OTTD] 2cc TrainsInNML

Post by planetmaker »

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 :) )
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [OTTD] 2cc TrainsInNML

Post by planetmaker »

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.
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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 476 times
Freight.zip
(3.07 MiB) Downloaded 494 times
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: [OTTD] 2cc TrainsInNML

Post by Purno »

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."
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: [OTTD] 2cc TrainsInNML

Post by Eddi »

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.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by FooBar »

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.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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: Select all

//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.[/s]
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]
Last edited by Transportman on 14 Jan 2014 18:28, edited 1 time in total.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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.

http://www.tt-forums.net/viewtopic.php? ... 6#p1108628
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by FooBar »

Voyager One wrote:It is explained in my first post in this thread.

http://www.tt-forums.net/viewtopic.php? ... 6#p1108628
Ah, my bad. I didn't bother to read properly, as it seems.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

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
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

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
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 9 guests