[MOD] ICSing AI

Joined
Jul 31, 2002
Messages
705
Beta Information:

initially this mod component was just to illustrate how the AI can be taken over and made to follow player strats. but it's a lot of fun to run the computer a while and see how far it can go, and can pack a lot of surprises as a player when suddenly the AI just starts plopping cities left and right to you.

all of the code is based off functions i worked on to get the AI to improve its early game for an earth based map scenario.

i'm including beta info because theres a lot of missing stuff still needing to be added. for example, consideration for ghandi who isnt made to ICS, or weight of a civ with the +hammers policy on settling coastal towns. little things like that. the game shouldnt crash using this unless your PC just can't handle all the AI cities, it's very stable and most bugs have been squashed

screenshot of latest tests in second post


Mod:
The AI will now aggressively pursue an ICS strategy: cities will spam the map


Installation:
Download and extract into your documents / my games / civ5 / MODS directory, activate ingame via the mods menu


Compatibility:

compatible with any mods (no editing required InGame.xml gone!), probably the only things that will break this script are:
  • mods that change remove the default settler (this needs settler id = 0)
  • mods that increase the minimum new city distance (needs to be 3)
  • mods that take over control of AI settlers and city build queues (already doing this here)


version history:
Spoiler :

v0.21 - 11/17/10
a little bit more cleaning of the script along with verbose = 0 by default as to not spam your lua.log if you don't want it to

mod package doesn't require InGame.xml to load anymore

v0.2 - 11/13/10
1 turn delay added to citybuild changes which helps to reduce the v0.1 super aggressive expansion

cities building wonders are now more than likely never going to be interupted, also reducing the AIs expansion

settlers losing a settle spot destination are now reset in realtime, instead of on the next turn. with the delay the game's AI took over and would lag the game 10-15 secs as it tries to find a right spot to settle, only to leave the settler on the same tile. speeds up the game because the game's AI can't fanthom icsing

functions stop working if settling spots == 0

script rewritten to be more reader friendly, and a number of nil value checks, table values and the likes redone to reduce lua warnings and a lot more verbosity left in for the lua output

v0.1 - 11/10/10
initial release


notes/todo:
Spoiler :
improve the scoring method
lower plot dest score if there's a resource on it
more/better canfound checks for found capable units
event based war scoring change
embark checks for archipelago maps
add more build/train management for needed happy/culture buildings and for military units when needed
maybe take over workers for trade posts as well


bug reports, suggestions, and feedback (especially the city build stuff) most welcome
 

Attachments

screenshot

Spoiler :


v0.21 standard pangea, quick speed, emperor

ics06.jpg


russia:
55 cities, 3837 score, 104 units, 16 policies
Science: 1857 Gold: 5489 (+573) Happiness: 87 GA: GOLDEN AGE! (1) Culture: 2346/4160 (+374)


persia:
13 cities, 1216 score, 37 units, 15 policies
Science: 394 Gold: 493 (+95) Happiness: 67 GA: GOLDEN AGE! (37) Culture: 792/2230 (+138)


aztecs:
13 cities, 775 score, 25 units, 8 policies
Science: 158 Gold: 9 (+37) Happiness: -1 GA: 224/1255 Culture: 1449/1435 (+45)
 
Nice! Personally I just modded ICS to be a bad strategy. But I'm definately going to be looking through your mod to see how you accomplished this ;)
 
Nice! Personally I just modded ICS to be a bad strategy. But I'm definately going to be looking through your mod to see how you accomplished this ;)
ya ics i find it to be cheesy but theres so much discussion on it in general forums you'd think it's the insta-win strat for players. so why not push the AI to do the same, if not better? and it does so well, especially on higher difficulties with the bonuses AI get :evil:

v0.2 uploaded, much more logical and friendly readable code vs the 0.1
 
AI's don't get the happiness penalties so if you get an AI to do this properly the system breaks entirely.
 
AI's don't get the happiness penalties so if you get an AI to do this properly the system breaks entirely.

do you mean compared to a player's happiness settings?

of course the AI is going to run rampant on it's own, given the bonuses at higher difficulty, it's a given. but i dont see how at all it can be said "system breaks entirely".

i've yet to see it breakdown ever. i've seen runaway bugs kill the game, but never a die for the AI. even with my own player intervention ( and i dont play as well as the deity guys ) the AI becomes a superpower and dominates.

there's a few rare cases where the system 'can' break (by setting up things using cheats), and this is still in beta, and these breaks won't normally happen, ignoring all that, in the normal course of things what's going to happen is that the AI will expand steadily until it reaches the max settle/city preset value, stop using this mod components functions, and then automatically be reverted to the AI's vanilla (or modded) expansion value
 
Back
Top Bottom