Hello Homeworld friends!
I was kinda busy with real life for a while, but now I kinda have to wait with my real stuff for a while because of the stupid virus, so I’m kinda in the mood to do some MODDING!
I meant to share what I found out about the whole AI tracing, so here it is!
I set it up in the Star Trek vs. Homewold mod under the function ‘stcgtrace’ jus so I could make sure that it was the stuff that I set up instead of the AItrace that was already in the game.
Here are some of the files that I changed, so you can see what I tried out:
This is the AI\Default\default.lua: (the file one folder higher with the same name is for singleplayer I’m pretty sure)
aitrace("DEFAULT CPU LOADED")
g_LOD = getLevelOfDifficulty()
dofilepath("data:ai/default/classdef.lua")
dofilepath("data:ai/default/cpubuild.lua")
dofilepath("data:ai/default/cpuresearch.lua")
dofilepath("data:ai/default/cpumilitary.lua")
old_aitrace = aitrace
rawset(globals(),"aitrace",nil)
--aitrace = function() end
aitrace = function(str) print(str) end
stcgtrace = function(str) print(str) end
function oninit()
s_playerIndex = Player_Self()
sg_dobuild = 1
sg_dosubsystems = 1
sg_doresearch = 1
sg_doupgrades = 1
sg_domilitary = 1
cp_processResource = 1
cp_processMilitary = 1
sg_lastSpendMoneyTime = gameTime()
sg_spendMoneyDelay = 0
ClassInitialize()
CpuBuild_Init()
CpuResearch_Init()
CpuMilitary_Init()
sg_kDemandResetValue = SelfRace_GetNumber("ai_demand_reset_value", 4.0)
if (Override_Init) then
Override_Init()
end
sg_reseachDemand = -sg_kDemandResetValue
Rule_AddInterval("doai", 2.0 )
end
function CalcOpenBuildChannels()
local numShipsBuildingShips = NumShipsBuildingShips()
local numShipsBuildingSubSystems = NumShipsBuildingSubSystems()
local numShipsBuilding = numShipsBuildingShips + numShipsBuildingSubSystems
local researchItem = IsResearchBusy()
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua function CalcOpenBuildChannels started")
if (SelfRace_GetNumber("cfg_buildable_subsystems", 1.0) < 1.0) then
numShipsBuilding = numShipsBuildingShips
end
local numItemsBuilding = numShipsBuilding + researchItem
local totalBuildShips = BuildShipCount()*2
local numCollecting = GetNumCollecting()
local numRUs = GetRU()
sg_allowedBuildChannels = numCollecting/5;
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua Space Bucks: "..numRUs.."")
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua Research Item: "..researchItem.."")
if (SelfRace_GetNumber("cfg_build_by_ships", 0.0) >= 1.0) then -- set for HW1!!!
sg_allowedBuildChannels = BuildShipCount()*2
end
if (numRUs > 500) then
sg_allowedBuildChannels = sg_allowedBuildChannels + (numRUs-500)/1000
end
s_numOpenBuildChannels = sg_allowedBuildChannels - numItemsBuilding
s_shipBuildQueuesFull = 0
local adjBuildEst = SelfRace_GetNumber("persona_build_ships_scalar", 1.0) -- 4.0 HW1
if (totalBuildShips >= numShipsBuilding*adjBuildEst) then
s_shipBuildQueuesFull = SelfRace_GetNumber("persona_build_ships_befull", 1.0) -- 0.0 HW1
end
if (s_numOpenBuildChannels <= -1.5) then
RemoveLeastNeededItem()
end
end
function CacheCurrentState()
s_numFiSystems = 0
s_numCoSystems = 0
s_numFrSystems = 0
if (FIGHTERPRODUCTION ~= nil) then
s_numFiSystems = NumSubSystems(FIGHTERPRODUCTION) + NumSubSystemsQ(FIGHTERPRODUCTION)
end
if (CORVETTEPRODUCTION ~= nil) then
s_numCoSystems = NumSubSystems(CORVETTEPRODUCTION) + NumSubSystemsQ(CORVETTEPRODUCTION)
end
if (FRIGATEPRODUCTION ~= nil) then
s_numFrSystems = NumSubSystems(FRIGATEPRODUCTION) + NumSubSystemsQ(FRIGATEPRODUCTION)
end
s_totalProdSS = s_numFiSystems + s_numCoSystems + s_numFrSystems
s_militaryPop = PlayersMilitaryPopulation( s_playerIndex, player_total );
s_selfTotalValue = PlayersMilitary_Total( s_playerIndex, player_total );
s_enemyTotalValue = PlayersMilitary_Total( player_enemy, player_max );
s_militaryStrength = PlayersMilitary_Threat( player_enemy, player_min );
s_enemyIndex = GetChosenEnemy()
s_militaryStrengthVersusTarget = 0
if (s_enemyIndex ~= -1) then
s_militaryStrengthVersusTarget = PlayersMilitary_Threat( s_enemyIndex, player_max )
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua s_selfTotalValue: "..s_selfTotalValue.."")
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua s_militaryPop: "..s_militaryPop.."")
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua s_enemyIndex: "..s_enemyIndex.."")
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua s_enemyTotalValue: "..s_enemyTotalValue.."")
end
end
function SpendMoney()
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> default.lua function SpendMoney started")
if (s_numOpenBuildChannels > 0) then
local buildHasBeenDone = 0
if (sg_dobuild==1 and s_shipBuildQueuesFull==0 and sg_reseachDemand<0) then
if (CpuBuild_Process() == 1) then
s_numOpenBuildChannels = s_numOpenBuildChannels-SelfRace_GetNumber("persona_build_open_chan_adjust", 1.0) -- 0 HW1
sg_reseachDemand = sg_reseachDemand + 1
buildHasBeenDone = 1
end
end
if (s_numOpenBuildChannels > 0) then
if (sg_doresearch==1) then
local didResearch = CpuResearch_Process();
if (didResearch == 1) then
sg_reseachDemand = -sg_kDemandResetValue
else
if (sg_reseachDemand>=0 and sg_dobuild==1 and s_shipBuildQueuesFull==0 and buildHasBeenDone == 0) then
CpuBuild_Process()
end
end
else
sg_reseachDemand = -sg_kDemandResetValue
end
end
end
end
function doai()
CacheCurrentState();
CalcOpenBuildChannels();
local timeSinceLastSubSysDemand = gameTime() - sg_lastSpendMoneyTime
local bigSpender = SelfRace_GetNumber("persona_bigspender", 0.0) -- 1.0 for HW1
if (timeSinceLastSubSysDemand >= sg_spendMoneyDelay) and (bigSpender < 1.0) then
SpendMoney()
sg_lastSpendMoneyTime = gameTime()
end
if (9 >= sg_spendMoneyDelay) and (GetRU() > 2800) and (bigSpender >= 1.0) then
SpendMoney()
SpendMoney()
SpendMoney()
SpendMoney()
SpendMoney()
SpendMoney()
sg_allowedBuildChannels = sg_allowedBuildChannels * 4
else
if (9 >= sg_spendMoneyDelay) and (GetRU() < 2800) and (bigSpender >= 1.0) then
SpendMoney()
SpendMoney()
SpendMoney()
sg_allowedBuildChannels = sg_allowedBuildChannels * 2
else
if (9 >= sg_spendMoneyDelay) and (GetRU() < 1800) and (bigSpender >= 1.0) then
SpendMoney()
SpendMoney()
sg_allowedBuildChannels = sg_allowedBuildChannels * 1
end
end
end
local cpuplayers_norushtime = 60
if CPUPLAYERS_NORUSHTIME5 ~= nil then
if IsResearchDone( CPUPLAYERS_NORUSHTIME5 ) == 1 then
cpuplayers_norushtime = 5*61.2
elseif IsResearchDone( CPUPLAYERS_NORUSHTIME10 ) == 1 then
cpuplayers_norushtime = 10*61.2
elseif IsResearchDone( CPUPLAYERS_NORUSHTIME15 ) == 1 then
cpuplayers_norushtime = 15*61.2
end
end
if (sg_domilitary==1) and (gameTime() > cpuplayers_norushtime) then
CpuMilitary_Process();
end
end
This is the AI\Default\cpumilitary.lua:
aitrace("LOADING CPU MILITARY")
function CpuMilitary_Init()
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> cpumilitary.lua function CpuMilitary_Init started")
cp_attackPercent = 100
if (g_LOD == 0) then
local scaleComp = SelfRace_GetNumber("persona_comp_scale0", 1.0) -- 2
cp_minSquadGroupSize = 5*scaleComp
cp_minSquadGroupValue = 220*scaleComp
cp_maxGroupSize = 17*scaleComp
cp_maxGroupValue = 216*scaleComp
cp_forceAttackGroupSize = 15*scaleComp
cp_initThreatModifier = 0.95
elseif (g_LOD == 1) then
local scaleComp = SelfRace_GetNumber("persona_comp_scale1", 1.0) -- 3
cp_minSquadGroupSize = 5*scaleComp
cp_minSquadGroupValue = 220*scaleComp
cp_maxGroupSize = 17*scaleComp
cp_maxGroupValue = 216*scaleComp
cp_forceAttackGroupSize = 15*scaleComp
cp_initThreatModifier = 0.95
elseif (g_LOD == 2) then
local scaleComp = SelfRace_GetNumber("persona_comp_scale2", 1.0) -- 4
cp_minSquadGroupSize = 5*scaleComp
cp_minSquadGroupValue = 220*scaleComp
cp_maxGroupSize = 17*scaleComp
cp_maxGroupValue = 216*scaleComp
cp_forceAttackGroupSize = 15*scaleComp
cp_initThreatModifier = 0.95
else -- g_LOD 3
local scaleComp = SelfRace_GetNumber("persona_comp_scale3", 1.0) -- 5
cp_minSquadGroupSize = 5*scaleComp
cp_minSquadGroupValue = 220*scaleComp
cp_maxGroupSize = 17*scaleComp
cp_maxGroupValue = 216*scaleComp
cp_forceAttackGroupSize = 15*scaleComp
cp_initThreatModifier = 0.95
end
sg_moreEnemies = 0
sg_militaryRand = Rand(100)
if (Override_MilitaryInit) then
Override_MilitaryInit()
end
end
function CpuMilitary_Process()
local numEnemies = PlayersAlive( player_enemy )
local numAllies = PlayersAlive( player_ally )
sg_moreEnemies = numEnemies - numAllies
Logic_military_groupvars();
Logic_military_attackrules();
Logic_military_setattacktimer();
end
function Logic_military_groupvars()
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> cpumilitary.lua function Logic_military_groupvars started")
local scaleComp = SelfRace_GetNumber("persona_group_scale", 1.0) -- 5
cp_minSquadGroupSize = 4*scaleComp
cp_minSquadGroupValue = 150*scaleComp
stcgtrace("STCG-trace: SlotNr: "..s_playerIndex..">>> cpumilitary.lua s_militaryStrength: "..s_militaryStrength.."")
--try to get allies to help earlier by reducing minimum group sizes
if (sg_moreEnemies > 0 and s_selfTotalValue < s_enemyTotalValue*2) then
--cp_minSquadGroupSize = cp_minSquadGroupSize + (2*scaleComp)
--cp_minSquadGroupValue = cp_minSquadGroupValue + (75*scaleComp)
cp_minSquadGroupSize = cp_minSquadGroupSize + (1*scaleComp)
cp_minSquadGroupValue = cp_minSquadGroupValue + (25*scaleComp)
elseif (s_militaryStrength > (120*scaleComp)) then
--cp_minSquadGroupSize = 3*scaleComp
--cp_minSquadGroupValue = 120*scaleComp
cp_minSquadGroupSize = 2*scaleComp
cp_minSquadGroupValue = 80*scaleComp
end
-- end of changes to this
end
function Logic_military_attackrules()
--if (g_LOD == 0) then
if (gameTime() > 20*60 and s_militaryStrength > 0) then
cp_attackPercent = 100
aitrace("For the honor! Attack!")
end
if (s_selfTotalValue*2 < s_enemyTotalValue and s_selfTotalValue > 150) then
--
cp_attackPercent = 25
aitrace("I'm Losing!! Go on defence")
end
--end
end
function attack_now_timer()
aitrace("Script:calling attack_now_timer")
AttackNow();
Rule_Remove("attack_now_timer")
end
function Logic_military_setattacktimer()
local cpuplayers_delay = 1
if CPUPLAYERS_DEFENSIVE ~= nil then
cpuplayers_delay = 4
if IsResearchDone( CPUPLAYERS_DEFENSIVE ) == 1 then
elseif IsResearchDone( CPUPLAYERS_AGGRESSIVE ) == 1 then
cpuplayers_delay = 0.5
elseif IsResearchDone( CPUPLAYERS_DYNAMIC ) == 1 then
cpuplayers_delay = Rand(20)/2
end
end
local timedelay = 0
local wavedelay = 40 + sg_militaryRand * 0.3
timedelay = timedelay * cpuplayers_delay
wavedelay = wavedelay * cpuplayers_delay
local gametime = gameTime()
if (gametime >= timedelay or HaveBeenAttacked()==1) then
if (Rule_Exists("attack_now_timer") == 0) then
aitrace("Script: Attacktimer added")
Rule_AddInterval("attack_now_timer", wavedelay )
end
end
end
Here is the ai_build.lua for the federation, the stuff that’s commented out didn’t work, but you can see what I tried:
aitrace(">> AI TRACE >> | LOADING FEDERATION BUILD INFO")
stcgtrace("STCG-trace: Load Federation ai_build")
kCollector = FED_TMP_RESOURCECOLLECTOR
kRefinery = FED_TMP_RESOURCECONTROLLER
kGreta = FED_TMP_GRETA
kScout = FED_TMP_OBERTH
kInterceptor = FED_TMP_FIGHTER
kBomber = FED_TMP_SPECTRE
kAcorv = FED_TMP_PHANTOM
kMissileDestroyer = FED_TMP_CENTAUR
kMir = FED_TMP_MIRANDA
kConst = FED_TMP_CONSTELLATION
kAkula = FED_TMP_AKULA
kMidway = FED_TMP_MIDWAY
kCarrier = FED_TMP_SHIPYARD_S
kShipYard = FED_TMP_SHIPYARD
kDestroyer = FED_TMP_CONSTITUTION
kBattleCruiser = FED_TMP_EXCELSIOR
kRD = ROM_TMP_FIREHAWK
--kGB = GRN_TMP_GRENDEL
kBF = KNG_TMP_BREL
kDread = FED_TMP_AMBASSADOR
kFlag = FED_TEMP_FLAGSHIP
kOut = FED_TEMP_OUTPOST
function DetermineDemandWithNoCounterInfo_Federation()
if (sg_randFavorShipType < 55) then
ShipDemandAddByClass( eFighter, 1 )
elseif (sg_randFavorShipType < 85) then
ShipDemandAddByClass( eCorvette, 1 )
elseif (sg_randFavorShipType < 95) then
ShipDemandAddByClass( eFrigate, 1 )
else
ShipDemandAdd( kDestroyer, 1.0 )
end
end
function DetermineSpecialDemand_Federation()
--local playerNameWH = Player_GetName(s_playerIndex)
---------------------------------------------------------------------------------------------------------------------------------------
-- Fighter Class
local num_fed_TMP_fighter = NumSquadrons( kInterceptor ) + NumSquadronsQ( kInterceptor )
local num_fed_TMP_phantom = NumSquadrons( kAcorv ) + NumSquadronsQ( kAcorv )
local num_fed_TMP_spectre = NumSquadrons( kBomber ) + NumSquadronsQ( kBomber )
-- Fighter Total
local num_fighters = num_fed_TMP_fighter + num_fed_TMP_phantom + num_fed_TMP_spectre
-- Corvette Class - this stuff should be treated as frigates to match up with the HW stuff
local num_fed_TMP_akula = NumSquadrons( kAkula ) + NumSquadronsQ( kAkula )
local num_fed_TMP_centaur = NumSquadrons( kMissileDestroyer ) + NumSquadronsQ( kMissileDestroyer )
-- Corvette Total
local num_corvettes = num_fed_TMP_akula + num_fed_TMP_centaur
-- Frigate Class
local num_fed_TMP_miranda = NumSquadrons( kMir ) + NumSquadronsQ( kMir )
local num_fed_TMP_constellation = NumSquadrons( kConst ) + NumSquadronsQ( kConst )
-- Frigate Total
local num_frigates = num_fed_TMP_akula + num_fed_TMP_miranda + num_fed_TMP_constellation
-- Capital Class
local num_fed_TMP_constitution = NumSquadrons( kDestroyer ) + NumSquadronsQ( kDestroyer )
local num_fed_TMP_excelsior = NumSquadrons( kBattleCruiser ) + NumSquadronsQ( kBattleCruiser )
local num_fed_TMP_midway = NumSquadrons( kMidway ) + NumSquadronsQ( kMidway )
-- Capital Subclass totals
local num_capitals = num_fed_TMP_constitution + num_fed_TMP_excelsior + num_fed_TMP_midway
-- Special Capital Class
local num_fed_TMP_ambassador = NumSquadrons( kDread ) + NumSquadronsQ( kDread )
-- Stations
local num_fed_TMP_shipyard = NumSquadrons( kShipYard ) + NumSquadronsQ( kShipYard )
local num_fed_TMP_shipyard_S = NumSquadrons( kCarrier ) + NumSquadronsQ( kCarrier )
-- Station Totals
local num_shipyards = num_fed_TMP_shipyard + num_fed_TMP_shipyard_S
-- Utility Class
--local num_fed_TMP_resourcecollector = NumSquadrons( kCollector ) + NumSquadronsQ( kCollector )
--local num_fed_TMP_resourcecontroller = NumSquadrons( kRefinery ) NumSquadronsQ( kRefinery )
-- Scouts and Probes
local num_fed_TMP_oberth = NumSquadrons( kScout ) + NumSquadronsQ( kScout )
-- other race ships
local num_RD = NumSquadrons( kRD ) + NumSquadronsQ( kRD )
--local num_GB = NumSquadrons( kGB ) + NumSquadronsQ( kGB )
local num_BF = NumSquadrons( kBF ) + NumSquadronsQ( kBF )
--stuff that builds strike craft
--local num_fed_TMP_flag = NumSquadrons( kFlag ) + NumSquadronsQ( kFlag )
--local num_fed_TMP_out = NumSquadrons( kOut ) + NumSquadronsQ( kOut ) - maybe the game notices that it can't be built, becasue these 2 lines are breaking it - no, the following ones break it too hmm
--local num_fed_TMP_flag = NumSquadrons( kFlag )
--local num_fed_TMP_out = NumSquadrons( kOut ) --maybe it's different because they can't be built, try this: nope!
--local num_fed_TMP_flag = NumSquadrons( FED_TEMP_FLAGSHIP )
--local num_fed_TMP_out = NumSquadrons( FED_TEMP_OUTPOST )
--local num_fighter_builders = num_fed_TMP_flag + num_fed_TMP_out + num_fed_TMP_midway
---------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
--count enemy stuff:
local numEnemyFighters = numActiveOfClass( s_enemyIndex, eFighter )
local numEnemyVettes = numActiveOfClass( s_enemyIndex, eCorvette )
local numEnemyFrigates = numActiveOfClass( s_enemyIndex, eFrigate)
local numEnemyDestroyers = numActiveOfClass( s_enemyIndex, eDestroyer )
local numEnemyCarriers = numActiveOfClass( s_enemyIndex, eBuilder )
local numEnemyCruisers = numActiveOfClass( s_enemyIndex, eBattleCruiser )
local numEnemyDreadnaught = numActiveOfClass( s_enemyIndex, eDreadnaught )
local numEnemyBomber = numActiveOfClass( s_enemyIndex, eBomber)
--more counters that weren't in the ST files:
local shipId = FindHighDemandShip()
local BestTarget = HighestPriorityShip()
local totalProd = numActiveCarriers
s_militaryPop = PlayersMilitaryPopulation( s_playerIndex, player_total );
s_selfTotalValue = PlayersMilitary_Total( s_playerIndex, player_total );
s_enemyTotalValue = PlayersMilitary_Total( player_enemy, player_max );
s_militaryStrength = PlayersMilitary_Threat( player_enemy, player_min );
s_enemyIndex = GetChosenEnemy()
-- Utility Class - copy from a HW guy, this is from Tai, but the main stuff is in the AI folder I think, make sure ST guys refer to it too
--salvage barge
local numGreta = NumSquadrons(kGreta) + NumSquadronsQ(kGreta)
if (numGreta < 1 ) then
ShipDemandSet( kGreta, 20)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr Greta: "..numGreta.." > this player needs a salvage point - demand to 20")
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Firehawk at "..demand_firehawk.." ")
Build (FED_TMP_GRETA)
elseif (numGreta > 0 ) then
ShipDemandSet( kGreta, -10)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr Greta: "..numGreta.." > this player has a salvage point - demand to -10")
end
local numControllers = NumSquadrons(kRefinery) + NumSquadronsQ(kRefinery)
local numResourcers = NumSquadrons(kCollector) + NumSquadronsQ(kCollector)
--resource stuff
if (numControllers < 2 ) then
ShipDemandSet( kRefinery, 20)
Build (FED_TMP_RESOURCECONTROLLER)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > add inital demand refinery")
elseif (s_selfTotalValue < 100) and (numControllers > 1 ) then
ShipDemandSet( kRefinery, 0)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > set demand refinery to 0 becasue 2 is enough for now")
elseif (s_selfTotalValue > 100) and (numControllers < 3 ) then
ShipDemandAdd( kRefinery, 5)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > add demand refinery because now player is big enough to start making a third one")
elseif (s_selfTotalValue < 160) and (numControllers > 2 ) then
ShipDemandSet( kRefinery, 0)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > set demand refinery to 0 because 3 is enough for now")
elseif (s_selfTotalValue > 160) and (numControllers < 4 ) then
ShipDemandAdd( kRefinery, 5)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > add demand refinery because now player is big enough to start making a fourth one")
elseif (numControllers > 5 ) then
ShipDemandSet( kRefinery, 0)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Nr controllers: "..numControllers.." > Nr collectors: "..numResourcers.." > set demand refinery to 0 becasue they already have 5 ")
end
--if (numResourcers < 10 ) then
--ShipDemandAdd( kCollector, 10 )
--end
if ((numResourcers / numControllers) < 7) then
ShipDemandAdd( kCollector, 20 )
Build (FED_TMP_RESOURCECOLLECTOR)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand collector based on ratio of 7 to 1 ")
end
--scouts
if num_fed_TMP_oberth < 2 then
ShipDemandAdd( kScout, 21 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand scouts ")
elseif num_fed_TMP_oberth > 5 then
ShipDemandSet( kScout, -10 )
stcgtrace("STCG-trace: Feds: set demand scouts to -10 ")
end
--fighters
if (num_fed_TMP_fighter < 7 ) then
ShipDemandAdd( kInterceptor, 18)
--Build (FED_TMP_FIGHTER)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add initial demand fighters ")
elseif (num_fed_TMP_fighter < (numEnemyFighters + numEnemyBomber)) then
ShipDemandAdd( kInterceptor, 2)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand fighters based on number enemy ")
elseif (num_fed_TMP_fighter > (numEnemyFighters + numEnemyBomber)) then
ShipDemandAdd( kInterceptor, -10)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand fighters by -10 based on having more fighters than enemy's total")
end
--get more fighters
if (num_fed_TMP_fighter < 5 ) and (numEnemyBomber > 8 ) then
ShipDemandAddByClass( eFighter, 5)
Build (FED_TMP_FIGHTER)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand fighters based on number enemy bombers ")
end
-- bombers
if (numEnemyFrigates > 2 ) or (numEnemyCarriers > 2) then
ShipDemandSet( kBomber, 2)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> Set demand bombers at 2 based on number enemy starting to build targets ")
elseif (numEnemyFrigates > 10 ) and (num_frigates > 14) then
ShipDemandAdd( kBomber, 1)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand bombers based on number enemy having some frigates and this player having at least a few more")
-- elseif (numEnemyFrigates > 18 ) and (num_frigates > 14) then
-- ShipDemandAdd( kBomber, 8)
--stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add more demand bombers based on number enemy having butt-load of frigates and this player having at least a little less ")
elseif ((num_fed_TMP_spectre * 4.5) > num_frigates) then
ShipDemandAdd( kBomber, -10)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> this player has 4.5x as many bombers as frigates, reduce demand ")
end
-- Corvettes from hw
if ((s_selfTotalValue > 50) and (numEnemyVettes > ((num_fed_TMP_phantom / 1.5) + (num_fed_TMP_centaur * 0.8)))) then
ShipDemandAddByClass( eAntiCorvette, 0.5 )
ShipDemandAdd( kAcorv, 1 )
ShipDemandAdd( kMissileDestroyer, 0.5 )
Build (shipId)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand anti-corette stuff based on number enemy having lots of corvs compared to anti-corvette stuff ")
end
--centaurs
if ((s_selfTotalValue > 50) and ((numEnemyVettes + numEnemyFighters) > (num_fed_TMP_fighter + num_fed_TMP_spectre)) and (GetRU() > 1500 )) then
ShipDemandAdd( kMissileDestroyer, 3 )
--when this was in they were really building a lot of them
--Build (FED_TMP_CENTAUR)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand centaurs based on getting swarmed by strikecraft ")
end
if (num_fed_TMP_centaur > ((numEnemyVettes + numEnemyFighters) / 5 )) then
ShipDemandSet( kMissileDestroyer, 0 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand centaurs set to 0 based on number of enemy strikecraft ")
end
if (num_fed_TMP_centaur > 10) then
ShipDemandAddByClass( eDestroyer, 6 )
ShipDemandAdd( kDestroyer, 6 )
ShipDemandAddByClass( eBattleCruiser, 5 )
ShipDemandAdd( kBattleCruiser, 5 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> this player is building a lot of centaurs, but start making destroyers and BCs or they'll get sweeped ")
end
-- Frigates
if (((s_selfTotalValue > 70) or (numEnemyFrigates > 3 )) and (num_fed_TMP_akula < 3)) then
ShipDemandAddByClass( eFrigate, 10 )
ShipDemandAdd( kAkula, 10 )
ShipDemandSet( kConst, 0 )
ShipDemandAdd( kMir, 5)
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> add demand for Mirande and Akula - set Const to 0 ")
elseif (num_fed_TMP_akula > 5) and (GetRU() > 1200 ) then
ShipDemandAdd( kAkula, -15 )
ShipDemandAdd( kMir, 17 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> more than 5 akula -15 Akula demand, +17 Miranda ")
elseif (num_fed_TMP_miranda > 4) and (GetRU() > 1500 ) then
ShipDemandAdd( kConst, 20 )
ShipDemandAdd( kAkula, -5 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> more than 4 Miranda start making Const ")
end
-- Klingon Bird of prey, other first
if (((s_selfTotalValue > 120) and (numEnemyDestroyers > 2 )) and (num_fed_TMP_constellation > 3)) then
ShipDemandAdd( kBF, 5 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand start bird of prey based on more than 3 constalations and enemy destroyers ")
end
-- Destroyers
if (((s_selfTotalValue > 85) and (GetRU() > 1600 )) and (num_fed_TMP_constellation > 2)) then
ShipDemandAddByClass( eDestroyer, 16 )
ShipDemandAdd( kDestroyer, 16 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add destroyers based on more than 2 constalations and enough space bucks ")
elseif ((numEnemyFrigates > 10 ) or (numEnemyDestroyers > 2)) then
ShipDemandAddByClass( eDestroyer, 19 )
ShipDemandAdd( kDestroyer, 19 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add destroyers based on enemy frigates and destroyers ")
end
-- Romulan Destroyer, fed ones first and then try to keep a couple around
if ((s_selfTotalValue > 130) and (num_fed_TMP_constitution > 3)) then
ShipDemandAdd( kRD, 18 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add romulans based on more than 3 constitutions and enough space bucks ")
elseif ((num_fed_TMP_constitution / 4) < (num_RD )) then
ShipDemandSet( kRD, -10 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand set romulans to -10 based on ratio to constitutions of 4 ")
end
-- Battlecruisers
if (((s_selfTotalValue > 90) and (GetRU() > 2000 )) and (num_fed_TMP_constitution > 1)) then
ShipDemandAddByClass( eBattleCruiser, 16 )
ShipDemandAdd( kBattleCruiser, 16 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add excelsior based on more than 1 constitution and enough space bucks ")
elseif ((numEnemyFrigates > 16 ) or (numEnemyDestroyers > 3) or (numEnemyCruisers > 1)) then
ShipDemandAddByClass( eBattleCruiser, 18 )
ShipDemandAdd( kBattleCruiser, 18 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add more excelsior based on enemy stuff: 14 frigates or 3 dest or 1 BC ")
end
-- Gorn BC, fed ones first and then try to keep a max of 1 around
-- if (((s_selfTotalValue > 160) and (GetRU() > 3400 )) and (num_fed_TMP_excelsior > 3)) then
-- ShipDemandAdd( kGB, 19 )
-- elseif ( (num_RD ) > 1) then
-- ShipDemandSet( kGB, -10 )
-- end
-- Dreadnaught
if (((s_selfTotalValue > 100) and (GetRU() > 2800 )) and (num_fed_TMP_excelsior > 2)) then
ShipDemandAddByClass( eDreadnaught, 12 )
ShipDemandAdd( kDread, 12 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add DN based on more than 2 excelsior and enough space bucks ")
elseif ((numEnemyFrigates > 22 ) or (numEnemyDestroyers > 12) or (numEnemyCruisers > 4) or (numEnemyDreadnaught > 0)) then
ShipDemandAddByClass( eDreadnaught, 15 )
ShipDemandAdd( kDread, 15 )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add more DN based on enemy stuff: 22 frigates or 12 dest or 4 BC or 1 DN ")
--elseif (num_fed_TMP_excelsior < 3) then
--ShipDemandet( kDread, 0 )
end
--shipyards
if (s_selfTotalValue > 40) and (GetRU() > 1300 ) then
ShipDemandAdd( kCarrier, 15 )
Build( FED_TMP_SHIPYARD_S )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add shipyard based on value and enough space bucks ")
elseif (s_selfTotalValue < 150) and (num_fed_TMP_shipyard_S > 1 ) then
ShipDemandSet( kCarrier, 0 )
--was 80
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand set shipyard to 0 based on size and having two already ")
elseif (s_selfTotalValue > 190) and (num_fed_TMP_shipyard_S < 3 ) then
ShipDemandAdd( kCarrier, 10 )
--was 110
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add shipyard because player is big enough to get rest of shipyards ")
end
--try to get only one or two Midway, maybe only 2 if flagship or outpost is dead
if (((num_fed_TMP_shipyard_S > 0 ) and (num_fed_TMP_midway < 1)) and (GetRU() > 1800 )) and (s_selfTotalValue > 220) then
ShipDemandAdd( kMidway, 32 )
Build( FED_TMP_MIDWAY )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add midway based on no midways, enough space bucks and at least one shipyard ")
end
--heavy shipyard
if (((num_fed_TMP_shipyard_S + num_fed_TMP_midway ) < 2 ) and (GetRU() < 1400 ) and (s_selfTotalValue < 250)) then
ShipDemandSet( kShipYard, 0 )
else if ((s_selfTotalValue > 250) and ((num_fed_TMP_shipyard_S + num_fed_TMP_midway ) > 1 ) and (GetRU() > 1450 ) and (num_frigates > 5)) then
ShipDemandAdd( kShipYard, 21 )
Build( FED_TMP_SHIPYARD )
stcgtrace("STCG-trace: Feds: SlotNr: "..s_playerIndex..">>> demand add heavy SY based on enough midways and SYs, 8 frigates, and enough space bucks ")
end
end
end
Proc_DetermineDemandWithNoCounterInfo = DetermineDemandWithNoCounterInfo_Federation
Proc_DetermineSpecialDemand = DetermineSpecialDemand_Federation
Here’s the ai_upgrades.lua for the federation (same thing, the stuff that’s commented out either didn’t work or was too sucky):
aitrace(">> AI TRACE >> | LOADING FEDERATION UPGRADE INFO")
rt_frigate = {
ST_F_A1,
}
rt_frigate2 = {
ST_F_A2,
}
rt_destroyer = {
ST_D_A1,
}
rt_destroyer2 = {
ST_D_A2,
}
rt_battlecruiser = {
ST_B_A1,
}
rt_battlecruiser2 = {
ST_B_A2,
}
rt_dreadnaught = {
ST_DN_A1,
}
rt_dreadnaught2 = {
ST_DN_A2,
}
function DoUpgradeDemand_Federation()
end
function DoResearchTechDemand_Federation()
--will need bombers for sure
ResearchDemandSet( LIGHTPHOTONS, 2 )
ResearchDemandSet( LANCEPHASERS, 2 )
--just cheat?
--ResearchDemandSet( FED_TMP_CORVETTETECH, 1 )
--ResearchDemandSet( FED_TMP_CORVETTETECH_F, 1 )
--ResearchDemandSet( FED_TMP_FRIGATETECH, 1 )
--ResearchDemandSet( FED_TMP_FRIGATETECH_F, 1 )
--ResearchDemandSet( FED_TMP_FRIGATETECH2, 1 )
--ResearchDemandSet( FED_TMP_FRIGATETECH2_F, 1 )
--ResearchDemandSet( FED_TMP_CAPITALTECH, 1 )
--ResearchDemandSet( FED_TMP_CAPITALTECH_F, 1 )
--ResearchDemandSet( FED_TMP_CAPITALTECH2, 1 )
--ResearchDemandSet( FED_TMP_CAPITALTECH2_F, 1 )
--ResearchDemandSet( FED_TMP_PROTOTYPETECH, 1 )
--ResearchDemandSet( FED_TMP_PROTOTYPETECH_F, 1 )
--put fighters in too
if (Util_CheckResearch(FED_TMP_CORVETTETECH)) and (GetRU() > 200) then
local demand_akula = ShipDemandGet(FED_TMP_AKULA)
if (demand_akula > 0) then
ResearchDemandSet( FED_TMP_CORVETTETECH, demand_akula )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Akula at "..demand_akula.." ")
end
end
if (Util_CheckResearch(FED_TMP_CORVETTETECH_F)) and (GetRU() > 200) then
--local demand_akula = ShipDemandGet(FED_TMP_AKULA)
if (demand_akula > 0) then
ResearchDemandSet( FED_TMP_CORVETTETECH_F, demand_akula )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Akula_F at "..demand_akula.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH)) and (GetRU() > 400) then
local demand_centaur = ShipDemandGet(FED_TMP_CENTAUR)
if (demand_centaur > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH, demand_centaur )
ResearchDemandSet( LIGHTPHOTONS, demand_centaur )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Centaur at "..demand_centaur.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH_F)) and (GetRU() > 400) then
local demand_centaur = ShipDemandGet(FED_TMP_CENTAUR)
if (demand_centaur > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH_F, demand_centaur )
ResearchDemandSet( LIGHTPHOTONS, demand_centaur )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Centaur_F at "..demand_centaur.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH)) and (GetRU() > 450) then
local demand_miranda = ShipDemandGet(FED_TMP_MIRANDA)
if (demand_miranda > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH, demand_miranda*2 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Miranda at "..demand_miranda.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH_F)) and (GetRU() > 450) then
local demand_miranda = ShipDemandGet(FED_TMP_MIRANDA)
if (demand_miranda > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH_F, demand_miranda*2 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Miranda_F at "..demand_miranda.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH2)) and (GetRU() > 700) then
local demand_constellation = ShipDemandGet(FED_TMP_CONSTELLATION)
if (demand_constellation > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH2, demand_constellation*4 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Constellation at "..demand_constellation.." ")
end
end
if (Util_CheckResearch(FED_TMP_FRIGATETECH2_F)) and (GetRU() > 700) then
local demand_constellation = ShipDemandGet(FED_TMP_CONSTELLATION)
if (demand_constellation > 0) then
ResearchDemandSet( FED_TMP_FRIGATETECH2_F, demand_constellation*4 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Constellation_F at "..demand_constellation.." ")
end
end
--klingon ship
if (Util_CheckResearch(K_T)) and (GetRU() > 1200) then
local demand_brel = ShipDemandGet(KNG_TMP_BREL)
if (demand_brel > 0) then
ResearchDemandSet( K_T, demand_brel*4 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Brel at "..demand_brel.." ")
end
end
--
if (Util_CheckResearch(FED_TMP_CAPITALTECH)) and (GetRU() > 1000) then
local demand_constitution = ShipDemandGet(FED_TMP_CONSTITUTION)
if (demand_constitution > 0) then
ResearchDemandSet( FED_TMP_CAPITALTECH, demand_constitution*10 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Constitution at "..demand_constitution.." ")
end
end
if (Util_CheckResearch(FED_TMP_CAPITALTECH_F)) and (GetRU() > 1000) then
local demand_constitution = ShipDemandGet(FED_TMP_CONSTITUTION)
if (demand_constitution > 0) then
ResearchDemandSet( FED_TMP_CAPITALTECH_F, demand_constitution*10 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Constitution_F at "..demand_constitution.." ")
end
end
--Romulan ship
if (Util_CheckResearch(R_T)) and (GetRU() > 1500) then
local demand_firehawk = ShipDemandGet(ROM_TMP_FIREHAWK)
if (demand_firehawk > 0) then
ResearchDemandSet( R_T, demand_firehawk*4 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Firehawk at "..demand_firehawk.." ")
end
end
--
if (Util_CheckResearch(FED_TMP_CAPITALTECH2)) and (GetRU() > 1500) then
local demand_excelsior = ShipDemandGet(FED_TMP_EXCELSIOR)
if (demand_excelsior > 0) then
ResearchDemandSet( FED_TMP_CAPITALTECH2, demand_excelsior*12 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Excelsior at "..demand_excelsior.." ")
end
end
if (Util_CheckResearch(FED_TMP_CAPITALTECH2_F)) and (GetRU() > 1500) then
local demand_excelsior = ShipDemandGet(FED_TMP_EXCELSIOR)
if (demand_excelsior > 0) then
ResearchDemandSet( FED_TMP_CAPITALTECH2_F, demand_excelsior*12 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Excelsior_F at "..demand_excelsior.." ")
end
end
--Gorn ship
-- if (Util_CheckResearch(G_T)) and (GetRU() > 2300) then
-- local demand_grendel = ShipDemandGet(GRN_TMP_GRENDEL)
-- if (demand_grendel > 0) then
-- ResearchDemandSet( G_T, demand_grendel*4 )
-- end
-- end
--
if (Util_CheckResearch(FED_TMP_PROTOTYPETECH)) and (GetRU() > 2500) then
local demand_amb = ShipDemandGet(FED_TMP_AMBASSADOR)
if (demand_amb > 0) then
ResearchDemandSet( FED_TMP_PROTOTYPETECH, demand_amb*15 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Ambassador at "..demand_amb.." ")
end
end
if (Util_CheckResearch(FED_TMP_PROTOTYPETECH_F)) and (GetRU() > 2500) then
local demand_amb = ShipDemandGet(FED_TMP_AMBASSADOR)
if (demand_amb > 0) then
ResearchDemandSet( FED_TMP_PROTOTYPETECH_F, demand_amb*15 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> set demand Ambassador_F at "..demand_amb.." ")
end
end
--armor upgrades
--frigates *2 was too soon
local numFrigate = numActiveOfClass( s_playerIndex, eFrigate )
if ((s_militaryPop > 40) and (GetRU() > 1500) and (numFrigate > 8)) then
inc_upgrade_demand( rt_frigate, numFrigate*1.5 )
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_frigate= "..rt_frigate.." ")
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_frigate= "..numFrigate*1.5.." ")
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_frigate= "..numFrigate.." X 1.5 ")
end
if ((s_militaryPop > 50) and (GetRU() > 2000) and (numFrigate > 15)) then
inc_upgrade_demand( rt_frigate2, numFrigate*1.5 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_frigate2= "..numFrigate*1.5.." ")
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_frigate2= "..rt_frigate2.." ")
end
--destroyers *2,5 was too soon
local numDestroyers = NumSquadrons( kDestroyer ) + NumSquadrons( kRD )
if ((s_militaryPop > 50) and (GetRU() > 2000) and (numDestroyers > 3)) then
inc_upgrade_demand( rt_destroyer, numDestroyers*1.8 )
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_destroyer= "..rt_destroyer.." ")
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_destroyer= "..numDestroyers*1.8 .." ")
end
if ((s_militaryPop > 60) and (GetRU() > 2200) and (numDestroyers > 6)) then
inc_upgrade_demand( rt_destroyer2, numDestroyers*1.8 )
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_destroyer2= "..rt_destroyer2.." ")
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_destroyer2= "..numDestroyers*1.8.." ")
end
--BCs *2,5 was too soon
local numBattleCruiser = NumSquadrons( kBattleCruiser )
if ((s_militaryPop > 50) and (GetRU() > 2000) and (numBattleCruiser > 2)) then
inc_upgrade_demand( rt_battlecruiser, numBattleCruiser*1.9 )
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_battlecruiser= "..rt_battlecruiser.." ")
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_battlecruiser= "..numBattleCruiser*1.9.." ")
end
if ((s_militaryPop > 60) and (GetRU() > 2200) and (numBattleCruiser > 4)) then
inc_upgrade_demand( rt_battlecruiser2, numBattleCruiser*1.9 )
--stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_battlecruiser2= "..rt_battlecruiser2.." ")
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_battlecruiser2= "..numBattleCruiser*1.9.." ")
end
--DNs *2,3 was too soon
local numDreadnaught = NumSquadrons( kDread )
if ((s_militaryPop > 60) and (GetRU() > 2000) and (numDreadnaught > 0)) then
inc_upgrade_demand( rt_dreadnaught, numDreadnaught*1.8 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_dreadnaught= "..numDreadnaught*1.8.." ")
end
if ((s_militaryPop > 70) and (GetRU() > 2200) and (numDreadnaught > 0)) then
inc_upgrade_demand( rt_dreadnaught2, numDreadnaught*1.8 )
stcgtrace("STCG-trace: Fed UPGRADES: SlotNr: "..s_playerIndex..">>> upgrade rt_dreadnaught2= "..numDreadnaught*1.8.." ")
end
end
DoUpgradeDemand = DoUpgradeDemand_Federation
DoResearchTechDemand = DoResearchTechDemand_Federation
This post is getting too long so I’ll post the results in a separate one.