Tramroads for OTTD

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

How will you prevent crashes between trams and buses? Having signals all over the track will look bad and be quite annoying... Is it possible to let busses and trams just take care on each other, like it is in reallife when busses and trams are on the same track?
From the engines point of view, trams and busses are the same (they only differ in engine_type->misc_flag where bit 0 is set if it's a tram, like in ttdpatch). Roads/roads with tram rails/lightrails are handled like normal roads, too. The only problem I found so far is, that trams are still able to overtake busses *lol* Shouldn't be that hard to disable this behavior, so only busses (better to say, non-tram road vehicles) will be able to overtook other busses or trams.
As in cities with tramroads all catanery is fixed on the buildings walls they passes, there are only a few poles when there is needet. So I think it would be better the poles would disappear when buildings are near the tramroad.
Yes, the poles look ugly most of the time. And I would really prefer to disable drawing them when there are houses next to them. But (apart from the problem I'm still trying to understand how to draw the wires over the vehicles but not over the houses *lol*) to stay compatible with tramset grfs from (and for) ttdpatch, I can't just draw the wires, because their sprites are divided in front wires (with some sprites containing poles) and backpoles.

I began thinking about another solution for this optical issue. How about providing a grf where there are only poles at curves and junctions? Than we wouldn't have such an optical overhead.
Now, if we could just get mainline trains running on them...
You mean normal trains? Or articulated trams? (Articulated trams would be nice, but first all the tram stuff should work)
Do we have some diff for this?
After I cleaned up the code a bit (combining functions again I split up for tram/road issues, realizing that a simple "bool tram" would have been better *lol*) I'll post a new diff and the needed grf. But it isn't playable, yet. (No working tram stations, bridges, tunnels, ...)

Some minutes ago, I got busses and trams to decide correctly whether to enter a depot (normal road vehicles entering only road depot, trams only tram depots), but they still can be build in both depots.
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post by fabca2 »

Very very nice work,
Congratulation,

But I did no't understood why you posted two screenshots, they are so different :
second one has rounded corner, ugly poles (sorry), and more spaces between tracks.
does that means you took two different GRF ?
what picture will be the defintifive one ?
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

The second screenshot shows the sprites I separeted from the ttdpatch ones, they will (I think) be the standard ones. The first screenshot shows the standard gauge ones, you can simple load them as an additional grf and they will replace the standard ones.

So far loading grfs (whose are for ttdpatch) with tram sprites (tram rails, icons...) and grfs with tram vehicles works :)
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post by fabca2 »

Thank you for your answer,
good luck for the reminding part ;)
as you see, many people are waiting for you... :)

My wish is to see this feature to be merged into trunk soon... it's so cute ! (don't forget to makes tram a little bit faster and with a better capacity btw)

regards.
User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 181
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Re: Tramroads for OTTD

Post by BeSt-Com »

Valance wrote:P.S.: If I'm able to get the whole tram stuff working, are I allowed to use the sprites from ttdpatch and release them as a grf for ottd (I don't want to add all the sprites from ttdpbase, just the ones for tramroads)?
yes, you are allowed! The TTPatch Trams are drawn and codet by RK and me(Bernhard) ... i'm sure RK will give his permission too.
You can easily meet him here at TTDLXHQ
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

you should really really use the "svn diff" command instead of diffing yourself :)

Celestar
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7596
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Re: Tramroads for OTTD

Post by Born Acorn »

BeSt-Com wrote:
Valance wrote:P.S.: If I'm able to get the whole tram stuff working, are I allowed to use the sprites from ttdpatch and release them as a grf for ottd (I don't want to add all the sprites from ttdpbase, just the ones for tramroads)?
yes, you are allowed! The TTPatch Trams are drawn and codet by RK and me(Bernhard) ... i'm sure RK will give his permission too.
You can easily meet him here at TTDLXHQ
He was on about the track, not the trams themselves.

For the actual vehicles, we'd need fictional (if desired, naming scheme similar to current default vehicles. eg: "Ginzu Tram" or "Foster SuperTram MKII") Company colour trams, or only enable trams when there's a Tram GRF file instead.

Otherwise we'd get "why aren't the trams I ride on not in OpenTTD?" all the time.
Image
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

He was on about the track, not the trams themselves.
That's right. In ttdpatch the sprites are in the ttdpbase.grf, but for ottd we need the 113 tramtrack (tracks, poles, wires, icons, depots...) sprites in an extra grf.
For the actual vehicles, we'd need fictional (if desired, naming scheme similar to current default vehicles. eg: "Ginzu Tram" or "Foster SuperTram MKII") Company colour trams, or only enable trams when there's a Tram GRF file instead.

Otherwise we'd get "why aren't the trams I ride on not in OpenTTD?" all the time.
If somebody would provide a grf (sprites, names, sounds) for standard fictional trams to include with a tram supporting ottd, it wouldn't be that bad :)

My idea is, at the moment: the menu for building tramtracks will be disabled when there are a) no tram vehicles at all available or b) no tram vehicles available in the current game year.

Someone installing the patched ottd will only get tram vehicles (and the possibility to build tramtracks) when he/she installs a grf with trams in it. Not like in ttdpatch, where I'm able to build tramtracks but haven't trams at all, because I didn't install a grf with trams. (Or are there tram vehicles and I didn't play long enough to get them?)

The trams in my screenshots are from the german tramset, as it would be hard to test all the tram stuff without having tram vehicles *lol* Haven't tested other tram vehicle grfs, but they should all work as long as they aren't coded to check for ttdpatch.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

The logic with menu item must be same as for monorail and maglev tracks.
Image
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7596
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

The best people to go to on Company Coloured vehicles are PikkaBird, DanMacK and uzurpator.
Image
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

Ok, before my further experimenting will break something ;) here is a diff of current development state. The drive-thru-roadstop patch is included in this diff, later I'll try to not include it with my diffs, as it's not my code. But as for now, it should be ok, I hope. tramroads.grf is NOT a NewGRF file, just copy it in your data directory.

For tram vehicles: e.g. http://www.tt-forums.net/viewtopic.php?t=15496
For standard gauge tracks: http://grfcrawler.tt-forums.net/details ... ils&id=151

Be warned, my coding style is very chaotic and unorganized *lol*

Edit: You'll need the grf from http://www.tt-forums.net/viewtopic.php?t=26252
Attachments
tramroads.grf
(41.03 KiB) Downloaded 529 times
tramroads.diff
(76.59 KiB) Downloaded 434 times
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

I've tried kwrite, kdevelop, eclipse and all that stuff, and ended up wth vim :)

some things that might need consideration:
1) Maybe depots should/might want to be tram only and bus/truck only.
2) I cannot remove trams using the normal clear command for some reason?
3) Maybe the code shouldn't be mixed with the drive-through-roadstops, but then again, maybe it is crucial. I haven't had a time to look at the diff in detail.

Nice job, keep up the good work :)
Celestar
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

1) Maybe depots should/might want to be tram only and bus/truck only.
Worked the last 30 minutes on this issue, and now it seems to work :) Was easier than I thought. Busses and trucks only buildable in road depot, trams only in tram depot.
2) I cannot remove trams using the normal clear command for some reason?
It's on my todo list for further investigation. The road-only functions seem to handle single-roadbit and whole road removing. Now I must check, if to remove roadbits, trambits or whole roadtiles. It's a bit confusing right now, but I'll find it out :)
3) Maybe the code shouldn't be mixed with the drive-through-roadstops, but then again, maybe it is crucial. I haven't had a time to look at the diff in detail.
In my 24 years on earth (no, I'm not from mars *lol*) I've never seen a tram live :( Just in tv. But I can't imagine they will drive into a normal roadstop. Therefore (and because it's handled the same in ttdpatch) I think I'll let them only use drive-through-roadstops. It's my current goal to let trams drive into them, after three days coding I'd like to see the trams transporting passengers before I'll go to bed ;) But somehow they're ignoring them at the moment...

Oh, there comes another question into my mind... how about drive-through-truckstops? Should I let trams use them? (hm, funny imagination trams transporting iron ore *lol*) But if I let them only transport passengers, I would loose compatibility to ttdpatch grfs providing trams for cargo like post, goods, ...
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post by fabca2 »

Valance wrote:In my 24 years on earth (....) I've never seen a tram live
it won't help you, but http://www.youtube.com/watch?v=zMBYxlRnYXY
;)

by the way, can you post a bin file (win32) ?
I hope drive-through-roadstops patch will be merged into trunk soon, then you won't need to mixt you patchs with...
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

Valance wrote:... Therefore (and because it's handled the same in ttdpatch) I think I'll let them only use drive-through-roadstops...
It’s good to see you're making good use of my drive-through road stops. ;)
Valance wrote:Oh, there comes another question into my mind... how about drive-through-truckstops? Should I let trams use them? (hm, funny imagination trams transporting iron ore *lol*) But if I let them only transport passengers, I would loose compatibility to ttdpatch grfs providing trams for cargo like post, goods, ...
IMO you should allow trams to carry other cargos if the grfs already exist. The code is already there to ensure vehicles will only stop at the correct type of stop.
Image
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

Good news :)

Trams can now use bridges, tunnels and roadstops (as for now, every roadstop, not just drive-through ones, and there aren't drawn rails on tunnels, bridges and roadstops).

And because, every screenshot I posted was from temperate climate, here are arctic ones ;)

Now, I can't go to bed anymore... Am too excited *lol*
by the way, can you post a bin file (win32) ?
Sorry :( For beeing able to provide you with a win32 executable, I would need to install a cross-compiler. Haven't found time to do it yet. But perhaps one of the windows users here, could post one?
Attachments
Funtfingbourne Bridge Transport, 28. Aug 2001.png
Funtfingbourne Bridge Transport, 28. Aug 2001.png (103.59 KiB) Viewed 7358 times
Funtfingbourne Bridge Transport, 15. Feb 2001.png
Funtfingbourne Bridge Transport, 15. Feb 2001.png (139.09 KiB) Viewed 7357 times
tramroads_2.diff
(79.51 KiB) Downloaded 291 times
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 710
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can...

Post by Digitalfox »

Keep the good work Valance.. :D
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

N8king wrote: 2. Picture the poles appear very often and look very shiny, so thats looks ugly IMO.
As in cities with tramroads all catanery is fixed on the buildings walls they passes, there are only a few poles when there is needet. So I think it would be better the poles would disappear when buildings are near the tramroad.

N8king
Well, in 128x63 they wouldn't be ugly. For current tile size yes.
In my city they use their own poles for tram and trolleys. Support from nearby buildings was something common in the past, not now anymore.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

I have to say depite the realism, I hate the catenary because it cloggs any junctions or (in this case) the roads. It would be good to see it reduced somewhat like rail catenary. Is it do-able? :D
User avatar
Valance
Engineer
Engineer
Posts: 28
Joined: 06 Feb 2007 07:17

Post by Valance »

I have to say depite the realism, I hate the catenary because it cloggs any junctions or (in this case) the roads. It would be good to see it reduced somewhat like rail catenary. Is it do-able?
Sorry, it's not the purpose of this patch to provide other sprites than the original ones. It's up to the player to choose grfs they like. Just look (e.g. search forum) for a tramtrack spriteset you like :)

Ok, I've fixed the drawing of poles/wires at slopes and got the drive through bus stops to change their sprite according which type of road (normal, road + tramrails, lightrails) is connected to them. Don't know whether this behavior is wished. Or should I try to find a spare bit in station tiles to separate them into stops with/without rails like in ttdpatch?
Attachments
Letfingbridge Transport, 8. Aug 2001.png
Letfingbridge Transport, 8. Aug 2001.png (93.53 KiB) Viewed 7091 times
Letfingbridge Transport, 24. Apr 2001.png
Letfingbridge Transport, 24. Apr 2001.png (68.82 KiB) Viewed 7084 times
Locked

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests