Patch: Drive-Through Road Vehicle Stops

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

Post Reply
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

There is a new version of the Drive-Through Road Stops patch in the first post. As well is bringing the patch up to r6380, there are a couple of fixes and updates:
1. I found that, when I disabled connecting roads when building a drive-through stop, I also broke the build sound effect and the closing of the selection window. This has now been fixed.
2. Tidy-up of the code. This shouldn't change anything, but if you notice anything not working please let me know. ;)
Image
User avatar
Slace
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 15 Mar 2004 10:20

Post by Slace »

I found an issue with this patch, if you line up the stops end to end the buses only go to the 1st stop, then never go through to the next one.

say its like this:

Code: Select all

===BBB===
They stop at the 1st B, even if its already in use. But if its like this:

Code: Select all

=B=
=B=
=B=
the buses will go to the next available one.

Is this by-design?
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

yes, road vehicles always stop at the first bay (at difference of the trains which stop at the last tile of the first platform)
i found that is possible to imitate the trains behaviour: for example you have 4 bays in line, you put in orders
go to A load 10%
go to A load 10%
go to A load 20%
go to A load full load
and the RV will visit always the first bay, also the second, but doing so it will get loaded and doesn't wait so much at the first bays, but it waits for the full load at the last bay
doing so you waste order space, but you see a nice effect
i also noticed that if a vehicle is loading in a road stop it can't be overtaked by another vehicle which needs to pass throught the road stop but not stop and this make long queues sometimes
you can avoid this by placing the roadstop on a branch and then merge it again or use a depot so RV can service automatically after load and turn back
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Post by WWTBAM »

yep, vehicles should overtake and pass through vehicles that have overtaken to load. Thats how ttdp does it, and mart3p wanted it to be the same as ttdp's.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

Wolf01 wrote:yes, road vehicles always stop at the first bay (at difference of the trains which stop at the last tile of the first platform)
i found that is possible to imitate the trains behaviour: for example you have 4 bays in line, you put in orders
go to A load 10%
go to A load 10%
go to A load 20%
go to A load full load
and the RV will visit always the first bay, also the second, but doing so it will get loaded and doesn't wait so much at the first bays, but it waits for the full load at the last bay
doing so you waste order space, but you see a nice effect
(...)
But what if you don't want vehicles to load at the first bay? It takes a lot of time when vehicles need to stop multiple times (in your example, 4 times).
Isn't it possible to make a patch option which allows you to choose between either the current behaviour, or vehicles that will automatically choose the farthest free slot? Or maybe even that when they are waiting for a load, they will drive forward as far as possible.* I'm sure this will increase traffic flow, and it allows you to build more advanced bus/truck stations.


*For example, suppose you have two vehicles (set to full load) arriving at a (drive-through) loading bay, which has an amount of cargo waiting for one and a half vehicle capacity. The first vehicle will drive to the end (the first vehicle slot) and load, the second vehicle will take the slot just behind the first, and also load. When the first vehicle has finished loading and departs, the second vehicle will drive forward to the first slot and wait until new cargo arrives to be loaded (until it is full and departs).
For another example of this behaviour, head to your local bus station.
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

Sorry for not answering sooner, I've been away for a few days. :)
Slace wrote:I found an issue with this patch, if you line up the stops end to end the buses only go to the 1st stop, then never go through to the next one.
Yes, this is a known issue, due to the existing multistop code preferring the nearest stop unless it is full.
hertogjan wrote:Isn't it possible to make a patch option which allows you to choose between either the current behaviour, or vehicles that will automatically choose the farthest free slot?
This may be possible, I already have a few ideas... ;)
Image
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Oh dear - a man of few ideas ;)

LOL - funny how that makes it have the opposite meaning! :)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Nappe1
Traffic Manager
Traffic Manager
Posts: 175
Joined: 19 Jan 2004 17:25
Location: kotka or Savitaipale, Finland
Contact:

Post by Nappe1 »

mart3p wrote:Sorry for not answering sooner, I've been away for a few days. :)
Slace wrote:I found an issue with this patch, if you line up the stops end to end the buses only go to the 1st stop, then never go through to the next one.
Yes, this is a known issue, due to the existing multistop code preferring the nearest stop unless it is full.
hertogjan wrote:Isn't it possible to make a patch option which allows you to choose between either the current behaviour, or vehicles that will automatically choose the farthest free slot?
This may be possible, I already have a few ideas... ;)
talking about multistops, I got this crazy idea of new block called Loading area Entrace, that would be like gate to area where loading areas/bays are. Pathfinding would go like this: Loading done -> drive to loading area gate -> free the loading area slot that was used for loading unloading -> drive to next station loading area gate -> check for free loading area slot -> drive to free slot or wait for free slot -> loading / unloading ->...

I would be investigating this myself, but right now I am wayy too busy to do it... :(
I'll try to find some time to make illustration/image what I am trying to show.
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

You wait ages for one bus, then along comes a dozen. :lol:
Attachments
Muir & Co., 15th May 1943.png
Muir & Co., 15th May 1943.png (51 KiB) Viewed 5502 times
Last edited by White Rabbit on 19 Jul 2007 11:27, edited 2 times in total.
Image
SergeS
Traffic Manager
Traffic Manager
Posts: 147
Joined: 07 Jun 2003 19:46
Location: CZ / Prague
Contact:

Post by SergeS »

Patched - no errors ...compiled , started , and nothing changed ... ( patched after Passanger Destinations )
User avatar
Invisble
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 17 May 2005 15:06
Location: England
Contact:

Post by Invisble »

White Rabbit wrote:You wait ages for one bus, then along come a dozen. :lol:
I have had that as well, more common in large cities I find. It would be nice if there was some way to make all those lorries, and busses behind that are not stopping there overtake the still que of traffic (as long as the other direction was clear of course)
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

SergeS wrote:Patched - no errors ...compiled , started , and nothing changed ... ( patched after Passanger Destinations )
Well it works fine here. r6921 with destination-r6898.diff applied and then Drive_Thru_r6901.patch applied.
Attachments
Dobridge Transport, 14th Oct 2005.png
Dobridge Transport, 14th Oct 2005.png (51.16 KiB) Viewed 4930 times
Image
User avatar
Invisble
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 17 May 2005 15:06
Location: England
Contact:

Post by Invisble »

I was just thinking, I travel the busses A LOT in the UK, and it is rare to find a bus stop directly opposite another bus stop, instead they are normally offset from each other (this is to enable any vehicles stuck behind the bus to overtake it while it is sat at the stop).

So would it be possible to have offset or one side only bus stops? or is that far too much trouble to code?
SergeS
Traffic Manager
Traffic Manager
Posts: 147
Joined: 07 Jun 2003 19:46
Location: CZ / Prague
Contact:

Post by SergeS »

mart3p, Can you send a source please ?
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

Invisble: I intend to code some updates for drive-through road stops soon. I have some code working that allows drive-through stops to be built on existing roads for example. I will also have another look at the overtaking issues. I don't think it will be possible to have offset stops though, it seems to me this would need a drive-through stop 2 tiles long and that would be too much trouble to code.

SergeS: Sorry, I'm not sure what you're asking for. Are you asking me to send the entire source code with the patches applied? This would be no different from you downloading the latest source and applying the patches yourself.
Image
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

A new patch (against r7130) is available in the first post.

*** New Features *** :)

1.
It's now possible to build a drive-through road stop over an existing road. It must be a straight road with no side turnings and the player must own the road.

At the moment, if the road-stop is removed (with the dynamite tool) the road will be removed too. I am working on enabling the remove tool for road-stops, this will allow the stop to be removed but leave the road in place.

I am also working on allowing the building of drive-through stops over town-owned roads. This is proving more complicated though, as the road needs to revert to its original owner (the town) if the road stop is removed.

2. I have added a path-finder penalty for passing through a drive-through stop. This allows vehicles to find an alternative route, rather than being held-up by the traffic using the stop. This currently only works with YAPF. Note, this is not currently saved in the savegame to avoid a savegame version bump. The value of the penalty ([yapf] road_stop_penalty) can be adjusted in the config file if required.
Image
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

mart3p wrote:1.[/b] It's now possible to build a drive-through road stop over an existing road. It must be a straight road with no side turnings and the player must own the road.
i think that this can be shared with the rail stations to build stations over existing tracks, good work mart3p :D
At the moment, if the road-stop is removed (with the dynamite tool) the road will be removed too. I am working on enabling the remove tool for road-stops, this will allow the stop to be removed but leave the road in place.
i hope like newstations: dynamite remove all, bulldoze remove the roadstop but leave the road in place
Ghost_dk
Engineer
Engineer
Posts: 3
Joined: 13 Nov 2006 21:30

Post by Ghost_dk »

Just a question from a complete newbee. Will this work with the nightly downloads?
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

Wolf01 wrote:i hope like newstations: dynamite remove all, bulldoze remove the roadstop but leave the road in place
Yes that's what I'm trying to achieve. ;)
Ghost_dk wrote:Just a question from a complete newbee. Will this work with the nightly downloads?
The patch won't work directly with the nightly build. You need to download the latest source code, apply the patch, and then compile. If you can't do this, I suggest you try the MiniIN which has this patch included. You can download the latest MiniIN build here.
Image
Ghost_dk
Engineer
Engineer
Posts: 3
Joined: 13 Nov 2006 21:30

Post by Ghost_dk »

Thank you very much for your response. I think I'll go for the mini then :)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests