[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
18
15%
Multiple regions (but not all) enabled
36
30%
All regions enabled
68
56%
 
Total votes: 122

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5391
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by PikkaBird » 31 Jan 2014 12:30

Voyager One wrote:So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
FWIW, these days I use the same offsets for long vehicles as for short vehicles, and just shorten the sprites from the back. It's much simpler than having different templates and offsets for each length!

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 31 Jan 2014 12:57

Voyager One wrote: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?
I'll need to check how I want to have them realigned, before I let you do something that should then be done different again.
PikkaBird wrote:
Voyager One wrote:So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
FWIW, these days I use the same offsets for long vehicles as for short vehicles, and just shorten the sprites from the back. It's much simpler than having different templates and offsets for each length!
How do you mean? You have one template with code, and just move the sprites inside their graphics file? That is also what we are trying to get here.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

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

Re: [OTTD] 2cc TrainsInNML

Post by andythenorth » 31 Jan 2014 13:09

Spritesheet layouts are such a PITA. I'm half considering writing code to deal with them.

Assuming there's a gap between each blue box (and that all the angles are consistent), it wouldn't be hard to detect the blue box, then crop inside it to the extent of the vehicle, then reposition it to a correct location point, using the lower part of the vehicle as a baseline. There would be some error rate on edge cases, but not that high I think.

I could probably figure this out with a bit of time. Meanwhile Eddi could likely do it in no time whilst standing on his head with one hand tied behind his back. Not that I'm volunteering him...

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

Re: [OTTD] 2cc TrainsInNML

Post by Purno » 31 Jan 2014 13:17

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?)
No moot point there. The 2ccSet has been expanded a few times in the past, and it's set up in a way that allows for many more expansions. There's not really a limit here, just need someone to draw the sprites and someone to edit the code :P
andythenorth wrote:Spritesheet layouts are such a PITA. I'm half considering writing code to deal with them.
Sounds like a useful tool. Would a bow-emoticon convince you to give it a try? :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."

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

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 31 Jan 2014 16:06

Voyager One wrote: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?
I think the largest mess comes from my part, as I code MUs different than the old set. The old set used the last MU-wagon in a chain as back and not reversed, but I make it a dual-headed engine and set the graphics using var[0xC8] (and thus a reversed part), resulting in the problems.

Regarding realignment: For front engines, tenders, articulated parts and carriages the alignment is like you described here, for the reversed parts like the back of MUs I want it different:
#1: Bottom
#2: Bottom left
#3: Bottom left
#4: Bottom left + 1px up for each 1/8 shorter train
#5: Top
#6: Bottom right + 1 px up for each 1/8 shorter train
#7: Bottom right
#8: Bottom right

Attached is the Greece Thessaloniki to demonstrate it, it is a 6/8 vehicle.
Greece Thessaloniki 2014 to demonstrate alignments. It's an 6/8 vehicle
Greece Thessaloniki 2014 to demonstrate alignments. It's an 6/8 vehicle
Greece_Thessaloniki_2014.png (7.21 KiB) Viewed 2355 times
Before you start spitting through all your sprites, I'll correct them for all metros to test if those alignments are really correct and I've not made a mistake.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5391
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by PikkaBird » 31 Jan 2014 16:50

Transportman wrote:How do you mean? You have one template with code, and just move the sprites inside their graphics file? That is also what we are trying to get here.
Yeah, basically like this:
The shortened tender is drawn on the same template and uses the same offsets, it's just shortened from the back.
The shortened tender is drawn on the same template and uses the same offsets, it's just shortened from the back.
atlantic.png (1.95 KiB) Viewed 2339 times

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 31 Jan 2014 17:35

Transportman wrote:... realignment...
I understand. I'll prepare for eventual work by browsing trough all MUs and single out all those shorter than 8/8. Just to be prepared if you require realignments.

BTW, you don't require the rear engine to be reversed any more, do you?



