• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.
Resource icon

Delnar's AI Cleanup 2016-11-06

An average videogame programmer earns roughly 100k USD a year and gets treated like dirt. An AI expert can easily ask for 200k per year, and if Firaxis/2K start giving them lip, they can easily jump ship to a company that doesn't treat them terribly (Google, Facebook, and Intel are always on the lookout for this kind of talent); in real terms, this usually means that if said expert would have to work the same schedules as videogame programmers, they would actually ask for something around 300k per year at least (this includes overtime and crunch that is standard for videogame development). For that price, 2K can just hire two generic programmers to make a superficial OK-looking AI (people don't really have high expectations), spend a bunch on a celebrity voice actors who players will immediately recognize to sell more copies, and still have money left over.

Most AI experts work best when they're working with neural networking architectures (also called "deep learning" by marketing people). In fact, even when such architectures aren't used, being able to rely on heuristics and a static ruleset makes all AI programmers' lives easier; this is why CPP was able to get its decent AI through 4+ years' of work from 2+N programmers (2 main as Gazebo and Ilteroi, N supplement/groundwork as ninakoru, notque, and myself to name a couple), since BNW had a well-established system for unit control. However, all of this goes out the window for a game in active development: fundamental rules can change on a weekly basis, possibly invalidating months' work of neural net training and heuristic development. As such, I would estimate that even with good AI programmers, developing a good AI for a Civ game would require having at least two of said programmers work on the AI from the start of the development cycle. If we are to take Civ6 as an example, it has been in development roughly since the release of Civ5. That's 6 years' development x 2 programmers x 300k USD per year = 3.6M USD extra just spent on AI development... and that's not counting the extra overhead and management costs for a dedicated AI development system. There are way better returns on a 3.6M USD investment for 2K than employing dedicated AI programmers.

That's quite a substantial sum of money. I wonder if they just rely on modders to fix it for free. Do you know if they are going to allow modders to fully access the AI and actually change it?
 
This has been my belief about how Bethesda does their Elder Scrolls games. I consider them to just do the world building and let modders fix everything else.

Bethesda even gave the Unofficial Patch Project Team a beta version two weeks before the Skyrim Special Edition release. So that they could convert the Unofficial Patch to the Special Edition.


Civ6 was released to early they just did what they could to release it on time.
 
That's quite a substantial sum of money. I wonder if they just rely on modders to fix it for free. Do you know if they are going to allow modders to fully access the AI and actually change it?
I'm guessing that's their intention, but that intention won't actually be fulfilled because 2K does not realize that the DLL source code their lawyers don't want released is precisely what modders need to make any sort of substantial AI change.

Civ6 was released to early they just did what they could to release it on time.
It's not that Civ6 was released too early, it's that Civ6 was released incomplete. This was more apparent in previous Civ games because the incompleteness was spread throughout all systems, but in Civ6, it's concentrated on a few key ones. In addition to AI problems, have you wondered why the tech tree is so sparse and prone to beelining? Why the only civ with multiple leaders is Greece (it's because Firaxis actually couldn't figure out how to do this, so they used a hack-ey solution for Greece that works only because Greece is the only civ with multiple leaders)? Why around 90% of the game's beliefs are copies identical to beliefs from Civ5 even though the two games have vastly different yield balance? Why ideological combat is just a copy of regular combat but with only 3 units to choose from, instead of being something completely different and new? Why the UN, a constant feature of civ games since Civ2, is not in Civ6? Why barbarians still spawn and move on the same turn in simultaneous mode, even though the solution to this literally took me all of 5 minutes to write for Civ5?
 
I'd asked this question before but I think it got buried when it come to the values in Leaders.xml:

<Update>
<Where ListType="DefaultSavings" Item="SAVING_UNITS" />
<Set Value="2" />
</Update>
<!-- Adjusted default flavors a bit as an experiment, active defense flavor should be more than city (passive) defense flavor anyway. -->
<Update>
<Where ListType="DefaultFlavorList" Item="Offense" />
<Set Value="6" />
</Update>
<Update>
<Where ListType="DefaultFlavorList" Item="Defense" />
<Set Value="4" />
</Update>
<Update>
<Where ListType="DefaultFlavorList" Item="Expansion" />
<Set Value="7" />
</Update>

Do lower values have a higher priority or higher values? becuase from some of the other code it appears that lower values cause the AI to execute them first and that higher values are last... can anyone confirm this?
 
I'd asked this question before but I think it got buried when it come to the values in Leaders.xml:

<Update>
<Where ListType="DefaultSavings" Item="SAVING_UNITS" />
<Set Value="2" />
</Update>
<!-- Adjusted default flavors a bit as an experiment, active defense flavor should be more than city (passive) defense flavor anyway. -->
<Update>
<Where ListType="DefaultFlavorList" Item="Offense" />
<Set Value="6" />
</Update>
<Update>
<Where ListType="DefaultFlavorList" Item="Defense" />
<Set Value="4" />
</Update>
<Update>
<Where ListType="DefaultFlavorList" Item="Expansion" />
<Set Value="7" />
</Update>

Do lower values have a higher priority or higher values? becuase from some of the other code it appears that lower values cause the AI to execute them first and that higher values are last... can anyone confirm this?
In almost all cases, higher number = higher value for flavors, but higher number = lower priority or later order for priorities and sequences. The problem is that I don't know which one applies to the DefaultSavings items: I don't know if the categories (units, plots, splurge, etc.) are ordered by priority or as flavors.
 
Yeah, I'm afraid the AI is overdoing the settling at the moment. Ran an observer game, and Brazil kept on pumping out settlers which were immediately captured by barbs. 100 turns in and Rio de Janeiro is surrounded by over a dozen barb settlers, and they keep on sending them!
 
MH6l36x.jpg


yup, they are spawning them kinda too frenquently
 
One thing I modded was giving warriors and slingers a maintenance cost of 1, seems to have reduced the ai spamming **** tonnes of them . . Maybe it could be done to settlers as well ?
 
One thing I modded was giving warriors and slingers a maintenance cost of 1, seems to have reduced the ai spamming **** tonnes of them . . Maybe it could be done to settlers as well ?
Won't actually do anything. Military unit pseudoyields are controlled by MilitaryAI keeping track of unit maintenance per military strength. Settler unit pseudoyields aren't controlled by MilitaryAI, and Military is the only AI subsystem that cares about unit maintenance.
can we please have v.2 of this mode...it was working just fine untill settler changes in v.3
Hmm, guess that's an interesting thing to note. Looks like the AI's settler pseudoyields are heavily regulated by the cap on Settle operations, so increasing pseudoyields while also removing the cap results in the observed behavior. I think I'll lower the cap to 2 (number of extra settlers Deity gets) so that the AI doesn't start building new settlers when it has existing ones out, because it turns out that the AI subsystem that decides what to produce doesn't take existing settlers into account when purely weighing settler pseudoyield.
 
Hello!
My big respect for this mod.
As far as i understand - to fix settler spawn we need to add line corresponding to to settelrs cap.
Sry - wasnt able to find that line in mod files.
Would you be so kind, to give me a clue - what table and param should be tweaked? This can be done from SettlerLove.xml ?
thx
 
Ah! So that explains why my current game has been swimming in settlers! I've captured so many of them I've been having to delete them to keep up. Russia has been sending them ahead of their troops in a kind of human wave thing (seriously, it has!). I came across India producing settlers rather than combat units and Norway having a few too many as well. Russia has also been sending great people around combat zones too. No one else that I've seen so far, but Russia has. That was new after the current version of the mod so far as I could tell. At least I'd never come across it before.
Still, been liking this mod so far. There has been a definite difference in the way the AI has been behaving overall, for the better.
 
I don't know if this has been brought up in this thread yet or not but adding a 1 gold maintenance on slingers and warriors does seem to cut down on the silliness of warrior spam from the ancient era. And it may just be my perception or some other improvements in this mod but it also appears my AI is upgrading more units.

Although I'm playng with slower tech, faster production and a little bit more gold on some of the bonus tiles.... so the upgrades may be influenced by that.

I too am noticing settler spam... which is an improvement over the extreme lack of settlers from before. At least the world is filling up in the first 2-3 eras... but is there a way to tell the AI to stop building settlers once there are no available spots?

Lastly the AI seems to be incredibly hesitant to attack. I think they are trying to preserve units by refusing to take bad trades, and with the lower priority on ranged units it makes them spam melee and then stand around and try to heal while my crossbows just chew threw the wall of meat.

All of this is not criticizing this mod rather just pointing out current flaws in the AI that I'm hoping can be addressed.

Also I'm convinced from my own playing that adding +1 movement to all units drastically improves the AIs ability to use the few ranged units it does make. Id encourage others to try it.
 
Uploaded v7. It has a few extra goodies in addition to the settler cap thing, so check the changelog.

I don't know if this has been brought up in this thread yet or not but adding a 1 gold maintenance on slingers and warriors does seem to cut down on the silliness of warrior spam from the ancient era. And it may just be my perception or some other improvements in this mod but it also appears my AI is upgrading more units.

Although I'm playng with slower tech, faster production and a little bit more gold on some of the bonus tiles.... so the upgrades may be influenced by that.

I too am noticing settler spam... which is an improvement over the extreme lack of settlers from before. At least the world is filling up in the first 2-3 eras... but is there a way to tell the AI to stop building settlers once there are no available spots?

Lastly the AI seems to be incredibly hesitant to attack. I think they are trying to preserve units by refusing to take bad trades, and with the lower priority on ranged units it makes them spam melee and then stand around and try to heal while my crossbows just chew threw the wall of meat.

All of this is not criticizing this mod rather just pointing out current flaws in the AI that I'm hoping can be addressed.

Also I'm convinced from my own playing that adding +1 movement to all units drastically improves the AIs ability to use the few ranged units it does make. Id encourage others to try it.

Attack hesitance is extremely difficult to precisely judge and even harder to improve without access to CvGameCoreDLL's source code. As for the rest, they're a result of Civ6 largely using Civ5's AI code: much of Civ6's AI code is recycled from Civ5, so it was written with certain assumptions in mind that don't necessarily apply to Civ6 (all military units cost gold maintenance, movement points are spent after moving into a tile instead of as a requirement before you move into a tile). Besides altering Civ6's game rules to resemble Civ5's, we cannot do anything about these AI problems until CvGameCoreDLL's source code is released.
 
Most of the issues with the simple problems that they didn't fix come down to Firaxis being a top-heavy organization.

When developer time is closely managed by suits at the top, simple things aren't given the short amount of time that is needed to fix them.

The logistical effort of sorting those small issues into a manageable priority list also requires a manager-level decision if everyone is being micromanaged. Not to mention that the core systems for the game probably on a tight schedule.
 
Uploaded v7. It has a few extra goodies in addition to the settler cap thing, so check the changelog.



Attack hesitance is extremely difficult to precisely judge and even harder to improve without access to CvGameCoreDLL's source code. As for the rest, they're a result of Civ6 largely using Civ5's AI code: much of Civ6's AI code is recycled from Civ5, so it was written with certain assumptions in mind that don't necessarily apply to Civ6 (all military units cost gold maintenance, movement points are spent after moving into a tile instead of as a requirement before you move into a tile). Besides altering Civ6's game rules to resemble Civ5's, we cannot do anything about these AI problems until CvGameCoreDLL's source code is released.

You're incredible dude!
 
Back
Top Bottom