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

Industries with randomised cargos don't display correctly on minimap #6367

Closed
DorpsGek opened this issue Aug 25, 2015 · 8 comments
Closed

Industries with randomised cargos don't display correctly on minimap #6367

DorpsGek opened this issue Aug 25, 2015 · 8 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

3iff opened the ticket and wrote:

Problem when an industry has randomised output products (Firs 143 for example)

A recycling plant can produce varied products (decided when the industry is built). Manufacturing supplies are the default while the secondary product can be building materials, scrap metal, farm supplies or chemicals.

The minimap will always show that industry type as providing scrap metal regardless of what the second product actually is.

Savegame with firs143 as the only grf, created with nightly 27325. Screenshot also supplied.
Discussed in "FIRS Industry Replacement Set - Development & Translations" page 190+

NML code as used in Firs143 (omitting irrelevent code)

/* Decide randomly on cargo output:
* First cargo is always MNSP, 2nd is randomly a choice of 4,
* 3rd cargo is not allowed nor defined */
random_switch (FEAT_INDUSTRIES, SELF, recycling_plant_random_output_cargo) {
1: return SCMT; // scrap metal
1: return RFPR; // chemicals
1: return BDMT; // building materials
1: return FMSP; // farm supplies
}

// industry code that specifies the 'default' products

    item(FEAT_INDUSTRIES, recycling_plant, 23) {
        property {
            accept_cargo_types: [RCYC];
            prod_cargo_types: [SCMT,MNSP];
            }
    }

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6367
@DorpsGek
Copy link
Member Author

Alberth wrote:

Somewhere around http://www.tt-forums.net/viewtopic.php?p=1154727# p1154727 starts the discussion.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14050

@DorpsGek
Copy link
Member Author

andythenorth wrote:

It's a bug in how newgrf authors are using the newgrf spec. There is no good gameplay reason to returning random results to the cb for setting accept/produce cargos.

Arguably the whole cb is redundant, there should be no need to change cargos when industry is constructed, even without randomisation.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14056

@DorpsGek
Copy link
Member Author

3iff wrote:

I've removed the randomising code from the SPI industry set so it will no longer be a problem for me.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14062

@DorpsGek
Copy link
Member Author

adf88 wrote:

"The minimap will always show that industry type as providing scrap metal" WHAT?! I don't understand. Since when minimap is related to any of cargoes?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14064

@DorpsGek
Copy link
Member Author

frosch wrote:

The cargochain view can be linked to the minimap. That way selecting a cargo in the cargochain view, will highlight industries producing/accepting that cargo. Just that this based on the static industry definition, instead of instance variables.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14065

@DorpsGek
Copy link
Member Author

adf88 wrote:

So... the industry chain is buggy.

For whatsoever reason the cb was added, it's meant to allow different cargoes then specified in prop 10. But the industry chain doesn't bother about the callback and rely on prop 10 only.

Second issue is that industry chain suggests that it is capable of displaying cargo-related minimap while there is no such feature*, "link to smallmap" shows something different.

* The minimap would be capable of displaying cargo-related view if industry cargoes would not be allowed to vary during a running game. It's not clearly forbidden by the NewGRF spec. It's neither forced e.g. CB could be called once per game per industry type, not once per industry.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14067

@DorpsGek
Copy link
Member Author

frosch wrote:

Yes the cargochain view is only an approximation for what is going on:
* Industries may have random cargos (this issue).
* There is no criterion whatsoever what houses/towns can accept or produce. The displays are only guesses.

The industry issue in the cargochain view can be solved by extending NewGRF specs to return all possible cargos, see for example https://wiki.openttd.org/Frosch/GRF_version_9# Callback_14B.2C_14C:_Input.2Foutput_cargos

Potentially conceptually easier (but still hard GUI-design-wise) may be to add a new legend to the industry smallmap, which allows selecting cargo types instead of industries, and then changing the cargochain<->smallmap link to pass cargos instead of industries in some cases. But well, the industry legend is usually already pretty huge.

The house issue is likely unsolveable, but likely also hardly used.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367#comment14069

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 5, 2017

andythenorth closed the ticket.

Reason for closing: Not a bug

The bug is in the newgrf spec, the randomised cargos cb is a mis-step, and should not be used imho. It's bad for players, AI, GS, in addition to minimap view.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6367

@DorpsGek DorpsGek closed this as completed Aug 5, 2017
@DorpsGek DorpsGek added NewIndustries flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant