[UNIV] New Tram Tracks Development

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

User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

[UNIV] New Tram Tracks Development

Post by FooBar »

New Tram Tracks for TTDP and OTTD
New Tram Tracks is a tramway replacement set featuring grass embedded off road tracks and single-sided wire supports for the overhead wires.

Downloads are available in the Release topic. Bugs and requests should also go in that topic, not here.
Attachments
Screenshots
Screenshots
nwtrmtrk.png (117.93 KiB) Viewed 43616 times
NewTramTracks_v0.4.1.zip
New Tram Tracks version 0.4.1 (DOS/Win)
(648.39 KiB) Downloaded 11136 times
Last edited by FooBar on 10 Oct 2009 17:37, edited 18 times in total.
RK
Transport Coordinator
Transport Coordinator
Posts: 264
Joined: 13 Oct 2003 10:43
Location: Dortmund, Germany

Re: Grass Tram Tracks [first release]

Post by RK »

FooBar wrote: - Maybe: poles for overhead wires between tracks: something like
This won't work without changing the programcode:
- You must use different poles for roads/non-roads
- You must change the sprite's 3D-Bounding-Box, because the poles in the foreground are over all vehicles and the poles in the background vice versa.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Re: Grass Tram Tracks [first release]

Post by OzTrans »

RK wrote: ... You must use different poles for roads/non-roads ...
So that is what those other sprites are for ... those that never get used anywhere. The same pole and wire sprites are used for tracks on road and off road. Here is proof ...
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Post by stevenh »

I'd imagine he meant that you can't really have the poles down the middle of the road... hence that you'd need poles on the outsides for on-road and poles down the middle for off-road?

Hence a reasonable code-change... but nothing massive; as long as you know assembler and feel up for a challenge :)
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

When making poles in the middle, I guess you'd get problems with roadvehicles incorrectly drawn over or under the poles.
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
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Post by FooBar »

Thanks guys. Poles in the middle is indeed not possible without changing the game itself. And I don't feel like doing that.

I have another idea now: single-sided poles
User avatar
Hertog-Dixi
Engineer
Engineer
Posts: 100
Joined: 20 May 2006 18:38
Location: The Hague, The Wetlands

Post by Hertog-Dixi »

FooBar wrote:single-sided poles
Thats my view every morning when i wake up :roll:
Overall Winner Screenshot Capture ContestImage
User avatar
m3henry
Tycoon
Tycoon
Posts: 1985
Joined: 15 Feb 2006 12:00
Location: Hampshire

Post by m3henry »

for the tracks to have grass in between you need to have the track sprites have the transparent blue inbeween
or mabeyt even have some off colour grass
The occasional look back at your past can teach you a great many things...
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Technical question ...

Looking at ttdpbase.grf, sprites 393 to 444 are the poles and wires for tram tracks. I have identified that sprites 393 ... 413 are used for tracks, same for on-road and off-road tracks. 414 ... 429 are the northern tunnel exists. And 433 ... 444 are for the bridges. Now where are sprites 422 ... 432 used ? Can we simply ignore them ?
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Post by FooBar »

@m3henry:
Transparent blue doesn't work, because off-road tram tracks are an overlay for road tiles. There's still road underneath! Using transparent inbetween tracks reveals the road. It's also exactly the first thing I tried making this set.

EDIT:
@OzTransLtd:
I quickly put a grf together, default sprites, but the sprite's number added to sprites 422-432. I don't see any numbers in the game, so my quick conclusion is that those sprites aren't used.
New question: why are those sprites unused?
Attachments
tramtrkw_test.grf
tramtrack sprite tester
(42.56 KiB) Downloaded 601 times
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Post by OzTrans »

FooBar wrote: .. I quickly put a grf together, default sprites, but the sprite's number added to sprites 422-432. I don't see any numbers in the game, so my quick conclusion is that those sprites aren't used. ...
That is what I did too. Having now all sprites accounted for, except 422 ... 432 and 384/385; I assume they were planned initially and then remained unused. So we may just ignore them.

Unfortunately, there are a few missing :

. Construction Cargo (truck) tram stop icon.
. Custom cargo tram stops.
. Track sprites for the NE/NW (door) tram depots, that would show in transparent mode.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Post by FooBar »

Too bad we have to ignore them. I need 'em for my new idea!

Sprite 393 is used as background-sprite in for all 'foregrounds' 394 to 400. Same for 401 and 402 to 405. This means that my idea doesn't work out (see image attached below).
The pole can't be in the middle of a tile without having it in the middle of the road in certain track combinations. That could be solved by sprites 394 to 400 having their 'own' background sprites (possibly the intended use of sprites 422-428), but that's just not how the game works right now.

Seems all my ideas are impossible. Pole between tracks, single-sided pole... What's next?
Attachments
problems.png
problems.png (4.28 KiB) Viewed 49587 times
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Yes, I know. I think we need to stick pretty close to the 'original' implementation, i.e. poles are placed where 2 tiles meet, but they can overlap each other exactly, thus reducing the number of poles in the forest.

If those (422...432) sprites are not used. It would be pretty simple to change one of them to be the counterpart of 393, for the NE-SW direction [patch support required though]. Then, you could do what you want, but you would need to place your single pole, where the tiles meet.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Steven? Care to expound on the uses of the various sprites?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Post by stevenh »

*digs up an old post*.... it's here somewhere...

Oh, here it is:
Image

I've no idea how up to date this is... and of course; all the offsets are wrong since this is from when it was in it's own tramtrkw.grf

I need to get home and decode the base GRF to tell you exactly how it's all laid out.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Post by FooBar »

If that's the actual situation, there's no problem at all. Anyhow, as far as I can tell, it's like in the images attached below.

First image is from ttdpbasew.grf.
Second image is form a testgrf I quickly put together. The numbers refer to ttdpbasew's sprite numbers. See for yourself
Attachments
ingame test
ingame test
tramtrkw_test.png (53 KiB) Viewed 1670 times
ttdpbasew.grf sprite relations
ttdpbasew.grf sprite relations
ttdpbasew.png (10.96 KiB) Viewed 49397 times
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Post by OzTrans »

stevenh wrote: ... sprite usage ...
May be that is how you intended it to work; we just discovered a little bug.

In my screenshot (further up) all those little yellow sprite numbers refer to the sprites actually used. #1 is #393 in ttdpbase or #37 in your sprite sheet. #1 is clearly used with every straight track including all intersections. This is also shown in FooBar's screenshot.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Post by Lakie »

The Tram draw code was orignially meant to be replaced by the newRoutes draw code...
So it was only temporary however with the delay in newRoutes it might need fixing, but at the end of the day, I believe Steven wanted Trams to become part of newRoutes in parts (such as drawing and store I guess).

(Correct me if I'm wrong though Steven),
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Post by stevenh »

Let us not talk of the future (of which you are spot on) and attempt to correct the past.

I hereby promise to have this issue corrected (and since the extra sprites still exist in ttdpbase [but aren't getting used]) to have those in use by the end of Sunday.

Code: Select all

var     tramfrontwiresprites,   db 0h, 37h, 37h, 3Fh, 37h, 37h, 43h, 37h, 37h, 3Fh, 37h, 37h, 3Fh, 37h, 37h, 37h
var     trambackpolesprites,    db 0h, 38h, 39h, 40h, 38h, 38h, 43h, 3Eh, 39h, 41h, 39h, 3Ch, 42h, 3Bh, 3Dh, 3Ah
...it should be a simple change to:

Code: Select all

var     tramfrontwiresprites,   db 0h, 54h, 55h, 5Bh, 54h, 54h, 5Eh, 5Ah, 55h, 5Ch, 55h, 58h, 5Dh, 57h, 59h, 56h
var     trambackpolesprites,    db 0h, 38h, 39h, 40h, 38h, 38h, 43h, 3Eh, 39h, 41h, 39h, 3Ch, 42h, 3Bh, 3Dh, 3Ah

...heh.... it seems that I definately use sprite 37h for each one (see my original post for the numbering.) This should be pretty straight-forward then... I just need to renumber that top line (and even funnier is that the variable names are backwards... but that's minor.)
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Post by OzTrans »

stevenh wrote:I hereby promise to have this issue corrected (and since the extra sprites still exist in ttdpbase [but aren't getting used]) to have those in use by the end of Sunday.
Thank you, we shall wait patiently ...

@OpenTTD Developers : Now, the same occurs in OpenTTD, could we have that corrected there as well ?
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 11 guests