Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Refactor AI economy accounting to not keep track of flags#6616

Open
bunnybot wants to merge 8 commits intomasterfrom
mirror/tothxa/widelands/ai-no-flag-accounting
Open

Refactor AI economy accounting to not keep track of flags#6616
bunnybot wants to merge 8 commits intomasterfrom
mirror/tothxa/widelands/ai-no-flag-accounting

Conversation

@bunnybot
Copy link

tothxaMirrored from Codeberg
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 and check_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_flags race is eliminated. Also this one mostly simplifies and removes code, while the other PR only adds more code.

tothxa and others added 2 commits January 29, 2025 03:12
refactor economy accounting
keep track of ware economies
refactor economy and flag rotation for roads optimisation
@bunnybot bunnybot added this to the v1.3 milestone Jan 29, 2025
@bunnybot bunnybot self-assigned this Jan 29, 2025
@bunnybot
Copy link
Author

Assigned to tothxa

@bunnybot bunnybot added cleanup & refactoring Improving our code quality ai Computer players economy Ware priority & transport, worker creation & assignment, requests & supplies, trading & markets under discussion There is no consensus about a critical point yet labels Jan 29, 2025
@bunnybot bunnybot added the ci:fail CI checks failed label Jan 29, 2025
@bunnybot bunnybot added ci:fail CI checks failed ci:success CI checks succeeded and removed ci:fail CI checks failed labels Jan 29, 2025
@bunnybot bunnybot changed the title WIP: Refactor AI economy accounting to not keep track of flags Refactor AI economy accounting to not keep track of flags Jan 29, 2025
@bunnybot bunnybot marked this pull request as ready for review January 29, 2025 15:24
@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels Jan 29, 2025
@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Wed Jan 29 16:30:56 CET 2025, Tóth András (tothxa) wrote:


I think I prefer this alternative. It's a bigger change, but the end result looks much simpler and safer.

@bunnybot bunnybot modified the milestones: v1.3, v1.4 May 31, 2025
@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels Dec 22, 2025
@bunnybot bunnybot added ci:fail CI checks failed and removed ci:success CI checks succeeded labels Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Computer players ci:fail CI checks failed cleanup & refactoring Improving our code quality economy Ware priority & transport, worker creation & assignment, requests & supplies, trading & markets under discussion There is no consensus about a critical point yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants