[bug?] ai not scouting w/ colonizers, aishipclassdefs only allows single <aishipclass>/ship

someone asked about AI making colony ships go scouting when I recently posted a balance overhail mod for insane loose & occasional/common maps... so I started looking a bit & ran into what seems to be a limitation in the code itself that handles aishipclassdefs.xml.  Here are two examples from it:

A terran Scout
<ShipClass>

<InternalName>TerranScout</InternalName>
<DisplayName>TerranScout_Class_Name</DisplayName>
<Description>TerranScout_Dec</Description>
<ThumbnailOverride>Temp_Terran_Scout_Alpha_01.png</ThumbnailOverride>
<ShipHullType>Tiny</ShipHullType>
<ShipRule>Scout</ShipRule>
<ShipDesign>Terran_Scout_01T</ShipDesign>
<AIShipClass>Scout</AIShipClass>
<StrategicIcon>Scout</StrategicIcon>
<BlueprintDef>ScoutBlueprint</BlueprintDef>
</ShipClass>

A terran Colony Ship

<ShipClass>

<InternalName>TerranColony</InternalName>
<DisplayName>TerranColony_Class_Name</DisplayName>
<Description>TerranColony_Dec</Description>
<ThumbnailOverride>Terran_Colony_Alpha_01.png</ThumbnailOverride>
<ShipHullType>Cargo</ShipHullType>
<ShipRule>ColonyShip</ShipRule>
<ShipDesign>Terran_<AIShipClass>Scout</AIShipClass>Colony_01T</ShipDesign>
<AIShipClass>Colony</AIShipClass>
<StrategicIcon>ColonyShip</StrategicIcon>
<BlueprintDef>ColonyBlueprint</BlueprintDef>
</ShipClass>

while most of the sml files are more than happy to take extra entries for stuff that makes logicalsense, and it seems that logically  setting a colony ship to "<AIShipClass>Scout</AIShipClass> <AIShipClass>Scout</AIShipClass>" ob two lines would make its primary role colonizing, but lacking a suitable/desirable colonizable planet, it makes a nice scout until then.  Unfortunately, making that change bombs out at launch due to invalid entries.

 

Since it seems like the code is already there for each individual function, perhaps all it needs is to accept duplicate entries and an if $ShipPrimaryClassRoleAvail==0 then $checkSecoondaryRole else, $IdleShip type check?

5,285 views 7 replies
Reply #1 Top

It's not a bug; ships have 1 AI ship class. It's not just used for determining what the ship does, but also for the build queue, so having multiple entries breaks stuff. Ideally, the devs should just set the colony ship AI to explore if no planet is available, like survey ships do when there's no anomalies. 

Reply #2 Top

Quoting naselus, reply 1

It's not a bug; ships have 1 AI ship class. It's not just used for determining what the ship does, but also for the build queue, so having multiple entries breaks stuff. Ideally, the devs should just set the colony ship AI to explore if no planet is available, like survey ships do when there's no anomalies. 

Did not know on the build queue, I've been going about tweaking the ai for the next release of ILO in a very different manner than you have in IAB, which is freaking cool for possabilities when it's all said and done :D

Reply #3 Top

I look forward to reading the code. Maybe one day I'll actually play the damn game again... but for most of the previous week I've been sat watching endless soaks and praying the AI picks good techs ><

Reply #4 Top

Quoting naselus, reply 3

I look forward to reading the code. Maybe one day I'll actually play the damn game again... but for most of the previous week I've been sat watching endless soaks and praying the AI picks good techs ><

 

I know the feeling, I'm doing 100-150ish turn soaks with each of the base/default factions to track the general paths they take down the tech trees.  a couple things the techcost multipliers I put in dramatically changes with the ai is that their enpires tend to be a little more tall with more stable foundations. I think that I'll save the soaks & post the tech pathways along ith links to the savegames for Brad siimply because insane maps with 20-30ish ai races 100-150 turns of soaking.  Surprisingly, 200-500ish turn soaks didn't cause any economies to collapse by then & the wider StarbaseRange at 10 dramatically reduces what some people have called "ai starbase spam" with nobody having >10 starbases )most <5).  Although bumping AdditionalCostPerStarbase to 8 (was 0?) after the raised 20 free starbases (up from 4?) might impact that

Reply #5 Top

At some stage, you're probably gonna have to wade through the tech defs and adjust the weights; the basic ones don't make an awful lot of sense. For example, Institutional Research:

 

<AICategoryWeight>
<Military>20</Military>
<Growth>16</Growth>
<Tech>22</Tech>
<Diplomacy>8</Diplomacy>
<Expansion>16</Expansion>
<Wealth>10</Wealth>
<Influence>12</Influence>
<Fortification>14</Fortification>
</AICategoryWeight>

 

The high tech score makes sense... but I'm not sure where 20 military is supposed to be about. Compare with Zero Grav construction:

 

<AICategoryWeight>
<Military>18</Military>
<Growth>16</Growth>
<Tech>10</Tech>
<Diplomacy>8</Diplomacy>
<Expansion>20</Expansion>
<Wealth>8</Wealth>
<Influence>14</Influence>
<Fortification>12</Fortification>
</AICategoryWeight>

 

So... influence is 2 higher, wealth 2 lower, military 2 lower... yeah. Or the Harpoon missile:

 

<AICategoryWeight>
<Military>20</Military>
<Growth>14</Growth>
<Tech>8</Tech>
<Diplomacy>6</Diplomacy>
<Expansion>16</Expansion>
<Wealth>18</Wealth>
<Influence>10</Influence>
<Fortification>12</Fortification>
</AICategoryWeight>

 

 

Because, as we all know, missiles are all about making lots of money, right? Note that the military value of the tech is the same as it is on Institutional research. 

 

 

The thing is, if you look in the Drengin file, you see something rather different - the drengin weights on ZGC are:

 

<AICategoryWeight>
<Military>100</Military>
<Growth>5</Growth>
<Tech>5</Tech>
<Diplomacy>5</Diplomacy>
<Expansion>50</Expansion>
<Wealth>5</Wealth>
<Influence>5</Influence>
<Fortification>50</Fortification>
</AICategoryWeight>

 

 

 

 

Note the massively different scales involved in this weighting scheme. The Drengin have been more or less pointed directly at a few killer techs that they ought to acquire by around turn 100. Most of the others sort of putter about through tech; they've never got too small a chance to pick something, so they can pick more or less anything at any given time. They might choose a good one... but they might equally pick something completely inappropriate. This is basically how you have to code it if you only have a small number of scripts throughout the whole game, as 1 scripts has to cope with all situations across anything upto 100 turns. 

 

Having added so many scripts, each of which can alter the default tech choices differently, I can actually start to give the AI some tech strategies, teaching one to go for, say, engines early so their colony ships are better, while another builds up their planetary infrastructure so they can play a 'tall' strategy - and yet another can rush military tech and build an early military. But that did require going through every tech in every tech file to re-calibrate the weighting. I read about 150,000 lines of xml over the weekend... twice, so I could put them into a decent spreadsheet, play with the values, and then go back and change them all.

Reply #6 Top

Quoting naselus, reply 5

At some stage, you're probably gonna have to wade through the tech defs and adjust the weights; the basic ones don't make an awful lot of sense. For example, Institutional Research:

I know, that's why I'm getting baselines.  The weights are currently pretty bizarre as you noted.  it doesn't help that the scales are so wildly different from race to race (i.e, drengin interstellar travel has 50 military, growth, tech, diplomacy, expansion, wealth, influence, and fortification while xenocommerce is 100 everywhere by a 1 in fortification)the numbers don't get much more clear deeper/elsewhere in the tree as you noted, a lot of other races have values in the 1x/2x range.  I half wonder how many techs have given weights simply because they were built on templates from a second copied tech... with 400some techs per faction's tech tree, that will quickly result in the values becoming meaningless & only getting reasearched through a combination of trade & random luck after enough copy of 'similar' that was copied from 'similar', that was copied from 'similar'.

I wonder if Brad or someone will jump in and  tell us a little about why the numbers are so scattered or where/how he envisions them being at some point down the line.  I'm sure that between the two of us, we could get some nice baselines going for at least the early game if we knew more than what we've been able to gleen through anecdotal evidence in soaks

Reply #7 Top

Any chance you can look at the Reapers (custom race) and see what they did right? The Reapers have consistently been at or near the top in my games.  As have the Collectors.