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

Add: Allow autoreplace with same model vehicle #7729

Merged
merged 1 commit into from Feb 26, 2023

Conversation

nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Sep 8, 2019

This is not what #7525 asks for, but I think it's just as good, or better. Remove the old restriction on autoreplacing vehicles with the same model, but instead add a check so autoreplace with same model only ever occurs when the vehicle is nearing end of life.

@ldpl
Copy link
Contributor

ldpl commented Sep 8, 2019

There is actually a use for autoreplacing with same model before the end of life. Because of stupid cargo rating calculations it's sometimes beneficial to just autoreplace everything every few years.
Also makes me wonder if it's possible for newgrf to make a vehicle with such a short life that it will constantly autoreplace with this patch xD

@Eddi-z
Copy link
Contributor

Eddi-z commented Sep 8, 2019

i'd say we should rather change that rating calculation, like give the boost only to vehicles bought in the prototype phase

@nielsmh
Copy link
Contributor Author

nielsmh commented Sep 8, 2019

Or change it so the effect diminishes based on years from vehicle model introduction date.

@Eddi-z
Copy link
Contributor

Eddi-z commented Sep 8, 2019

... the details are open for discussion, but i think we should rather fix an exploit rather than design game mechanics to facilitate them.

@nielsmh
Copy link
Contributor Author

nielsmh commented Sep 8, 2019

Well I did a separate PR to fix that exploit then, #7730 :)

@LordAro
Copy link
Member

LordAro commented Oct 25, 2019

I feel like there's some helptext somewhere that could be expanded with this fact...

@nielsmh
Copy link
Contributor Author

nielsmh commented Dec 1, 2019

Also to clarify: This PR does not enable the above exploit. It protects against it by converting any "replace now" into "replace when old" when the replacement vehicle is the same model. Of course that doesn't prevent the player from manually doing a "replace all vehicles now" to a similar model once every year or two.

@nielsmh nielsmh added this to the 1.10.0 milestone Jan 12, 2020
@LordAro
Copy link
Member

LordAro commented Jan 12, 2020

Can you explain (again) why autoreplace with same engine (when old) is different/beneficial to autorenew? To me it just seems like adding a 2nd (confusing) way of doing the same thing

@nielsmh
Copy link
Contributor Author

nielsmh commented Jan 12, 2020

I see two advantages, one is that it might be easier to discover. It doesn't require digging around in the Settings UI. (I haven't been able to think of a good place to put the auto-renew option in the regular GUI.)
The other is that it more directly lets the player be selective about which vehicles they want to renew.

@sheepo99
Copy link

Agreed with @nielsmh. Autoreplace and autorenew should be same, since they do practically the same function that is replacing vehicles, whether it is a different one or the same. That one has to navigate into the settings menu to activate specifically autorenew is highly user unfriendly and confusing to new players alike.

@LordAro
Copy link
Member

LordAro commented Jan 13, 2020

So perhaps autorenew should be removed/deprecated/converted in favour of this?

@auge8472
Copy link
Contributor

Can you explain (again) why autoreplace with same engine (when old) is different/beneficial to autorenew? To me it just seems like adding a 2nd (confusing) way of doing the same thing

For me it is confusing not to be able to replace a vehicle with a new vehicle of the same type in the same way as replacing the vehicle with another one of a different type. There is technically no difference except for the type I want to replace the vehicle with. So the similar handling of both cases is IMHO an advantage.

So perhaps autorenew should be removed/deprecated/converted in favour of this?

There is a difference in the way the functions work. With "autorenew" all vehicles get replaced with the same type when they get old. For (classic) autoreplace you as the player have to take action. Maybe the functions are mergable so that one can set autorenew (or not) but can override it in the autoreplace-GUI.

@LordAro
Copy link
Member

LordAro commented Feb 6, 2020

I maintain that having both autorenew and autoreplace-the-same-vehicle is confusing, and only one or the other should exist

@nielsmh nielsmh removed this from the 1.10.0 milestone Feb 7, 2020
@nielsmh nielsmh changed the title Add #7525: Allow autoreplace with same model vehicle Add: Allow autoreplace with same model vehicle Feb 7, 2020
@frosch123
Copy link
Member

Suggestion:

  • Turn the engine_renew setting into a "default autoreplace selection" setting. That is, if enabled, the autoreplace GUI actually shows that each engine is replaced by itself when old.
  • The user can then explicitly change the replacement to "also when not old" or to "no replacement". Both choices would be stored as explicit user-choice in _enginerenew_pool.
    • Essentially: _enginerenew_pool stores whatever differs from default.
    • Changing the default during game does not immediately affect the _enginerenew_pool, so that toggling the setting twice does not change anything.
    • CmdSetAutoReplace removes entries from _enginerenew_pool, when the user selects a replacement matching the default setting.
  • The "replacement indicator" in the vehicle list would also have to change, and display "explicit autoreplace setting differs from default".

(Note, we did similar in the past, when global settings were turned into vehicle specific settings, like for sg_new_nonstop/new_nonstop or sg_full_load_any)

@giordy
Copy link

giordy commented Apr 17, 2020

This feature is very important, in my opinion. Imagine this scenario, which just happened in a game I'm playing:

  • money is very tight because of inflation, infrastructure maintenance, etc...
  • my company owns
    • 40 trucks model A
    • 50 trucks model B
    • 20 trains model T (very expensive)

Let's say that the 50 trucks model B work very well for me and I need to keep using them: "Model B" still has great reliability and just the cargo capacity that I need.

As it is now, I simply have no easy way to renew them because:

  1. if I enable auto-renew in the settings, the game will also replace trains and other vehicles (f.e. trucks model A) that I might not want to renew, right now or ever, because I might want to upgrade them to some newer model, dismiss the route entirely or because I might want to save the money for other things. Quite a few times a train being unexpectedly automatically renewed destroyed my finances.
  2. if I don't enable auto-renew, I'm forced to waste a lot of time in manually renewing 50 trucks by sending them to the depot and manually buying new ones, copying orders, etc... The job is even more tedious because I cannot even do it all at once since my finances are tight. Also tracking down all the vehicles is extremely tedious.

Please implement this.

@TrueBrain TrueBrain added candidate: needs considering This Pull Request needs more opinions size: small This Pull Request is small, and should be relative easy to process labels Dec 14, 2020
@andythenorth
Copy link
Contributor

I am very +1 to the suggestion frosch made in #7729 (comment)

And also to Aro's point that having both autoreplace and autorenew is just confusing.
#7729 (comment) I see this specific confusion frequently enough in community discussions that we might want to address it. I think unifying the autoreplace / autorenew concepts is a good simplification here.

@trexxet
Copy link

trexxet commented Jun 11, 2021

+1. I'm running bus model A for small towns, and bus model B for large cities. However, I don't want to use autorenew feature, because it will work for all my transport including trains - and I prefer to check each train when it gets old if it can use same locomotive or get a more/less powerful, if it should carry more/less cargo etc.

@Wahazar
Copy link

Wahazar commented Oct 21, 2021

Autoreplace old to the same model would be beneficial for games with hard economy settings.
Currently there is only on/off autorenew, while one may want to renew some vehicles while keep old ones waiting for better replacement in future, or just to spare money.

Besides this, autorenew is buried under expert options and default off, new users are confused why they can't replace old vehicle with same model, which is still available.

Of course, if same model is choosen to autoreplace, only "replace if old" option should be possible, to disallow cheats with station rating (eventually additional server setting to allow it).

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the adage "perfection is the enemy of progress" in mind, I'm going to approve this, but with the intent that at some point in the future gestures vaguely autorenew & autoreplace are merged into something with some sort of consistent UI

@rubidium42 rubidium42 merged commit 2fee8ec into OpenTTD:master Feb 26, 2023
PeterN added a commit to PeterN/OpenTTD that referenced this pull request Oct 6, 2023
…eplace window.

This breaks OpenTTD#7729 which specifically allows autoreplace of same engine types, and also did not work properly if the engine had been built during the current game session.
PeterN added a commit that referenced this pull request Oct 6, 2023
… window. (#11354)

This breaks #7729 which specifically allows autoreplace of same engine types, and also did not work properly if the engine had been built during the current game session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: needs considering This Pull Request needs more opinions size: small This Pull Request is small, and should be relative easy to process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet