[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

How do you use the regional parameters?

Only one region enabled
18
15%
Multiple regions (but not all) enabled
36
30%
All regions enabled
68
56%
 
Total votes: 122

User avatar
WLK
Engineer
Engineer
Posts: 31
Joined: 15 May 2005 13:47
Location: Slovakia
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by WLK »

Hello,

First of all, you have done great job! :bow:
I quickly tested the latest file and found one bug - Thessaloniki metro 2014 has gap between firs and last wagon (screenhot attached). All other models seem working correct.
Attachments
2ccNML_bug.png
(169.41 KiB) Downloaded 3 times

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

Hmmm, haven't noticed this one... must have missed it... it seems it's misaligned in all directions except going south.
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: 2715
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

WLK wrote:Hello,

First of all, you have done great job! :bow:
I quickly tested the latest file and found one bug - Thessaloniki metro 2014 has gap between firs and last wagon (screenhot attached). All other models seem working correct.
Thanks, nice spot. I created a bug report on the tracker, so that I remember to fix it at one point. I do need to find out where it goes wrong. I suspect the graphics file is incorrect, but I do need to confirm that.
Voyager One wrote:Hmmm, haven't noticed this one... must have missed it... it seems it's misaligned in all directions except going south.
It is also misaligned when going south, but then the front part is aligned incorrectly.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9377
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [OTTD] 2cc TrainsInNML

Post by planetmaker »

Transportman wrote:
WLK wrote:Hello,

First of all, you have done great job! :bow:
I quickly tested the latest file and found one bug - Thessaloniki metro 2014 has gap between firs and last wagon (screenhot attached). All other models seem working correct.
Thanks, nice spot. I created a bug report on the tracker, so that I remember to fix it at one point. I do need to find out where it goes wrong. I suspect the graphics file is incorrect, but I do need to confirm that.
Voyager One wrote:Hmmm, haven't noticed this one... must have missed it... it seems it's misaligned in all directions except going south.
It is also misaligned when going south, but then the front part is aligned incorrectly.
That sounds like it's not an 8/8 length vehicle but smaller - but using the 8/8 alignment offsets

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

It is a 6/8 long vehicle but my file seems aligned correctly... Dunno...
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: 9377
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [OTTD] 2cc TrainsInNML

Post by planetmaker »

Voyager One wrote:It is a 6/8 long vehicle but my file seems aligned correctly... Dunno...
I did mean the length and alignment info in the code, not the grapics file:)

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

planetmaker wrote:That sounds like it's not an 8/8 length vehicle but smaller - but using the 8/8 alignment offsets
It is a 6/8 length vehicle, but the offsets are taking care of in the graphics file themselves. There are also several 7/8 vehicles using the same template, but those appear to be fine.

I'm almost sure it is the graphics file. When I compare it with the graphics file for the Oslo MX3000 and T1000, the second row is aligned differently (except for the fifth sprite, where the top row is aligned different). I'll make the modifications to check.

That is going to happen at a later moment, there are more graphics with issues, so I postpone that to a later moment.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

Honestly, I don't remember any more about those alignments, it was almost two years ago... I'll try taking a look what's wrong.

EDIT: Wait, I've just remembered one thing, demonstrated in the pic below. The 1st row is 1px from the top of the file, the top of the 2nd row is 7px from the bottom of the 1st row but ALL other rows (including the P-menu bluebox) are 8px each from other!

Don't ask me why, DJ requested this kind of template... This applies for all multi-row templates!
Thessaloniki 2014.PNG
Thessaloniki 2014.PNG (16.85 KiB) Viewed 1687 times

EDIT2: Regarding the T1000 and the MX3000, I've just noticed that those were my very early works - there isn't my logo in the file. IIRC, DJ in the meantime somehow changed the template into this latter one. If you see my logo in a file, the template should be correct.
Leon

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

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5096
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [OTTD] 2cc TrainsInNML

Post by andythenorth »

Spritesheets using those 7px - 8px row offsets could be fixed programmatically if they're an issue. I have code in IH that slices out spriterows, moves them around, then saves out the spritesheet. Someone PM me if you want help.

Having non-standard row offsets makes templating hard. ;)

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

andythenorth wrote:Having non-standard row offsets makes templating hard.
No ****. :lol: I had to do them all manually, one by one sprite... :lol:
Leon

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

juzza1
Engineer
Engineer
Posts: 95
Joined: 22 Oct 2004 19:27

Re: [OTTD] 2cc TrainsInNML

Post by juzza1 »

The old Thessaloniki is also somewhat funky...
thess_2cc_old.png
thess_2cc_old.png (21.95 KiB) Viewed 1627 times
Looks like the alignment of http://dev.openttdcoop.org/projects/2cc ... i_2014.png differs from some other shortened vehicles in the 2ccts:

http://dev.openttdcoop.org/projects/2cc ... _T1000.png (| alignments inverted, all but | alignments inverted for the end part. Sprite order flipped (12345678->56781234))
Also, when examining the other sprites, I noticed some peculiarities I cannot explain. Some examples:
http://dev.openttdcoop.org/projects/2cc ... LR_P86.png (sprites 2 and 5 aligned to left, 3, 4, 7 and 8 aligned to right, inverted alignment in | views, transparent blue changes depending on viewing program)
http://dev.openttdcoop.org/projects/2cc ... s_MP89.png (as above)
http://dev.openttdcoop.org/projects/2cc ... M2_840.png (6 and 8 aligned to left, 2, 3, 4 and 7 aligned to right, | views as above, background as above)

Most shortened MUs have non-standard alignments when compared to the explanation here (http://www.tt-forums.net/viewtopic.php? ... 6#p1108628).

Also, the 2cc template relies on the "top - 3x right - bottom - 3x left" alignment, so it will fail when used on a flipped vehicle (var[0xC8]) shorter than 8/8, because the order of realsprites called is 5-6-7-8-1-2-3-4 instead of the 1-2-3-4-5-6-7-8 required by the template.
Last edited by juzza1 on 31 Jan 2014 11:08, edited 1 time in total.

Eddi
Tycoon
Tycoon
Posts: 7424
Joined: 17 Jan 2007 00:14

Re: [OTTD] 2cc TrainsInNML

Post by Eddi »

flipping of vehicles failing for shortened vehicles is precisely why this was disabled by default. there is extensive work needed to fix it by the NewGRF.
You might not exactly be interested in Ferion, but if you are, have fun :)

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

That explains the funny results with all the shortened multiple unit metro-vehicles, except for the Oslo ones that are fine. The Oslo graphics have been templated with the right offsets to allow using var[0xC8] (but have the graphics in the wrong order compared to the other metros), while the other shortened metros have the wrong offsets in the graphics file. So moving around some sprites should fix all those issues. Lets hope most of the uncoded MUs are just 8/8 vehicles, that is much simpler. Thank you all for pointing me in the right direction.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

Transportman wrote:Lets hope most of the uncoded MUs are just 8/8 vehicles
Unfortunately, IIRC, I wouldn't bet on that. :(

I'll take a look at all my files and try correcting alignments but I expect that it could be a hell of work.
Leon

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

User avatar
Purno
Tycoon
Tycoon
Posts: 16663
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: [OTTD] 2cc TrainsInNML

Post by Purno »

Transportman wrote:Lets hope most of the uncoded MUs are just 8/8 vehicles, that is much simpler. Thank you all for pointing me in the right direction.
"most" MUs are, but there's still several which aren't, as well as some engines (including dual-headed engines and engines including B-units). :P
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."

juzza1
Engineer
Engineer
Posts: 95
Joined: 22 Oct 2004 19:27

Re: [OTTD] 2cc TrainsInNML

Post by juzza1 »

If you are going to fix some sprites, my suggestion would be to re-arrange the sprites like this:
shortened_example.png
shortened_example.png (5.92 KiB) Viewed 1594 times
So the sprites for the rear vehicle are arranged as if it was a flipped front vehicle.

This makes coding the realsprites trivial, and still allows you to use a single, common template. Only thing required code-wise is to call a different template for a flipped vehicle, which is constructed from the same parts as the template for non-flipped vehicles. Example (taken from the 2cc nml source):

Code: Select all

template template_2cc_engines_general_1234(x, y) {
//[left_x, upper_y, width, height, offset_x, offset_y]
[x    , y,  8, 24,  -3, -12]
[x+9  , y, 22, 20, -14, -12]
[x+32 , y, 32, 16, -16, -12]
[x+65 , y, 22, 20,  -6, -12]
}

template template_2cc_engines_general_5678(x, y) {
//[left_x, upper_y, width, height, offset_x, offset_y]
[x+88 , y,  8, 24,  -3, -12]
[x+97 , y, 22, 20, -14, -12]
[x+120, y, 32, 16, -16, -12]
[x+153, y, 22, 20,  -6, -12]	
}

template template_2cc_engines_general(x, y) {
template_2cc_engines_general_1234(x, y)
template_2cc_engines_general_5678(x, y)
}

template template_2cc_engines_general_flipped(x, y) {
template_2cc_engines_general_5678(x, y)
template_2cc_engines_general_1234(x, y)
}
Then just call "template_2cc_engines_general_flipped" for the rear-part of a dual-headed vehicle.

Of course this is a lot of boring grunt work graphics-wise.

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

Purno wrote:
Transportman wrote:Lets hope most of the uncoded MUs are just 8/8 vehicles, that is much simpler. Thank you all for pointing me in the right direction.
"most" MUs are, but there's still several which aren't, as well as some engines (including dual-headed engines and engines including B-units). :P
I expect no problems with engines where the second parts directly follows the first part. The problem with MUs happens because I code them as dual-headed (so front and back of the train) and use var[0xC8] to determine the graphics. For 8/8 it goes fine, but for shorter vehicles it gets the wrong alignments.
juzza1 wrote:If you are going to fix some sprites, my suggestion would be to re-arrange the sprites like this:
...
Of course this is a lot of boring grunt work graphics-wise.
I was thinking about arranging them like this:
Oslo T1000, modified
Oslo T1000, modified
Norway_Oslo_T1000.png (3.63 KiB) Viewed 1588 times
The graphics keep the same order as the other 8/8 MUs and doesn't need additional code. Only the location in the blue boxes are changed. I think that is less work than the re-arrangement you propose.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

juzza1
Engineer
Engineer
Posts: 95
Joined: 22 Oct 2004 19:27

Re: [OTTD] 2cc TrainsInNML

Post by juzza1 »

Transportman wrote:The graphics keep the same order as the other 8/8 MUs and doesn't need additional code. Only the location in the blue boxes are changed. I think that is less work than the re-arrangement you propose.
That would work too. Only thing is it makes the templating system slightly harder to remember for the artists (moot point with this set, as it's already drawn?)

Additionally, I didn't notice the sprite order in the original Oslo T1000 was already flipped. Edited my earlier "analysis" to reflect this.

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman »

juzza1 wrote:
Transportman wrote:The graphics keep the same order as the other 8/8 MUs and doesn't need additional code. Only the location in the blue boxes are changed. I think that is less work than the re-arrangement you propose.
That would work too. Only thing is it makes the templating system slightly harder to remember for the artists (moot point with this set, as it's already drawn?)
It is already drawn, and if new vehicles are included at some point, it can always be considered to use a simpler template (from the artist's point of view) for those new vehicles.
Additionally, I didn't notice the sprite order in the original Oslo T1000 was already flipped. Edited my earlier "analysis" to reflect this.
The Oslo T1000 and MX3000 had the right alignment but the wrong order, so I fixed that and the sprites now have the same order as the other vehicles.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
Voyager One
Tycoon
Tycoon
Posts: 11175
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One »

From all this, it seems we've (read: mostly me) made quite a mess... :P

So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
Leon

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

Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot], rotterdxm and 10 guests