EDIT: OK, done. I have 5 MUs shorter than 8/8 - AGV, AGV Duplex, Eurostar, M131 and S-to IV. However... AGVs and the Eurostar are "special" cases, these will certainly need a separate coding process... (AGV as example below)...
Attachments
Alstom AGV.PNG
Alstom AGV.PNG (16.16 KiB) Viewed 2322 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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 31 Jan 2014 18:30

Voyager One wrote:
Transportman wrote:... realignment...
I understand. I'll prepare for eventual work by browsing trough all MUs and single out all those shorter than 8/8. Just to be prepared if you require realignments.

BTW, you don't require the rear engine to be reversed any more, do you?
Indeed, they don't need to be reversed. That is all taken care of on the code side.
EDIT: OK, done. I have 5 MUs shorter than 8/8 - AGV, AGV Duplex, Eurostar, M131 and S-to IV. However... AGVs and the Eurostar are "special" cases, these will certainly need a separate coding process... (AGV as example below)...
Only 5 MUs, that is manageable. Are those only the MUs that you have drawn, or all MUs?

Also good to know that those are "special" cases, I already noticed that there would be some when I was browsing through the sprites.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 31 Jan 2014 19:54

Transportman wrote:Only 5 MUs, that is manageable. Are those only the MUs that you have drawn, or all MUs?
Only mine but (not intention to brag at all) almost 90% of the vehicles in the set are my work so... :wink:
Transportman wrote:Also good to know that those are "special" cases, I already noticed that there would be some when I was browsing through the sprites.
Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car. Also, SOME MUs have additional wagons. The example is the Odakyu 10000 below, with additional coaches with pantographs. The idea is that most wagons DON'T have pantos but at least one does for sure and more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
Attachments
Odakyu_10000_Series_Romance.png
Odakyu_10000_Series_Romance.png (12.1 KiB) Viewed 2301 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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 01 Feb 2014 12:02

I just uploaded the changes with the re-arranged sprites as described here, I think this arrangement works, please test if they are correct.
Voyager One wrote:
Transportman wrote:Also good to know that those are "special" cases, I already noticed that there would be some when I was browsing through the sprites.
Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car. Also, SOME MUs have additional wagons. The example is the Odakyu 10000 below, with additional coaches with pantographs. The idea is that most wagons DON'T have pantos but at least one does for sure and more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
Okay, that is going to be a lot of fun to code correctly, and won't go as nicely with the script I have been using to code the metros, but I can still use that as a base and then manually modify what is needed.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5391
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: [OTTD] 2cc TrainsInNML

Post by PikkaBird » 01 Feb 2014 12:42

Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
Why random? Surely a regular pattern would be a better option?
Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.
For the sake of completeness, you should probably also include a sprite for a car which is both the second and the second-to-last (ie, the middle car of a three-car train), no? :)

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 01 Feb 2014 16:38

PikkaBird wrote:
Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
Why random? Surely a regular pattern would be a better option?
That was DJ's idea and I agreed with, however I don't mind making it differently.

PikkaBird wrote:
Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.
For the sake of completeness, you should probably also include a sprite for a car which is both the second and the second-to-last (ie, the middle car of a three-car train), no? :)
There already is that sprite. Take a look at the AGV picture I've posted just a few posts back, it has the "2nd & last pax wagon" and "2nd & last mail wagon".

... ah yes, the initial idea of this set is that all MUs can be refitted to mail/valuables/similar...
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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 01 Feb 2014 17:35

Voyager One wrote:
PikkaBird wrote:
Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
Why random? Surely a regular pattern would be a better option?
That was DJ's idea and I agreed with, however I don't mind making it differently.
There are several options there. Random (with one fixed), regular pattern, only powered wagons. I think a regular pattern would look best, or just one single panto.

PikkaBird wrote:
Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.
For the sake of completeness, you should probably also include a sprite for a car which is both the second and the second-to-last (ie, the middle car of a three-car train), no? :)
There already is that sprite. Take a look at the AGV picture I've posted just a few posts back, it has the "2nd & last pax wagon" and "2nd & last mail wagon".
I think PikkaBird meant a wagon that is graphically correct for trains that just have one wagon. Personally I don't think such a wagon is necessary, as the graphical error is very small and I think most people wouldn't notice it.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 01 Feb 2014 18:15

Transportman wrote:I think PikkaBird meant a wagon that is graphically correct for trains that just have one wagon. Personally I don't think such a wagon is necessary, as the graphical error is very small and I think most people wouldn't notice it.
A-ha, I understand. Well, if I see it right on the AGV example, it should be an easy job to do.

Something like this?
Attachments
Alstom AGV.PNG
Alstom AGV.PNG (17.74 KiB) Viewed 2196 times
Alstom AGV Duplex.PNG
(17.75 KiB) Downloaded 2 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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 02 Feb 2014 21:30

And that is another bunch of vehicles included. With the inclusion of the Diesel railbuses in r44, all railbuses* should now be in the set.
Voyager One wrote:
Transportman wrote:I think PikkaBird meant a wagon that is graphically correct for trains that just have one wagon. Personally I don't think such a wagon is necessary, as the graphical error is very small and I think most people wouldn't notice it.
A-ha, I understand. Well, if I see it right on the AGV example, it should be an easy job to do.

Something like this?
Indeed, something like that. The alignments for the vertical views looks different when I compare it with what I posted earlier, the first sprite in each row should be aligned to the top of the box and the fifth sprite to the bottom, instead of bottom and top.

*All railbuses included in this list.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 704
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... 15 years and counting!

Re: [OTTD] 2cc TrainsInNML

Post by Digitalfox » 03 Feb 2014 01:28

Transportman wrote:And that is another bunch of vehicles included. With the inclusion of the Diesel railbuses in r44, all railbuses* should now be in the set.
Awesome :bow:

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 03 Feb 2014 08:37

Transportman wrote:the first sprite in each row should be aligned to the top of the box and the fifth sprite to the bottom, instead of bottom and top.
A-ha, OK. Understood. :wink:
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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 03 Feb 2014 08:52

Voyager One wrote:
Transportman wrote:the first sprite in each row should be aligned to the top of the box and the fifth sprite to the bottom, instead of bottom and top.
A-ha, OK. Understood. :wink:
Except for trains with a shortened reversed last unit, there the alignments are different. So if there are MUs with a short nose, the back nose should have a different alignment. The rest should all have the alignment you described here. Might need to check all vehicles, had enough diesel railbuses that also were aligned differently.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

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

Re: [OTTD] 2cc TrainsInNML

Post by Voyager One » 03 Feb 2014 09:21

Transportman wrote:Might need to check all vehicles, had enough diesel railbuses that also were aligned differently.
In reality, MOST my engines have their 1st sprite aligned to the bottom and the 5th sprite aligned to the top. That was the variant agreed with DJ. Meaning I'll have to realign thousands of sprites, we didn't even talk wagons yet... :|
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: 2694
Joined: 22 Feb 2011 18:34

Re: [OTTD] 2cc TrainsInNML

Post by Transportman » 03 Feb 2014 09:30

Voyager One wrote:
Transportman wrote:Might need to check all vehicles, had enough diesel railbuses that also were aligned differently.
In reality, MOST my engines have their 1st sprite aligned to the bottom and the 5th sprite aligned to the top. That was the variant agreed with DJ. Meaning I'll have to realign thousands of sprites, we didn't even talk wagons yet... :|
So, some sprites are aligned 1st top and 5th bottom and other sprites the other way around? Do you have an estimate how many engines and wagons might be affected? If it is really a large number, I can look at using a different code template for those or we can split the work if it is a smaller (but still large) number.
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: No registered users and 4 guests