Inconsistent catchment areas?

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
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Inconsistent catchment areas?

Post by PhilSophus »

I had recently a look at the functions MoveGoodsToStation (which determines to which station passengers and cargo are moved) and UpdateStationAcceptance (which determines the acceptance of a station based on the surrounding houses and industries).

To my understanding, the catchment area of the station is different for arriving cargo and departing cargo. Please have a look at the attached image for illustration: Both bus stops are the same station (built with the distant-join-station patch). The acceptance is obviously determined by the bounding box of the station plus catchment radius (the brown area). However, passengers are only transfered to the station in the catchment area of each station tile (the area marked with owner signs).

In the depicted situation this leads to the station accepting passengers but never producing some, which seams quite inconsistent to me. (Until now, I falsely assumed the relevant area was the bounding rectangle in both cases.)

Is there a reason for this inconsistency? I would consider the variant in MoveGoodsToStation (only taking the catchment areas of real station tiles) the more logical one and as the code is already there, being more complicated does not seam to be an argument. Or do I miss something?

If there is demand (and no argument against it), I could prepare a patch to change the acceptance (and move to industry) area.
Attachments
Catchment.png
Catchment.png (131.9 KiB) Viewed 528 times
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

that's due to the "incorrect" catchement area of the original game
the catchement area uses only 2 vertices to work, and is always a rectangle
you already spot the shown catchement areas, which sould be the correct, and you spotted the fake catchement area too, which is the bare land

i and frostregen abandoned the "show catchement areas" patch due to this problem, which none of us wanted to fix
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Post by PhilSophus »

Wolf01 wrote:i and frostregen abandoned the "show catchement areas" patch due to this problem, which none of us wanted to fix
That's funny. I was just thinking about such a patch, which is why I noticed the problem. But unless I miss something it does not seam so complicated to fix the problem. And if some people really want the original behavior one could make a patch setting.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

A good way to have this problem solved is to have the following patch setting:
- the station coverage is only the blue area given by the station - for both accepted cargo and produced cargo (the bought land on the screenshot)
- the station coverage is the rectangle(square) area determined by the 2 most distant tiles of the station - for both accepted cargo and produced cargo.
(the demolished land on the screenshot)
This way we have consistency for produced and accepted cargo. Plus we can build 64x64 stations which cover the whole area inside them very easy.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
User avatar
antichaos
Engineer
Engineer
Posts: 42
Joined: 13 Feb 2007 21:51
Location: UK

Post by antichaos »

I've also spent some time with this code recently, doing a rewrite of DeliverGoodsToIndustry which can share cargo between multiple industries weighted according to the number of each industry's tiles in the stations catchment area. The area I used is the one defined in UpdateStationAcceptance, which is the bounding rectangle.

I like the idea of using the more realistic area from MoveGoodsToStation, but the code there doesn't actually give you the full catchment area of the station - only of the tiles that are within a certain radius of the producer.

Since we are now using c++, I'd suggest setting up a linked list of the tiles in the catchment area which is stored in the station struct and could be accessed by all the functions that reference the catchment area.

The other problem is that the tile highlighting routine isn't able to handle anything other than points, lines or rectangles, so we'd need to rewrite UpdateTileSelection in viewport.cpp. I still haven't quite figured out how and where the place_mode is controlled though.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 15 guests