Refactor AI economy accounting to not keep track of flags#6616
Open
Refactor AI economy accounting to not keep track of flags#6616
Conversation
refactor economy accounting keep track of ware economies refactor economy and flag rotation for roads optimisation
Author
|
Assigned to tothxa |
Author
|
I think I prefer this alternative. It's a bigger change, but the end result looks much simpler and safer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created on Wed Jan 29 03:32:07 CET 2025 by Tóth András (tothxa)
Type of Change
Refactoring / Bugfix
Issue(s) Closed
Ware economies weren't tracked by EconomyObservers, so DefaultAI::review_wares_targets() didn't work. Resolves #6419 (comment) too.
New Behavior
Completely redesigned
EconomyObserver, economy and flag rotation for road optimisation andcheck_economies().Possible Regressions
AI flags handling, scheduling of some tasks
Additional context
This is an alternative to #6615. Maybe it's worse to use more stuff directly from the game state, or maybe it's better, I don't know. Please give your opinions. At least the theoretical
new_flagsrace is eliminated. Also this one mostly simplifies and removes code, while the other PR only adds more code.