Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Industry density settings are not granular enough #10339

Closed
CitrusWire opened this issue Jan 12, 2023 · 9 comments · Fixed by #10340
Closed

[Bug]: Industry density settings are not granular enough #10339

CitrusWire opened this issue Jan 12, 2023 · 9 comments · Fixed by #10340
Labels
enhancement Issue would be a good enhancement; we accept Pull Requests!

Comments

@CitrusWire
Copy link

Version of OpenTTD

12.0

Expected result

2000*2000 map, alpine, terragenesis. No industry GRF's

If I set "no of industries" to "Minimal", I get precisely 1 of each. Ok, so that's definitely minimal, I'd prefer some more than that.
I set it to "Very Low", and the map is absolutely littered with industries!

image

That isn't what I'd call a "very low" number, even for a 2k map: There's almost 100 coal mines there!

Set it to "Low" and I get over a 1200 industries on the map!

Set it to "Normal" and now I'm looking at almost 900 combined coal mines and farms. Probably 2400 industries total! The "Normal" map looks like this:
image
image

"High" tried to generate 5120 industries. How do I know? Because it took so long to generate them all the dialog was up on the screen for several seconds! But the map itself only has about 3500 - doesn't look like it could fit the rest on!

====

"Very Low" on 256 * 256 gets me 1 of each industry only though.
"Very Low" on 1k * 1k gets quite a lot of industries (though proportionally far less than 2k).
"Very Low" on 4k * 4k gets you 2500 industries!

=====

To me at least, "Very Low" on the larger maps is what I expect "High" to look like.

Actual result

As above

Steps to reproduce

As above

@James103
Copy link
Contributor

A setting to control precisely the number of industries that will attempt to generate already exists in JGRPP, with the "Custom" option in the industry density dropdown.

Alternatively, the industry density can be set to "Funding only" and a Game Script can be used to spawn industries during map generation and manage industries while the game is in progress.

@CitrusWire
Copy link
Author

Alternatively, the industry density can be set to "Funding only" and a Game Script can be used to spawn industries during map generation and manage industries while the game is in progress.

Thanks for the suggestion. I just tried the Industry Generation script - it's prone to crashing at generation time (doesn't seem to handle borders well), and even if it doesn't crash, it doesn't generate some industries at all (0 powerplants, or 0 coal mines) while generating about the right number (subjectively for me) of other industries.

I suppose my ideal would be to enter a custom number of industries (as can be done with towns) and the game would apportion them semi-randomly.

@FLHerne
Copy link
Contributor

FLHerne commented Jan 12, 2023

A 4k² map has 256x the area of a 256² map (16x bigger in each axis).

The number of industries seems proportionate, but that may not be ideal for gameplay.

In my experience, on 4k² maps, only a tiny proportion of industries are ever served even with many players.

@nielsmh
Copy link
Contributor

nielsmh commented Jan 12, 2023

Should the target number of industries be based on the sum of the map edge sizes instead of the product of them? Still divided by some factor, but at least not be proportional to the number of tiles.
Or even make the "number of industries" scale be an interpolation (perhaps non-linear) from sum-of-edges over to product-of-edges?

@PeterN
Copy link
Member

PeterN commented Jan 12, 2023

When scaling, there's also amount of water to consider. I opened #10063 as a draft to look at that.

@ldpl
Copy link
Contributor

ldpl commented Jan 12, 2023

In a way the settings works as advertised, the overall density of industries (as amount/map_area) stays the same regardless of the size. So this issue can be interpreted as feature request to change the meaning of that setting to somehow represent some kind of max local density so they don't clump as much.

But, as can clearly be seen even on the screenshot in this issue, water is not the only factor contributing to industry clumping. In general every industry type has its own funding limitations and should be adjusted separately. It makes no sense, for example, to scale amount of water-based industries by land size. Or border-only industries like oil refineries should be scaled by border area, i.e. edge size rather than map size to preserve the density.

So, in general defining some clear metric of local density can be quite tricky. Though it may be possible to do something based on average or min distance between industries, for example.

P.S. I actually find "high" density too low for my needs, so I patched my copy of the game to double it.

@2TallTyler 2TallTyler added the enhancement Issue would be a good enhancement; we accept Pull Requests! label Jan 12, 2023
@2TallTyler 2TallTyler changed the title [Bug]: Vast difference between number of industries generated [Bug]: Industry density settings are not granular enough Jan 12, 2023
@PikkaBird
Copy link

PikkaBird commented Jan 13, 2023

Perhaps "[average] number of industries per town" would be a more easily scaled and more user-friendly metric for custom industry count?

@LC-Zorg
Copy link

LC-Zorg commented Jan 13, 2023

Perhaps "[average] number of industries per town" would be a more easily scaled and more user-friendly metric for custom industry count?

Creating a dependency between two settings of different things would not be good. If you wanted to set a large number of cities and a small number of industries, the number of industries would still be high, because the number of cities is high. On the other hand, if you wanted to have a large number of enterprises but a small number of cities, again this would not be possible, because a small number of cities would define a small industry density.

IMHO the current algorithm is not bad. I don't think it's worth changing it. Adding a custom number option is perhaps the simplest and most effective solution because what is a low and what is a high depends on individual preferences and someone will always be dissatisfied. Alternatively, one more option could be added: very high, which would be the same as the current high, then low would be the same as the current very low, and the new value for the very low setting could be half of what it is now.

A side issue that goes a little beyond this report (I don't know if I should assume another issue), but that is worth noting, appiles to the minimal setting. It's ok for maps 1024x1024 and smaller, but on larger maps only one enterprise of each type becomes too small a value, often preventing you from starting the game. So I think it would be a good idea to set the minimum to 1 company for every 1024x1024.

@andythenorth
Copy link
Contributor

Tested with FIRS, where 41 Steeltown industries create problems with the original hard-coded industry numbers for 'low' etc.

On a 256x512 map, setting the industry number to 80 created roughly the expected number of industries for good gameplay, in ratios matching roughly what the probabilities in the grf are supposed to produce. Not that I'm trying to force a specific number on players, they can choose their own number if they want something different 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue would be a good enhancement; we accept Pull Requests!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants