MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002696VCMIAI - Adventure Mappublic2017-06-17 08:142017-06-17 08:26
ReporterDydzio 
Assigned ToWarmonger 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformMicrosoft WindowsOSWindows 7OS VersionHome Premium x64
Product Version1.next 
Target VersionFixed in Version 
Summary0002696: VCAI::tryBuildNextStructure bug - does not build prerequirements correctly
DescriptionVCAI::tryBuildNextStructure - this function checks for prerequisites when building structures and is trying to build them too. But if prerequisite has another prerequisite (for example capitol requires castle that requires citadel) - it will try to perform invalid building operation if castle is first prerequisite in prerequisites vector and citadel is not built.

Sample message in vcmi console when this occurs:

"Request to build building 9 in 0 days!"
Steps To ReproduceMake sure AI has lots of resources and try to execute this code in VCAI::buildStructure every day:

if (tryBuildNextStructure(t, std::vector<BuildingID>(goldSource, goldSource + ARRAY_COUNT(goldSource))))
        return;

AI will be stuck trying to build castle every turn after building city hall.
Additional InformationWith current code (as of 17.06.2017) without these lines:

if (cb->getDate(Date::DAY_OF_WEEK) > 6) // last 2 days of week - try to focus on growth
{
    if (tryBuildNextStructure(t, std::vector<BuildingID>(unitGrowth, unitGrowth + ARRAY_COUNT(unitGrowth)), 2))
        return;
}

AI would not build fort/citadel/castle at all...
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-06-17 08:14 Dydzio New Issue
2017-06-17 08:14 Dydzio Status new => assigned
2017-06-17 08:14 Dydzio Assigned To => Warmonger
2017-06-17 08:26 Dydzio Additional Information Updated View Revisions

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean