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!Voyager One wrote:So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
[OTTD] 2cc TrainsInNML
Moderator: Graphics Moderators
Re: [OTTD] 2cc TrainsInNML
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.Voyager One wrote:From all this, it seems we've (read: mostly me) made quite a mess...![]()
So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
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.PikkaBird wrote: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!Voyager One wrote:So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- andythenorth
- Tycoon
- Posts: 5705
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: [OTTD] 2cc TrainsInNML
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...
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...
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: [OTTD] 2cc TrainsInNML
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 codejuzza1 wrote: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?)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.

Sounds like a useful tool. Would a bow-emoticon convince you to give it a try?andythenorth wrote:Spritesheet layouts are such a PITA. I'm half considering writing code to deal with them.

Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.

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."
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."
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.Voyager One wrote:From all this, it seems we've (read: mostly me) made quite a mess...![]()
So, what can I do to help? How do you want them realigned? What offset should be for shorter engines?
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. 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
Re: [OTTD] 2cc TrainsInNML
Yeah, basically like this: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.
- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
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.Transportman wrote:... realignment...
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 (16.16 KiB) Viewed 11620 times
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
Indeed, they don't need to be reversed. That is all taken care of on the code side.Voyager One wrote: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.Transportman wrote:... realignment...
BTW, you don't require the rear engine to be reversed any more, do you?
Only 5 MUs, that is manageable. Are those only the MUs that you have drawn, or all MUs?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)...
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
- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
Only mine but (not intention to brag at all) almost 90% of the vehicles in the set are my work so...Transportman wrote:Only 5 MUs, that is manageable. Are those only the MUs that you have drawn, or all MUs?

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%).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.
- Attachments
-
- Odakyu_10000_Series_Romance.png (12.1 KiB) Viewed 11599 times
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
I just uploaded the changes with the re-arranged sprites as described here, I think this arrangement works, please test if they are correct.
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.Voyager One wrote: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%).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.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Re: [OTTD] 2cc TrainsInNML
Why random? Surely a regular pattern would be a better option?Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
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?Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.

- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
That was DJ's idea and I agreed with, however I don't mind making it differently.PikkaBird wrote:Why random? Surely a regular pattern would be a better option?Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
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".PikkaBird wrote: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?Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.
... ah yes, the initial idea of this set is that all MUs can be refitted to mail/valuables/similar...
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.Voyager One wrote:That was DJ's idea and I agreed with, however I don't mind making it differently.PikkaBird wrote:Why random? Surely a regular pattern would be a better option?Voyager One wrote:more *could* have pantos but that is randomly determined (a VERY small chance, IIRC 5-10%).
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.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".PikkaBird wrote: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?Yes, the AGVs and the Eurostar have a special 2nd and second-to-last car.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
A-ha, I understand. Well, if I see it right on the AGV example, it should be an easy job to do.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.
Something like this?
- Attachments
-
- Alstom AGV.PNG (17.74 KiB) Viewed 11494 times
-
- Alstom AGV Duplex.PNG (17.75 KiB) Viewed 8275 times
-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.
*All railbuses included in this list.
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.Voyager One wrote:A-ha, I understand. Well, if I see it right on the AGV example, it should be an easy job to do.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.
Something like this?
*All railbuses included in this list.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- Digitalfox
- Chief Executive
- Posts: 710
- Joined: 28 Oct 2004 04:42
- Location: Catch the Fox if you can...
Re: [OTTD] 2cc TrainsInNML
AwesomeTransportman 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.

- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
A-ha, OK. Understood.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.

-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.Voyager One wrote:A-ha, OK. Understood.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.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: [OTTD] 2cc TrainsInNML
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...Transportman wrote:Might need to check all vehicles, had enough diesel railbuses that also were aligned differently.

-
- Tycoon
- Posts: 2792
- Joined: 22 Feb 2011 18:34
Re: [OTTD] 2cc TrainsInNML
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.Voyager One wrote: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...Transportman wrote: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
Who is online
Users browsing this forum: No registered users and 9 guests