widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #17143
Re: [Merge] lp:~widelands-dev/widelands/AI-fixes into lp:widelands
@ Tibor:
oops this was a left over of some trials. I don't think we need this anymore will fix this tonight when I am back at my dev machine.
@ Nordfriese
Thanks for the review. Will fix these issues as well. However I replied to some comments below them.
Diff comments:
>
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc 2019-04-20 05:44:37 +0000
> +++ src/ai/defaultai.cc 2019-05-15 06:30:23 +0000
> @@ -2454,6 +2458,12 @@
>
> if (!bo.buildable(*player_)) {
> bo.new_building = BuildingNecessity::kNotNeeded;
> + // TODO(Hessenfarmer): Add the buildings if they are allowed again
> + // This line removes buildings from basic econmy if they are not allowed for the player
> + // this should only happen by scripting.
Will try to. But this leads to cornercases. What shall we do if basic economy already reached? This is only dealing with the list of basic economy buildings. After Basic economy reached (in fri03 around 11 minutes) everything runs according the "normal" priority rules. Currently I don't have identified any behaviour that these rules are not working properly (they are subject to training though). The basic economy concept exists to ensure the Ai does not run into deadlocks, so if you disable a basic building in script you need to take care of that (as you did in fri03)
> + if (bo.basic_amount) {
> + persistent_data->remaining_basic_buildings.erase(bo.id);
> + }
> } else if (bo.type == BuildingObserver::Type::kProductionsite ||
> bo.type == BuildingObserver::Type::kMine) {
>
> @@ -3752,6 +3763,8 @@
> // if we are within grace time, it is OK, just go on
> if (eco->dismantle_grace_time > gametime &&
> eco->dismantle_grace_time != std::numeric_limits<uint32_t>::max()) {
> + ;
Although I have not done anything in there your comment sounds reasonable, will do this tonight.
> +
> // if grace time is not set, this is probably first time without a warehouse and we must
> // set it
> } else if (eco->dismantle_grace_time == std::numeric_limits<uint32_t>::max()) {
--
https://code.launchpad.net/~widelands-dev/widelands/AI-fixes/+merge/367309
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/AI-fixes.
References