AI Meter Updating

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12282
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

AI Meter Updating

#1 Post by Geoff the Medio » Fri Oct 02, 2015 6:45 am

It is necessary for AI clients to update meter estimates and discrepancies each turn?

In AIInterface::InitTurn, there are lines

Code: Select all

        InitMeterEstimatesAndDiscrepancies();
        UpdateMeterEstimates();
        UpdateResourcePools();
Are these all necessary for proper functioning of the AI? Perhaps it would be fine just using whatever meter values the server sends, and doesn't need to redo the meter updating and calculating of discrepancies as is done for the human client?

If it can be skipped, it could save a bunch of AI processing time each turn, and remove a potential crash due to launching a bunch of threads to do the meter calculations.

User avatar
Dilvish
AI Lead, Programmer
Posts: 4720
Joined: Sat Sep 22, 2012 6:25 pm

Re: AI Meter Updating

#2 Post by Dilvish » Fri Oct 02, 2015 7:14 am

Sounds worth experimenting with. I'll bookmark this for my todo list.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply