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

Allow reloading AI without removing the controlled company #2837

Closed
DorpsGek opened this issue Apr 14, 2009 · 3 comments
Closed

Allow reloading AI without removing the controlled company #2837

DorpsGek opened this issue Apr 14, 2009 · 3 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

bilbo opened the ticket and wrote:

Currently, if you reload AI, everything that the AI have built is removed too. This is very annoying with AI development, as if you write new code and want to change it while the company is running (or if you want to reload fixed AI code after it have crashed), you can't do it without erasing everything the AI built.

I suggest to add feature that will allow only to reload the AI code without removing the company (similarly as it is loaded "into" existing company when loading game)

It could work like this:

call Save() on old AI, if it is not crashed (optionally)
remove ald AI code
load new AI code
call Load() on new AI, giving it the data from Save() (optionally)

Reported version: trunk
Operating system: All


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

bilbo wrote:

Patch for this - current reload_ai command is renamed to restart_ai (it is IMHO more appropriate name for that, as it kills an AI and then starts a new one) and new reload_ai is added - first parameter is company to reload, extra parameters can be used to load different AI instead of reloading the current (they are same as for the start_ai command). In both cases, the company infrastructure and vehicles are kept intact.

What could maybe need to be changed for consistency if the patch is applied:

the "Reload AI" button in console - either rename to "Restart AI", or change its functionality to really only reload the AI. The "second" function (reload/restart) could be available by ctrl-clicking the button.

I briefly tested the patch in singleplayer, reloading works both for reloading same or different company and for reloading AI that is alive or crashed.

The only case that is not properly tested is reloading AI when user specifies invalid AI name on commandline. The new AI is not loaded (reloading fails and current AI is kept intact) and I return name of old AI to AIConfig, though I am not sure whether this does not have any unwanted side effects.

If anybody have idea how this case should be handled properly, I can change the current behavior.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2837#comment5931

@DorpsGek
Copy link
Member Author

bilbo wrote:

Updated the patch to r19627.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2837#comment7867

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay wontfix component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant