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

Feature: let AI developers edit non-editable AI/Game Script Parameters #8895

Merged
merged 1 commit into from Nov 8, 2022

Conversation

perezdidac
Copy link
Contributor

Motivation / Problem

There is no way to modify non-editable AI/Game Script params during the game or during the scenario editor.

Description

This code change makes non-editable AI/Game Script params editable during the game or during the scenario editor if ai_developer_tools is set to true in the config file. This will help AI developers and other developers being able to change the params they created in those cases.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@perezdidac perezdidac marked this pull request as ready for review March 26, 2021 22:34
@SamuXarick
Copy link
Contributor

If I want to make a setting editable, I would set it so, by using the flag CONFIG_INGAME.
https://docs.openttd.org/ai-api/classAIInfo.html#a5c8349ebc14ec2c4b63187780c33f5b9

Besides, there can be valid reasons to lock some parameters from being editable. Preventing undesired side-effects that could occur from that comes to mind.

2TallTyler
2TallTyler previously approved these changes Nov 8, 2022
Copy link
Member

@2TallTyler 2TallTyler left a comment

Choose a reason for hiding this comment

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

From a Discord discussion with @Arastais about this PR:

I think the problem is very real in terms of the scenario editor at least. When I was making my game script I ran into this; was testing it with scenarios in the scenario editor (as scenarios is one of the intended use cases) and couldn't change the parameters at all. I thought this was a bug at first but I realized it was intended since existing scenarios are treated as in-game even in the scenario editor. The work around was to make everything CONFIG_INGAME, which is abviously not a great workaround since you don't want people thinking editing parameters in-game does something when in reality it only is meant for the scenario editor

But, this particular PR doesn't solve that. While I think it is a good solution and could be merged (since ai-developer-tools should allow parameter editing even in game) it's only a partial solution. The bigger issue I had like I said is with the scenario editor specifically. You would want regular users to also edit parameters in the scenario editor, so I think that needs to be fixed too

From @F1rrel:

I agree the problem is mostly in scenario editor, where all parameters should be editable.

I dont see this PR as necessary, but can be a quality of life improvement. Like when I want to restart a game with different set of parameters, that should not be changeable in a running game, which I do quite often.

My understanding based on this conversation is that this PR is an improvement and should be merged, but there's also a need for a separate PR that makes all parameters editable in Scenario Editor. @Arastais said they plan to open such a PR after #10058 is merged.

@LordAro LordAro merged commit 019dcb7 into OpenTTD:master Nov 8, 2022
@SamuXarick
Copy link
Contributor

This shouldn't be merged as is. Now I suspect it breaks the functionality of Reset button added in dc5b802

@2TallTyler
Copy link
Member

Can you open an issue to demonstrate what you mean, if your suspicion is correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants