[patch] drive-through depots

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
racetrack
Engineer
Engineer
Posts: 17
Joined: 27 Feb 2009 00:59
Location: Melbourne, Australia
Contact:

[patch] drive-through depots

Post by racetrack »

Here's a patch that adds drive-through depots, that is, depots that you can enter from both sides and drive through if the vehicle's orders permit. It works for both trains and road vehicles. It seems pretty stable and I'm keen to hear your thoughts.

Links to the patch and some videos here:

Drive-Through depots
Last edited by racetrack on 19 Mar 2009 12:24, edited 3 times in total.
racetrack, a coder.
today's special is drive-through depots
User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 708
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: [patch] drive-through depots

Post by JacobD88 »

racetrack wrote:Here's a patch that adds drive-through depots, that is, depots that you can enter from both sides and drive through if the train's orders permit. There's still a few things to sort out but its working enough for you to play with if you like.
Welcome to the forums :D

Huzah! :mrgreen: Just the thing I'm looking for to accompany the "bigger depots" GRF, would you be interested in joining me on the servicing-stations project?... https://www.tt-forums.net/viewtopic.php?f=36&t=40577

The thing i'm working on is more planned towards station like functionality and construction of depots, even using the station building interface, but if your up for it, it might be worth joining efforts?

The advantage of creating special "station" tiles to act as depots would also get around your bi-derectionality (drive-thru) question, and resolve any collisions between vehicles (if you construct the service-station correctly with signals et al)

I already have sprites too :D and am continuing work on a whole set of servicing/depot sprites and tiles to go with it all 8)

Image
above based on Snorbuckle's work 2005

Feel free to PM me if you like...

Have also added a link to your patch on my threads FP :wink:

Image
screenshot mock-up of "servicing-stations" also includes ISR set
Last edited by JacobD88 on 12 Mar 2009 21:36, edited 5 times in total.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [patch] drive-through depots

Post by CommanderZ »

racetrack wrote:Here's a patch that adds drive-through depots, that is, depots that you can enter from both sides and drive through if the train's orders permit. There's still a few things to sort out but its working enough for you to play with if you like.

Links to the patch and some videos here:

Drive-Through depots

--r.
Looks good. Will the pathfinder allow the trains to use the depot as a piece of track (with severe penalty maybe)?

BTW, Welcome to the tt-forums racetrack :)
Last edited by CommanderZ on 12 Mar 2009 21:44, edited 1 time in total.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: [patch] drive-through depots

Post by HackaLittleBit »

Looks promising

Hope you join forces with JacobD88.

Keep up the good work.

Regards HackaLittleBit
User avatar
racetrack
Engineer
Engineer
Posts: 17
Joined: 27 Feb 2009 00:59
Location: Melbourne, Australia
Contact:

Re: [patch] drive-through depots

Post by racetrack »

JacobD88 wrote:Huzah! :mrgreen: Just the thing I'm looking for to accompany the "bigger depots" GRF, would you be interested in joining me on the servicing-stations project?... http://www.tt-forums.net/viewtopic.php?f=36&t=40577

The thing i'm working on is more planned towards station like functionality and construction of depots, even using the station building interface, but if your up for it, it might be worth joining efforts?

The advantage of creating special "station" tiles to act as depots would also get around your bi-derectionality (drive-thru) question, and resolve any collisions between vehicles (if you construct the service-station correctly with signals et al)
I'm not uninterested, but I think my simple hack and your goals are actually quite different. By the sounds of it you're really looking at making stations that can do something other than load/unload cargo. Stations and depots are handled quite differently by the code, and while you could argue that stations and depots should be treated the same its going to be a much bigger patch (and thus much harder to get accepted into trunk).

I won't discuss it further here but I'll have a read through your thread and see if I can add anything. I'm certainly going to need something to do after finishing this patch; maybe that will be it :)
CommanderZ wrote:Will the pathfinder allow the trains to use the depot as a piece of track (with severe penalty maybe)?
I haven't tested it extensively, but I think the pathfinder is currently treating the depot as a block signal. I suppose it should have a configurable penalty, but I really don't know what would be appropriate. If I decide to make it so that trains can drive straight through without stopping (though presumably at reduced speed), then that would affect the cost again. Any ideas?
racetrack, a coder.
today's special is drive-through depots
User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 708
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: [patch] drive-through depots

Post by JacobD88 »

racetrack wrote:
JacobD88 wrote:Huzah! :mrgreen: Just the thing I'm looking for to accompany the "bigger depots" GRF, would you be interested in joining me on the servicing-stations project?... http://www.tt-forums.net/viewtopic.php?f=36&t=40577 ...
I'm not uninterested, but I think my simple hack and your goals are actually quite different. By the sounds of it you're really looking at making stations that can do something other than load/unload cargo. Stations and depots are handled quite differently by the code, and while you could argue that stations and depots should be treated the same its going to be a much bigger patch (and thus much harder to get accepted into trunk).

I won't discuss it further here but I'll have a read through your thread and see if I can add anything. I'm certainly going to need something to do after finishing this patch; maybe that will be it :)
Thanks for taking a look, i agree, the end goals are much more code intensive, but at least with your existing patch, upon completion, will still mean that the "build depot" function will not be rendered obsolete and it already accompanies the "bigger depot" GRF well as i have said.

As to patching in "servicing stations", i'm still trying to work out if a code re-write or massive addition is necessary, as both the station code and depot code already allow for the functions i require, so i am pondering over if and how it is possible to code in "bridges" for the code as necessary, for example, code the depot sprites as station tiles, then either create a GRF action and/or (hopefully smaller) patch bridge to tell the game engine that if these tiles are present to behave as a piece of station tile, but with the properties of a depot as and where appropriate

I re-iterate, i am still trying to work out if this is possible, but once you have finished this patch i would appreciate any help as im also trying to learn how to code as part of my project so my ability to spot how these things can be done is somewhat limited and noobish :wink:

Many thanks

Jacob
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: [patch] drive-through depots

Post by Ammler »

That looks awesome!

IMO, there is no need for special code for servicing station. Just make the bigger depot also available as station and you can make your big Service Stations, with a drive-though depot in the middle. :-)

Greets
Ammler
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: [patch] drive-through depots

Post by HackaLittleBit »

Agree with ammler.

Maybe restrict drive through depot to situation on photo (imagine depot in between the stations).
Why? The classic depot in ttd gave many many headaches to many many peoples.
Changing that could take away the charm of the game. be careful.
Although building a depot complex like JacobD88 is very nice.
So putting the drive though depot in between two stations plus a nice time penalty (CommanderZ) would be an option.
also you would avoid buttons and options etc because simply if the train enters the depot and sees next tile as station it automatically assumes drive trough depot.

Regards
Attachments
sds.png
sds.png (19.58 KiB) Viewed 19064 times
User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 708
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: [patch] drive-through depots

Post by JacobD88 »

Ammler wrote:IMO, there is no need for special code for servicing station. Just make the bigger depot also available as station and you can make your big Service Stations, with a drive-though depot in the middle. :-)
That's a good point, though it would require racetrack to make depots act as simply plain track tiles that trains could pass through without stopping and stop trains entering from both sides, otherwise you would end up with two trains entering one track of a "servicing station" and seemingly disappearing, something would have to be done to make racetracks depots aware of other trains on the track entering the depot.

This is probably the largest difference between what i envision with "servicing stations" and racetrack has already achieved in part, racetracks patch modifies the existing depots to be drive-thru, and maybe in future versions pass-thru, but with servicing stations i mostly want to achieve the ability to service engines at stations with these special tiles, not build them or remove them from the tracks at stations (and therefore render racetracks depot patch obsolete)...

In short "servicing stations" aims at allowing engines to have a "go to station xxx for servicing" command, upon which trains will simply move into a free station track, stop, and move off having been serviced, where-as racetracks work gives existing depots bi-directional entry and maybe pass-thru

Maybe one day servicing stations will also become suitable for building trains (as i mentioned this as a possibility on my thread sometime ago), but after some thought i would rather not render OTTD functions totally obsolete, dump all over racetracks patch, and force users to use "servicing stations" to build and service engines, one of the things i love about all TTO/TTD games is choice :) and it would be nice to offer users the option to build depots as normal, add racetracks features, and add to the existing depot system by allowing trains to be serviced at stations with "servicing stations" rather than force a user to use one of the above :mrgreen:
User avatar
SirXavius
Transport Coordinator
Transport Coordinator
Posts: 302
Joined: 28 Jun 2006 18:25
Location: Florida

Re: [patch] drive-through depots

Post by SirXavius »

I decree that this must be perfected. :bow:


Many have waited for a more realistic train depot, and now we have it. Not only have you got the thing to basic functionality, but you understand the problems that have to addressed. That's impressive. This is a fine example if an idea that was thought at one time, i'm sure, to never be implementable. Now someone has taken the time to study it, and code it. Excellent work!! :wink:

Ideally it would be great to have a realistic ONE-PIECE depot building (which jacob has created the sprite for), enter in one direction, and leave in this opposite side. Eventually i hope a train yard can serve as a depot, but that's for a future patch. Any train that enters the depot of course will be slowed considerably, and that can serve as the penalty for using a depot as a glorified waypoint.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: [patch] drive-through depots

Post by SirkoZ »

I went through the patch and saw the videos - there doesn't seem to be included or mentioned in the wiki for that matter that if the depot is of same length as a train, train will enter it with higher speed than ordinary depots (measely 61km/h).
This higher entering speed would trully differentiate these long depots from the ordinary depots with the so-called realistic acceleration ON.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: [patch] drive-through depots

Post by peter1138 »

Yeah, you're right there, I don't think, in real life, an engine would ever enter a depot at anywhere NEAR 61km/h. The limit should be much LOWER.
He's like, some kind of OpenTTD developer.
User avatar
racetrack
Engineer
Engineer
Posts: 17
Joined: 27 Feb 2009 00:59
Location: Melbourne, Australia
Contact:

Re: [patch] drive-through depots

Post by racetrack »

SirkoZ wrote:I went through the patch and saw the videos - there doesn't seem to be included or mentioned in the wiki for that matter that if the depot is of same length as a train, train will enter it with higher speed than ordinary depots (measely 61km/h).
This patch has nothing to do with long depots. Please study the above posts a little more closely; there's been some discussion about how the drive-through depot patch might be used with JacobD88's long depot/service station work, but thats not what this is.
racetrack, a coder.
today's special is drive-through depots
User avatar
racetrack
Engineer
Engineer
Posts: 17
Joined: 27 Feb 2009 00:59
Location: Melbourne, Australia
Contact:

Re: [patch] drive-through depots

Post by racetrack »

Just uploaded an updated patch that adds drive-through depots for road vehicles, and a new video showing it off.
racetrack, a coder.
today's special is drive-through depots
User avatar
Flavius
Tycoon
Tycoon
Posts: 1531
Joined: 22 Apr 2003 03:55
Location: Gold Coast, Queensland, Australia.

Re: [patch] drive-through depots

Post by Flavius »

Hi racetrack
Congratsulations on your new patch, simply stunning. Bravo :!:
Everyone will love this. :P

Methinks Depots need to have very low speed entry, eg 15mph; because it is a work area and safety would be paramount of course.
Ideal usage would be a dedicated side track with signals and one way traffic. :idea:
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: [patch] drive-through depots

Post by maquinista »

Rollo wrote:Hi racetrack
Congratsulations on your new patch, simply stunning. Bravo :!:
Everyone will love this. :P

Methinks Depots need to have very low speed entry, eg 15mph; because it is a work area and safety would be paramount of course.
Ideal usage would be a dedicated side track with signals and one way traffic. :idea:
I don't like this idea. It's more realistic, but It's too slow in the OpenTTD world.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
racetrack
Engineer
Engineer
Posts: 17
Joined: 27 Feb 2009 00:59
Location: Melbourne, Australia
Contact:

Re: [patch] drive-through depots

Post by racetrack »

maquinista wrote:
Rollo wrote:Methinks Depots need to have very low speed entry, eg 15mph; because it is a work area and safety would be paramount of course.
Ideal usage would be a dedicated side track with signals and one way traffic. :idea:
I don't like this idea. It's more realistic, but It's too slow in the OpenTTD world.
Don't worry, its nothing to do with this patch. If/when I implement non-stop for drive-through depots, it'll be at the depot speed limit. Any other change to depot limits will have to be done elsewhere, probably by someone else.
racetrack, a coder.
today's special is drive-through depots
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: [patch] drive-through depots

Post by SirkoZ »

peter1138 wrote:Yeah, you're right there, I don't think, in real life, an engine would ever enter a depot at anywhere NEAR 61km/h. The limit should be much LOWER.
Get this through your head, Mr. Caps:
How long does a day last in OpenTTD?

Now back to the topic.
racetrack wrote:
maquinista wrote:
Rollo wrote:Methinks Depots need to have very low speed entry, eg 15mph; because it is a work area and safety would be paramount of course.
Ideal usage would be a dedicated side track with signals and one way traffic. :idea:
I don't like this idea. It's more realistic, but It's too slow in the OpenTTD world.
Don't worry, its nothing to do with this patch. If/when I implement non-stop for drive-through depots, it'll be at the depot speed limit. Any other change to depot limits will have to be done elsewhere, probably by someone else.
Then it's back to good old single tile depots. Phew. :-)
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: [patch] drive-through depots

Post by peter1138 »

SirkoZ wrote:How long does a day last in OpenTTD?
2.2 seconds. It is not realistic. Therefore, changes from one arbitrary unrealistic speed to another arbitrary unrealistic speed, for the benefit of just one user, won't happen. Get that into your head.

How're the issues coming along, racetrack?
He's like, some kind of OpenTTD developer.
Forked
Engineer
Engineer
Posts: 43
Joined: 13 Jan 2008 20:36

Re: [patch] drive-through depots

Post by Forked »

This would be an excellent feature for those of us who build depots that try to be at least the same length as the trains running the track. :)

I noticed one slightly strange thing when doing a quick test now. (replicated without having any newgrf's loaded too).
When the train is coming back to the depots, it drives straight through depot 1 and instead enters depot 2. When coming out of depot 2 again towards the stations (through depot 1) it goes in to depot 1 and then exits it again before continuing.
dtd.png
dtd.png (85.49 KiB) Viewed 2267 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 35 guests