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

Autorenew fails for articulated vehicles with mixed cargo #6207

Closed
DorpsGek opened this issue Jan 15, 2015 · 10 comments
Closed

Autorenew fails for articulated vehicles with mixed cargo #6207

DorpsGek opened this issue Jan 15, 2015 · 10 comments
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers stale Stale issues

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jan 15, 2015

Summary of this topic

Current situation:

  • Exotic articulated vehicle (like in PKP set) can be refitted to carry different cargos at once (in different articualted parts).
  • Autorenew for these vehicles fails, since autorenew relies on build+refit, and there is no easy strategy for refitting this kind of vehicle.
  • Cloning uses a different strategy for adjusting cargos and works.

Task:

  • Change autorenew to do refits like cloning does.

Note:

  • This only applies to autorenew. Autoreplace with different vehicle is not possible.

TadeuszD opened the ticket and wrote:

The autorenew mechanism doesn't work correctly for articulated train vehicles, which can transport more than one cargo type.

Those vehicles can be defined via NewGRF addons. For example, the EMU contained 2 or more articulated parts, where:
- one part can be rebuilt to passengers/mail.
- rest of parts can transport only passengers,
Example train is properly supported in the Train refit window and the Train information window. All available cargoes are displayed. Player can refit mentioned train for transport only passengers or passengers+mail.

But autorenew mechanism works partially. When the train is refitted for transport only passengers, everything is OK. However, when the train is refitted for transport passengers+mail, autorenew process fails without any warning. The train is going very old and may lead to the collapse of the company.

It would be nice to add full support for multi-cargo vehicles in autorenew process.

Attachments

Reported version: 1.4.4
Operating system: All


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

Alberth wrote:

Silent autorenew failure sounds more like a bug than a feature request. It can be a bug in the newgrf though.
Can you provide instructions how to reproduce it, and what you result you find wrong?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6207#comment13712

@DorpsGek
Copy link
Member Author

frosch wrote:

It's implemented like that.
Autoreplace refuses to replace articulated vehicles which carry multiple cargos, because it is non-obvious what replacements should be allowed, and how they should be refitted.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6207#comment13714

@DorpsGek
Copy link
Member Author

frosch wrote:

Ah, I guess one can make it work for autorenew, by adding a special case that uses clone instead of build+refit.
Autoreplace won't work in any case though.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6207#comment13715

@DorpsGek
Copy link
Member Author

TadeuszD wrote:

Frosch is right. It's not a bug. It's implemented like that.

To reproduce described 'bug', you can use test version of my NewGRF. You can download it from https://dev.openttdcoop.org/attachments/download/6997/pkp-set-2.0.11.grf
NewGRF NML source is available in project repository:
https://dev.openttdcoop.org/projects/pkpset/repository/changes/src/engines/enxx-common.pnml
https://dev.openttdcoop.org/projects/pkpset/repository/changes/src/engines/en57.pnml

The EMU EN57 (available since 1957) can be refitted to carry passengers and mail.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6207#comment13716

@DorpsGek
Copy link
Member Author

TadeuszD wrote:

Small update. Polish PKP Set 2.0.11 is now available on BaNaNaS.
You can test mentioned bug using EMUs: EN57 (available since 1957) and EN71 (available since 1976).


This comment was imported from FlySpray: https://bugs.openttd.org/task/6207#comment13774

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Articulated labels Apr 7, 2018
@TrueBrain TrueBrain changed the title Silent autorenew failure (was Support for multi-cargo vehicles in autorenew process) Autorenew failures are silent Apr 13, 2018
@TrueBrain TrueBrain added good first issue Good for newcomers bug Something isn't working and removed bug from FlySpray labels Apr 13, 2018
@frosch123 frosch123 changed the title Autorenew failures are silent Autorenew fails for articulated vehicles with mixed cargo Apr 13, 2018
@andythenorth
Copy link
Contributor

Newgrfs shouldn't include articulated vehicles with mixed cargos, it's not supported. Thanks :)

I'm closing this as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun. Feel free to discuss in irc or request re-opening if you disagree. Thanks for contributing!

@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

andythenorth commented Oct 11, 2020

I disagree! :)

I confirmed that autoreplace does not work for the specific case of mixed mail + pax engines, which also do not offer player cargo refits.

That limited case seems reasonable to support?

Accepting that that the actual implementation might be TMWFTLB.

Or alternately to supporting this, the autoreplace GUI could not offer the articulated vehicle as a valid replacement option?

GRF attached. Test situation is

  • set game date to 1933 or so
  • articulated mixed vehicle 1 (autocoach 1900), pax + mail, no player refits
  • articulated mixed vehicle 2 (autocoach 1930), pax + mail, no player refits
  • vehicle 2 can be selected as replacement for vehicle 1 in autoreplace GUI
  • replacement will fail silently in depot when train visits
  • replacement will fail silently in depot if player uses 'force autoreplace' button

iron-horse-2.8.0-5-g1926053b.zip

Relevant LOC seems to be https://github.com/OpenTTD/OpenTTD/blob/master/src/autoreplace_cmd.cpp#L212

@andythenorth andythenorth reopened this Oct 11, 2020
@Eddi-z
Copy link
Contributor

Eddi-z commented Oct 11, 2020

i think the only way to reasonably solve this would be with template replacement.

glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 11, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 11, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 11, 2020
@2TallTyler
Copy link
Member

@JGRennison Did you fix this in #11253?

@JGRennison
Copy link
Contributor

@JGRennison Did you fix this in #11253?

Yes this should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers stale Stale issues
Projects
None yet
Development

No branches or pull requests

7 participants