Page 1 of 2

Multiple industries near a station.

Posted: 22 Nov 2021 04:37
by mauried
What happens when there are more than 1 industry near a station which both take the same commodities?
I built a furniture factory near a town which takes wood products and glass and makes goods, and started delivering both commodities to the industry via the nearby station.
All working fine , until another industry, in this case a construction industry gets built right next to the furniture factory.
The construction industry takes wood products and cement, but doesnt make anything.
Now all the wood products I deliver to the station go to the construction industry and none go to the furniture factory.
Is there some kind of priority which determines where commodities go where there are multiple industries which accept them ?
thanks

Re: Multiple industries near a station.

Posted: 22 Nov 2021 05:02
by Eddi
afair it all goes to the industry closest to the station sign

Re: Multiple industries near a station.

Posted: 22 Nov 2021 10:27
by _dp_
No, it went to the closest one before but in 1.9.0 there was a change that made cargo go to an effectively random industry within the catchment area.
There is a PR to bring the old behaviour back but so far there is no progress on it, you can support it here if you want: https://github.com/OpenTTD/OpenTTD/pull/9536

Re: Multiple industries near a station.

Posted: 22 Nov 2021 10:36
by Taschi
_dp_ wrote: 22 Nov 2021 10:27 No, it went to the closest one before but in 1.10.0 there was a change that made cargo go to an effectively random industry within the catchment area.
Is all cargo sent to one random industry, or does the randomization happen per unit of cargo?

Re: Multiple industries near a station.

Posted: 22 Nov 2021 10:39
by _dp_
Taschi wrote: 22 Nov 2021 10:36 Is all cargo sent to one random industry, or does the randomization happen per unit of cargo?
Technically, there is no randomization, it picks the industry with the lowest ID, so it all goes to the same one. I'm saying effectively random because there is no way to know which one gets it in the game.

Re: Multiple industries near a station.

Posted: 22 Nov 2021 11:01
by Wahazar
Honestly, it is even worse than previous behavior.

Re: Multiple industries near a station.

Posted: 22 Nov 2021 13:14
by LaChupacabra
If the recipient selection is based on enterprise ID, then from what I have noticed, these ID most likely start from the creation date, because always (I didn't notice any exception) the entire load is taken by the enterprise that was created first - this is a kind of advantageous feature of this change and I must admit that I was convinced all the time that this was a goal. :) This eliminates the problem related to the situation when a new enterprise appears on the map randomly or intentionally thanks to a malicious player, just closer to the label and takes the entire production. Now such a situation cannot occur, as it previously could. Unfortunately, the problem of not being able to choose a company when there are two or more enterprises within the range of stations is, however, more frequent and thus more troublesome.

The best option would therefore be to restore the previous behavior and prevent the founding of enterprises within the reach of stations other than your own.

Re: Multiple industries near a station.

Posted: 22 Nov 2021 13:57
by _dp_
ID (or as it called in OpenTTD code "index") != creation date. New industries can reuse indexes of the closed industries. So a new industry can still "steal" all the cargo and now you can't do anything about it except moving your whole station away from it. Previously you could just move your station sign.

Re: Multiple industries near a station.

Posted: 23 Nov 2021 03:39
by mauried
Thanks all, didnt realise this was such a complex issue.
Moved my station away and just hope no more industries appear near it.

Re: Multiple industries near a station.

Posted: 23 Nov 2021 05:15
by Captain Rand
The easiest fix would have been to enable the "Magic Bulldozer" and destroy the offending industry.
To prevent this happening again, fill the stations catchment area with objects, or simply buy the land.

Pete.

Re: Multiple industries near a station.

Posted: 23 Nov 2021 05:28
by odisseus
The first option that you suggest is impossible in multi-player games, and the second one is forbidden on many servers (and is poor style in general).

Re: Multiple industries near a station.

Posted: 24 Nov 2021 05:13
by Captain Rand
odisseus wrote: 23 Nov 2021 05:28 The first option that you suggest is impossible in multi-player games, and the second one is forbidden on many servers
The OP said nothing about playing multi-player games. Also I never do, or use servers.
odisseus wrote: 23 Nov 2021 05:28 (and is poor style in general).
"Style"? Who gives a toss about style?
Having this happen is just as irritating as an industry closing just as you've finished building a route to it. I don't play the game to get irritated, I play for fun.
You go play the game in your own "style" matey, and I'll play it in mine.

Pete.

Re: Multiple industries near a station.

Posted: 24 Nov 2021 10:22
by odisseus
Well, you have a point. Style doesn't matter when nobody else is going to see what you build.

But then again, single-player cheats can solve any and all gameplay problems in a trivial way. Bulldoze any industries that you don't need, and fund new ones wherever you want them to be. Increase your money by a few millions if you can't afford funding them, and increase still further so that you aren't bothered by profits and losses. Switch to a competing company to move their station out of the way, or blast their tracks to cripple their business altogether...

Re: Multiple industries near a station.

Posted: 26 Nov 2021 00:05
by mauried
Would it be possible to partially solve this problem by simply equally splitting the incoming cargoes between the available accepting industries.
At least this way the industry chain of production keeps going, just a bit slower.

Re: Multiple industries near a station.

Posted: 26 Nov 2021 02:44
by Eddi
while this is certainly possible, it's by far not simple

"find an eligible industry, then deliver cargo to it" is a very different task to "find all eligible industries, find some space to remember an arbitrary number of industries. collect all cargoes, split the cargo into equal parts, deliver the cargo"

Re: Multiple industries near a station.

Posted: 26 Nov 2021 12:39
by jfs
It seems like it should be possible to distribute arriving cargo to all accepting industries in range, but it's true it will be more complex.

I imagine you'd need to make it an iterative process:
1. Find all industries in range accepting the cargo
2. Divide the available cargo evenly among the accepting industries
2.a. Find a way to handle uneven distribution so which industries get more/less is determined by tick number or similar
3. Attempt to deliver each portion of cargo to the industries and let them produce
4. If some industries deny some or all of the cargo offered, put it back into the pool
5. If all cargo has been delivered, stop
6. Remove all industries that didn't accept the full amount offered from the list of accepting industries built in step 1
7. If there is still undelivered cargo left in the pool, and industries left in the list, repeat from step 2
8. There are no accepting industries left, but still cargo in the pool: Find all accepting houses and company headquarters in range and deliver to those
9. If there are no other accepting tiles in range and there is still cargo in the pool: Return the cargo to as unable to unload (either leaving it in the vehicle, or turning it into en-route cargo on the station in the case of forced unload)

Re: Multiple industries near a station.

Posted: 26 Nov 2021 21:23
by mauried
Ok, that does seem a difficult issue to solve.
How about something a bit simpler such as a minimum distance between industries, so that the probability of 2 or more industries falling into a single stations coverage area is reduced.
This issue only really occurs when multiple industries are in a town, as trying to relocate your stations to avoid a common coverage area of the multiple industries is a lot harder as the town authority often wont let you build more stations .
The number of industries which can only be built in towns is small relative to the total industries that can be built , so the spacing limitation would not need to apply to them all.
Under the current system where a single industry takes all the incoming commodities, what happens when it no longer wants more??
Does the original industry then start again receiving the incoming commodities.

Re: Multiple industries near a station.

Posted: 26 Nov 2021 22:00
by Taschi
mauried wrote: 26 Nov 2021 21:23 How about something a bit simpler such as a minimum distance between industries, so that the probability of 2 or more industries falling into a single stations coverage area is reduced.
Given that stations can have pretty large catchment areas even with the default settings, that would make for really boring maps with really few industries.

Re: Multiple industries near a station.

Posted: 27 Nov 2021 05:51
by odisseus
Industry clutter is a real problem with ECS and Steeltown sets. Sometimes the town is completely choked on all sides and cannot grow at all.

Re: Multiple industries near a station.

Posted: 27 Nov 2021 06:38
by Taschi
odisseus wrote: 27 Nov 2021 05:51 Industry clutter is a real problem with ECS and Steeltown sets. Sometimes the town is completely choked on all sides and cannot grow at all.
But that's a very different issue from how the distribution of cargo works. Your problem could be avoided by enforcing a two- or three-tile wide gap between industries, but that would be entirely useless for avoiding multiple industries within the catchment area of a station. That would require something in the order of magnitude of a 20-tile gap, even with default settings.

To me, it feels naturalistic that sometimes industries just cluster sometimes - to enforce a huge distance between them would make maps feel far too uniform for my taste. And that's especially important with heavy industries (like the iron/steel industry), which were/are usually very heavily concentrated in relatively small regions in real life.