Code Monkey home page Code Monkey logo

Comments (2)

Flamefire avatar Flamefire commented on June 9, 2024 1

After some debugging and testing I found that code in method AIResourceMap::findBestPosition(const MapPoint& pt, BuildingQuality size, unsigned radius, int minimum) in AIResourceMap.cpp never go past the condition
if(!aiMap[idx].reachable || !aiMap[idx].owned || aiMap[idx].farmed) continue;

That is completely fine: It tries to find a position for building a fishery not a fish position. See the next line that checks the BQ of that point:

if(!canUseBq(aii.GetBuildingQuality(curPt), size)) // map[idx].bq; TODO: Update nodes BQ and use that

The issue here is that the calculation of the AI ResourceMaps has a serious bug. Specifically the incremental update which is intended to save computation time is wrong and likely the initial computation is too (that part that uses the previously calculated value)
I always wanted to write a good test for that and fix it for good which should make the AI much better as it is currently running with an immense handicap.

See the original issue for more details: #933 Closing this as a duplicate

from s25client.

desofity avatar desofity commented on June 9, 2024

Thanks for the clarification! I'll take a closer look on the original issue.

from s25client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.