From: <dil...@us...> - 2014-06-13 20:25:54
|
Revision: 7154 http://sourceforge.net/p/freeorion/code/7154 Author: dilvish-fo Date: 2014-06-13 20:25:46 +0000 (Fri, 13 Jun 2014) Log Message: ----------- misc AI adjustments Modified Paths: -------------- trunk/FreeOrion/default/AI/ColonisationAI.py trunk/FreeOrion/default/AI/PriorityAI.py trunk/FreeOrion/default/AI/ProductionAI.py trunk/FreeOrion/default/AI/TechsListsAI.py Modified: trunk/FreeOrion/default/AI/ColonisationAI.py =================================================================== --- trunk/FreeOrion/default/AI/ColonisationAI.py 2014-06-12 05:57:46 UTC (rev 7153) +++ trunk/FreeOrion/default/AI/ColonisationAI.py 2014-06-13 20:25:46 UTC (rev 7154) @@ -536,14 +536,15 @@ sysID = planet.systemID for pid2 in empireSpeciesSystems.get(sysID, {}).get('pids', []): planet2 = universe.getPlanet(pid2) - if not planet2: + if not (planet2 and planet2.speciesName in empireColonizers): continue - if (pid not in foAI.foAIstate.qualifyingOutpostBaseTargets) and (planet2.speciesName in empireColonizers): - if (pid not in empireOutpostIDs): + if (pid not in foAI.foAIstate.qualifyingOutpostBaseTargets): + if planet.unowned: foAI.foAIstate.qualifyingOutpostBaseTargets.setdefault(pid, [pid2, -1]) - if (pid not in foAI.foAIstate.qualifyingColonyBaseTargets) and (planet2.speciesName in empireColonizers): - if colonyCost < cost_ratio * availPP_BySys.get(sysID, 0): - foAI.foAIstate.qualifyingColonyBaseTargets.setdefault(pid, [pid2, -1])#TODO: check other local colonizers for better score + if ((pid not in foAI.foAIstate.qualifyingColonyBaseTargets) and + (colonyCost < cost_ratio * availPP_BySys.get(sysID, 0)) and + (planet.unowned or (pid in empireOutpostIDs))): + foAI.foAIstate.qualifyingColonyBaseTargets.setdefault(pid, [pid2, -1])#TODO: enable actual building, remove from outpostbases, check other local colonizers for better score # print "Evaluated Colony PlanetIDs: " + str(evaluatedColonyPlanetIDs) times.append( time() ) Modified: trunk/FreeOrion/default/AI/PriorityAI.py =================================================================== --- trunk/FreeOrion/default/AI/PriorityAI.py 2014-06-12 05:57:46 UTC (rev 7153) +++ trunk/FreeOrion/default/AI/PriorityAI.py 2014-06-13 20:25:46 UTC (rev 7154) @@ -159,10 +159,10 @@ totalPP = empire.productionPoints totalRP = empire.resourceProduction(fo.resourceType.research) industrySurge = ((foAI.foAIstate.aggression > fo.aggression.cautious) and - ( totalPP <(30*(foAI.foAIstate.aggression)) ) and - (orbGenTech in researchQueueList[:3] or empire.getTechStatus(orbGenTech) == fo.techStatus.complete) and + ( (totalPP + 1.6 * totalRP) <(60*(foAI.foAIstate.aggression)) ) and + ((orbGenTech in researchQueueList[:3] or empire.getTechStatus(orbGenTech) == fo.techStatus.complete) and ColonisationAI.gotGG ) and ( not ( - (len(AIstate.popCtrIDs) >= 5 )))) # previously (empire.getTechStatus(AIDependencies.prod_auto_name) == fo.techStatus.complete) and + (len(AIstate.popCtrIDs) >= 8 )))) # previously (empire.getTechStatus(AIDependencies.prod_auto_name) == fo.techStatus.complete) and # get current industry production & Target ownedPlanetIDs = PlanetUtilsAI.getOwnedPlanetsByEmpire(universe.planetIDs, empireID) planets = map(universe.getPlanet, ownedPlanetIDs) @@ -196,7 +196,7 @@ elif len(researchQueue) <20 and researchQueue[int(len(researchQueue)/2)].allocation > 0 : researchPriority = 0.7 * researchPriority # closing in on end of research if industrySurge: - researchPriority *= 0.5 + researchPriority *= 0.6 if ( ((empire.getTechStatus("SHP_WEAPON_2_4") == fo.techStatus.complete) or (empire.getTechStatus("SHP_WEAPON_4_1") == fo.techStatus.complete)) and Modified: trunk/FreeOrion/default/AI/ProductionAI.py =================================================================== --- trunk/FreeOrion/default/AI/ProductionAI.py 2014-06-12 05:57:46 UTC (rev 7153) +++ trunk/FreeOrion/default/AI/ProductionAI.py 2014-06-13 20:25:46 UTC (rev 7154) @@ -342,10 +342,30 @@ else: maxEM= 10 - nb, hull = designNameBases[1]+"-%1d", "SH_BASIC_MEDIUM" - newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, srb%iw, ""], "", model) for iw in [1, 2, 3, 4] ] - newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, srb2%iw, ""], "", model) for iw in [1, 2, 3, 4] ] + nb, hull = designNameBases[1]+"-a-%1d", "SH_BASIC_MEDIUM" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + nb, hull = designNameBases[1]+"-b-%1d", "SH_BASIC_MEDIUM" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, ar2, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, ar2, if1], "", model) for iw in [1, 2, 3, 4] ] + + nb, hull = designNameBases[1]+"-c-%1d", "SH_BASIC_MEDIUM" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, srb%iw, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, srb2%iw, if1], "", model) for iw in [1, 2, 3, 4] ] + + nb, hull = designNameBases[1]+"-d-%1d", "SH_STANDARD" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, ar1, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, ar1, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + + nb, hull = designNameBases[1]+"-e-%1d", "SH_STANDARD" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, ar2, ar2, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, ar2, ar2, if1], "", model) for iw in [1, 2, 3, 4] ] + + nb, hull = designNameBases[1]+"-f-%1d", "SH_STANDARD" + newMarkDesigns += [ (nb%iw, desc, hull, [ srb%iw, srb%iw, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + newMarkDesigns += [ (nb%(iw+4), desc, hull, [ srb2%iw, srb2%iw, ar1, if1], "", model) for iw in [1, 2, 3, 4] ] + nb, hull = designNameBases[2]+"-1-%1d", "SH_ORGANIC" #11 = "Comet":"BA" newMarkDesigns += [ (nb%iw, desc, hull, [ ar1, ar1, srb%iw, if1], "", model) for iw in [1, 2, 3, 4] ] newMarkDesigns += [ (nb%(iw+4), desc, hull, [ ar1, ar1, srb2%iw, if1], "", model) for iw in [1, 2, 3, 4] ] Modified: trunk/FreeOrion/default/AI/TechsListsAI.py =================================================================== --- trunk/FreeOrion/default/AI/TechsListsAI.py 2014-06-12 05:57:46 UTC (rev 7153) +++ trunk/FreeOrion/default/AI/TechsListsAI.py 2014-06-13 20:25:46 UTC (rev 7154) @@ -39,14 +39,14 @@ def tech_group_1a(): # early org_hull result = [ "LRN_ALGO_ELEGANCE", + "GRO_PLANET_ECOL", + "GRO_SUBTER_HAB", "SHP_WEAPON_1_2", - "GRO_PLANET_ECOL", "SHP_DOMESTIC_MONSTER", "SHP_ORG_HULL", "CON_ENV_ENCAPSUL", "LRN_ARTIF_MINDS", "SHP_WEAPON_1_3", - "GRO_SUBTER_HAB", "SHP_WEAPON_1_4", "CON_ORBITAL_CON", ] @@ -55,13 +55,13 @@ def tech_group_1b(): # early _lrn_artif_minds result = [ "LRN_ALGO_ELEGANCE", + "GRO_PLANET_ECOL", + "GRO_SUBTER_HAB", "SHP_WEAPON_1_2", "CON_ENV_ENCAPSUL", "LRN_ARTIF_MINDS", - "GRO_PLANET_ECOL", "SHP_DOMESTIC_MONSTER", "SHP_ORG_HULL", - "GRO_SUBTER_HAB", "CON_ORBITAL_CON", "SHP_WEAPON_1_4", ] |