Forums for the FreeOrion project
It is currently Thu Jun 21, 2018 4:15 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ResourcesAI Module
PostPosted: Fri Jan 06, 2012 5:55 pm 
Space Floater

Joined: Sat Sep 24, 2011 4:39 pm
Posts: 44
Attached is an incremental revision to the ResourcesAI module, its supporting PlanetUtilsAI module, and a minor revision to the PriorityAI module.

The revision to the ResourcesAI module allows the resource focus of all AI empire owned planets to be changed in accordance with the empire’s changing resource priorities. In addition, asteroid planets will now change their resource focus to minerals after Orbital Farming is researched, and gas giant planets will now change their resource focus to research after Orbital Farming is researched.

The attachment includes the following three (3) revised AI modules:

Module revisions include the following:

__Added def getTypePlanetEmpireOwned(planetType):
__Deleted unneeded def getCapitalID():

__Added def calculateResearchPriority():
__Tweaked def calculateFoodPriority():
__Rearranged some functions to correspond to their order in the EnumsAI module

__Added def topResourcePriority():
__Added def setCapitalIDResourceFocus():
____Removed existing method from def generateResourceOrders():
____Added elif topPriority == AIPriorityType.PRIORITY_RESOURCE_RESEARCH: condition.
__Added setGeneralPlanetResourceFocus():
__Added def setAsteroidsResourceFocus():
__Added def setGasGiantsResourceFocus():
__Added def printResourcesPriority():
__Revised def generateResourceOrders():

These revised modules have been run successfully on FO v0.3.17 [SVN 4570] MSVC 2010.

I release my contribution under the terms of the Creative Commons Attribution-ShareAlike 3.0 and GNU GPL 2.0 licenses.

Attachments: [4.56 KiB]
Downloaded 34 times
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group