1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Buffed AI for BNW

Discussion in 'Civ5 - Mod Components' started by glider1, Jul 28, 2013.

  1. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Here's a small mod component for people that want a more potent AI for BNW that handicaps humans in a better way than the default game which I think is lame because it limits the range of game play options available to humans on higher difficulties. One of the things this mod does is to adaptively buff the AI as the game goes on, so that the AI remains competitive with the player.

    Here is a list of changes:

    • Difficulty:
    • AI difficulty level adjusts during game by floating the per-era-modifier. Notification of difficulty level change sent to player.
    • AI no free techs

      Military:
    • Human range attack both cities and units nerfed 20% and possibly further for range-3 land and sea against enemy AI units not cities
    • Human strength of city and units decreased by 25%
    • AI major civs (not minors or barbs) get a combat attack bonus of 25% against anything human or not.
    • Siege units start with cover promotion
    • AI gets no free promotions (must earn them)

      AI:
    • AI guards its workers better
    • City states start with a warrior that will protect their worker when it is built
    • Barbarians most likely will not capture AI settlers but will still take their workers
    • AI less likely to get involved in third party war
    • Reckless expansion modifier engages for both tall and/or wide
    • AI takes the nerfs to human combat into consideration when planning a war
    • Smart Mod by Ninakoru

      Gameplay:
    • If timed VC is turned on but nothing else, AI behaves as if it could win by its desired VC, and launching space ship grants points instead of ending game.


    The mod modifies the DLL and is not compatible with mods that change the DLL. The mod is also NOT multiplayer compatible. The various features of this mod can all be adjusted in the XML files (ask on forum for details). See post below for a list of version changes to this mod.
     
  2. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Change log:
    V20
    • Switch over from an adaptive buff to an automatically adjusting difficulty concept.
    V15
    • Dynamic AI buff algorithm improved to handle all play styles from tall or wide players
    V14
    • Dynamic AI buffs only when AI is happy
    V13
    • AI bonuses only kick in when the AI falls below a dynamically calculated threshold (All games at all difficulties and all game speeds will always be competitive).
    • AI war declaration probability against humans reduced to compensate the AI's new calculation of players strength.
    V12
    • AI factors in nerfs to human combat when deciding whether to DOW
    • AI less willing and asks for more when offered a third party war trade deal
    • AI remaining bonus in happiness from number of cities and population removed
    • AI policy bonuses removed
    • AI research rate bonuses removed before the renaissance
    • AI bonuses to combat experience removed
    • Deity AI per era bonus increased
    • AI science per era curve shifted to kick in one era sooner
    • Human strength reduced by a further 5% to compensate AI loosing it's combat experience bonus
    V11
    • Introduce ability to customize human strength and attack against the AI both unit and city
    • Blend in some customizable AI offensive attack but not as much as before
    • Remove AI unit replenishment buffs like unit costs, because it has too many side effects that unbalance the game and the AI is doing well enough on default unit replacement buffs (NOTE: the code is still there if you want to enable it, I just commented it out)
    V10
    • Includes support for all difficulty levels with Emperor currently receiving the most attention
    • AI offensive bonus applies in all territory including home soil
    • AI unit costs reduced to help it replenish troops on defence
    • Fixed a bug where the AI was not getting the offensive bonus in one case
    V9
    • Smart-AI mod by Ninakoru (thanks)
    • Improved the algorithm for buffing the AI's per era science rate
    • Humans get only indirect fire when attacking units with ranged at range 3. In practice, this means unit damage at range 3 will randomly vary from 0% up to the NERF_HUMAN_RANGED setting. Attacking cities at range-3 is unaffected, as are lesser ranges.
    • Fixed bug that allowed the AI to get offensive ranged attack bonus against another AI.
    V8
    • Immortal/Deity AI gets 5%/10% boost to unit creation, supply, upgrade over v7
    • Immortal/Deity per era bonuses to AI increased by ~10%/20% over v7
    • AI offensive attack bonus increased by 8% across the board over v7
    • Immortal/Deity AI more likely to attack humans by 10% over v7
     
  3. makrisgialos

    makrisgialos GREEK REBEL

    Joined:
    Jan 20, 2007
    Messages:
    256
    Location:
    GREECE
    sounds nice,true,AI could be more aggresive.
    Have you tested it yet or not?If yes,what are your conclusions?
     
  4. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Hi Makrisgialos
    Yes tested it a few times. At 115% the AI will be more likely to DOW but it is still conservative. Basically this mod does this:

    The number of units we loose from their strong attack is approximately equal to the number of units the AI looses from stupidity

    So the contest is much more even. Another benefit of this mod is that barbarians are also stronger against humans and so you cannot as easily use them for target practice! I think emperor is as difficult as deity on combat but more balanced economically between the human and AI. The main problem with this mod is that I think defense is still easier than offense.

    If you like a challenge, this mod is for you but it is painful at times!

    Take note however. If you go to war on the AI, make sure to have it properly prepared. Military buildings to increase experience are essential. Correct promotion choices are essential. Healers are essential. Front-line roads are essential. A great general is essential. Naval support is essential. Pillaging is essential. Skillful diplomacy is essential.

    The mod is set up for emperor but if you edit the XML file handicaps.xml you can set it up for any difficulty level.

    If anyone thinks it needs changes or more features say so. The mod does nothing but increase the AI's attack strength and DOW probability, but only when an AI is attacking a human.
     
  5. makrisgialos

    makrisgialos GREEK REBEL

    Joined:
    Jan 20, 2007
    Messages:
    256
    Location:
    GREECE
    well sounds nice cause i got very rarely defeated by AI aggression in war.On 95% of the cases,i won,even if the AI had technological advance.
    However:i see 2 files.which should i install?
    Also,please tell me what kind of xml files should i test in order to make some experiments of my own?
     
  6. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    I've uploaded only the latest version and instructions are in the second post. Keep in mind that this mod could still use adjustments and using this mod makes the game significantly more difficult (probably two levels) but try to enjoy it anyway!
     
  7. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Uploaded version 3 and adds King difficulty (tested today) to complement Emperor.

    AIDeclareWarProb = 125% is about where Gods and Kings was at for the ancient age rush, but in this mod the AI's attack is suitably stronger and they have more chance of making it work.

    AI attack strength increase is capped at 100% even if AIDeclareWarProb > 125%.
     
  8. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Just won a challenging and fun turn 316 information age diplo victory with this mod as the Byzantines on King 8+8 civs on a small communitas continents map capturing seven cities and two capitals along the way. First capital America fell to longswords and trebs plus roads and a lot of planning. In the information age I had to take Russia's capital out with mobile artillery and tanks otherwise Cathy would have won a diplo.

    The trick is to bring extra units and prepare any wars really well. I'm normally an immortal level player playing on king. Emperor would be a real challenge on this mod.
     
  9. Jdoug312

    Jdoug312 Chieftain

    Joined:
    Jul 20, 2013
    Messages:
    263
    I definitely intend to try this mod out as soon as I'm finished with this current game.
     
  10. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    It's a pity a mod like this is needed, but the AI's combat is really really weak. The main disadvantage of this mod that I can see is that the damage an AI does to a human unit is visually unrealistic. For example an AI Great War Bomber almost sunk one of my destroyers with one attack forcing it to withdraw.

    Another tip is to increase home territory defense if you are going to go off and fight a distant war. Last night I captured an information age capital but at the same time Shaka DOWED my home territory. Without proper defense he would have captured a city fairly easily. At the end of the day the human simply cannot neglect military and military buildings.

    The mod is only setup for King and Emperor keep that in mind.
     
  11. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Tip for anyone playing this mod. What has frustrated me with civ generally is that some start positions on King difficulty are as difficult as immortal and some immortal starts are as easy as king. What you can do with this mod is start a game, play through a few turns and make a judgement about how easy or difficult you think it will be.

    Then exit the game and change the line:
    <AIDeclareWarProb>115</AIDeclareWarProb>
    To a number that you think better matches the difficulty of the start.

    For example sometimes on Emperor the game starts me as the Zulu's against Brazil on an isolated continent. That is way too easy! So I exit out and change AIDeclareWarProb up from 115 to 125. Now Brazil's combat strength and DOW probability are both increased by this mod, and the game becomes about what I would expect in difficulty.

    Have double checked this. So long as you save, exit out of the game, change the number in /mods/Buffed AI/handicaps.xml and go back to your game, Civ5 updates it without causing any problems. Matter of fact you can do this at any stage during the game.

    Don't turn up AIDeclareWarProb too high though, because it starts making the game easy again. This is because the AI will now DOW you for sure, possibly stuff the attack up and then will be weak to other AI's.
     
  12. Marcatus

    Marcatus Chieftain

    Joined:
    Aug 31, 2013
    Messages:
    2
    Thank for yyour work.
    I have been trying to find mods to help make BNW more enjoyable and this mod will surely be helpful.

    I have few question:
    How do i get the xml file, i don't see any download link?(i'm newbie here).
    Should i open a notepad, copy the data in post # 2 and save it in my document MODS folder...


    I know at {AIDeclareWarProb 100%} the attack strength is increased by 50% but by how much does it increases the "probability" to declare war?

    Lastly, can i increase the probability to declare war without increase the attack strength?
    Can u make it work for also immortal and deity difficulty?

    I want to have a game in immortal using this mod and planning for a domination victory.Using this mod i expect the ai to declare war more on me, but i'm also weary that its attack strength might be too much for me.
    So I probably would like it to be like Attack strength increased by 25% or 50% and probability to declare war doubled compare to a normal game.
     
  13. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Hi Marcatus welcome to Civfanatics enjoy it! This mod is out of date and I removed it until Firaxis (the company that makes this game) releases the latest code so that modders can update their mods.....

    In the meantime the question remains how to make the AI's attack stronger so that we don't have to play a strict Diety game where most of the fun strategies are unavailable and we can play creatively with any civ on diety.

    So suggest you do as I am doing at the moment while we wait.....

    Play around with the file CIV5HandicapsInfos.xml. There is a lot you can do with that file to make the game more creative. Attached is an experimental file that does this. I'm a pangaea type player so the changes suit my style.

    1) The AI starts diety without any free techs. That means we have a chance to build a variety of different wonders and we don't have to always just capture them off the AI.

    2) Human starts with the same happiness as the AI on diety! That means we have lots of creative expansion options that are more fun even if they are not optimal in a strict sense.

    3) On diety the AI retain's it's initial defense against barbarians and humans.

    4) On diety the AI's expansion and population growth is more restricted so that humans are not always so far behind and we don't always have to play the same strictly optimal repetitive social policy openers to keep up in population growth.

    5) On diety the AI's retains help funding it's military

    The change means that Diety is more like emperor in fun options but more difficult like immortal

    The negative is that the game slows down more because the AI has many more units than we theoretically would want.

    That was the beauty of my Buffed AI mod that meant we didn't have to give the AI so many units just to make it competitive.....

    I haven't changed AIDeclareWarProb this time round because on Diety the AI is naturally more aggressive.

    Attached is an experimental handicap modification for play on Diety ONLY
    Note: you manually replace the game's original handicaps file with your modified one.
    I could make a mod to do this automatically but I'm too lazy.
    Enjoy experimenting
     

    Attached Files:

  14. Marcatus

    Marcatus Chieftain

    Joined:
    Aug 31, 2013
    Messages:
    2
    Thank You for the reply and your wok. I gonna try the mod now.
    Just to make sure I need to replace the original CIV5HandicapsInfos.xml in "Civilization V\Assets\Gameplay\XML\GameInfo".

    U know i watched a lets play of civ on youtube. It was deity difficulty ,though continents map, and the ai did not attack the player not ONCE despite having a weak military through the whole game. The player won by scientific victory.Yet the lead ai had twice the amount of points compare to the player's, yet it did not do anything to stop him. It was a total disappointment to me, it make civ 5 seems just like a game where u "build" stuff only.

    On deity the ai have so much advantage yet they can't ( not coded to) use it.....it's brutal to me.
    I mean there should be like "checkpoints" where the ai automatically knows weather u are close to scientific,diplomatic, domination victory.And it would do anything or "something" to stop the human player.

    For example, they could make a checkpoint: when the human player is 3 or 4 research away to scientific victory the ai would attack him no matter what!!! or do "something" to stop the player
    Simple tweak that could make the ai seems smart.

    Civ is truly a great strategic game,but what's the point when u don't have great challenging opponent to play it. Multiplayer has complications and it is not as stable and flexible as single player. So most people play the game against the ai which still needs quite a bit of improvement.

    Hopefully with this mod i might enjoy BNW a bit more, thanks
     
  15. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Main thing Marcatus is there are things we can do even without the latest code.

    Put the modified handicaps file CIV5HandicapInfos.xml into:
    \Assets\DLC\Expansion2\Gameplay\XML\GameInfo

    Expansion2 is where the handicaps file is in BNW.

    If there is any options in the handicaps file you wan't more information on I can explain it.

    Since the AI is not better, we have to use sheer military power to get the AI to attack. That is not hard to achieve. In the handicaps file you can determine how cheap it is for the AI to build a military and how cheap it is to support a military.

    So for example, you could make an emperor game exactly the same as emperor but with diety level military size. I recommend trying that and then increase the declare war probability 10%. You will probably have an exciting game!
     
  16. Marshall Thomas

    Marshall Thomas Chieftain

    Joined:
    Dec 11, 2005
    Messages:
    700
    I'm about to start a game on emperor (I usually play on immortal), with the following changes:

    <AIUnitUpgradePercent>25</AIUnitUpgradePercent>
    <!--<AIInflationPercent>80</AIInflationPercent>-->
    <AIPerEraModifier>-4</AIPerEraModifier>
    <AIAdvancedStartPercent>135</AIAdvancedStartPercent>
    <AIFreeXP>50</AIFreeXP>
    <AIFreeXPPercent>100</AIFreeXPPercent>

    Do you think this is a good balance? I'm trying to achieve what's been talked about in this thread.

    What exactly do each of these changes do? I have a vague idea, but I'm not certain. Thanks in advance.
     
  17. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    Hi Marshall your post is excellent timing since I am doing a lot in the background to better balance the difficulties to produce challenging games with a lot of freedom and diversity in game play.

    AIUnitUpgradePercent: Does exactly what it says. Deity sits on 30%. In my own experiments the AI is starting to upgrade it's units better than in the past so it's not as serious an issue any more but certainly know where you are coming from.

    AIPerEraModifier: Effects unit, building, projects, city pop growth, unit supply costs, inflation rate, and unit upgrades such that all these begin to cost less and occur sooner in a linear fashion with each new era. Your choice of -4 is equivalent to immortal so good choice.

    AIAdvancedStartPercent: Honestly don't know what this does. There is no use of it in the BNW source code that I can see!

    AIFreeXP: Does what it says. The AI's promotion choices are very haphazard. Your value of 50 is even more extreme than deity. I can see what you are trying to do, you are trying to balance combat but this method is haphazard.

    AIFreeXPPercent: bonus experience in combat for AI. You have set it to deity levels. Again I see where you are coming from trying to make combat more balanced.

    I can release a new version of this mod that does what you want in a slightly more controllable way. How soon would you like a copy since it is in beta only? I would appreciate someone else to test it out!

    The latest version of Buffed AI:
    1) AI no free techs
    2) AI and human starts on same happiness +12
    3) AI get's one extra defense unit and one worker at start
    4) AI get's per era bonuses in SCIENCE as well as the others
    5) AI's offensive attack doubled to create an equation of equality where their unit losses from incompetence is matched by human losses from the extra offensive attack.
    6) AI more likely to DOW human.
    7) Play occurs at prince difficulty.

    What I am finding is that the AI is winning on quick between turns 250-300 diplomacy or culture which should provide enough challenge?

    The question in my mind is the effect of the offensive attack on humans. I think it causes humans to have to bring in more melee into the attack to absorb the offensive attack of the AI.

    All values are adjustable in the mod (I found the way to bring them out so that the player can change them themselves).

    I'm also working on ways to let the AI do an early rush attack on humans that actually is effective. The code in theory supports it but it is effectively disabled since BNW was released for good reason since it was not well implemented. Can still happen on rare occasions on deity.

    One ugly thing Firaxis have done in the code is to link the training of missionaries and prophets to the same bonuses as AI military units. Therefore there is excessive AI spam of these religious units which is pretty ugly on higher difficulty levels. Might need to look at that in more detail as well.
     
  18. Marshall Thomas

    Marshall Thomas Chieftain

    Joined:
    Dec 11, 2005
    Messages:
    700
    How do you do #5? For #6, I increased the AI Declare War Possibility to 110.

    Do you play with the victory conditions enabled? I thought you disabled them (except for conquest because it seemed to prevent the AI from expanding).

    Starting with the same happiness as the AI is something I never thought of; could be interesting. Basically, I'd like to play with everything on King or Emperor except for the AI's military ability against the player. I've always thought that this was the best solution for balancing CiV's AI.

    Thanks in advance
     
  19. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,767
    Location:
    Where animals hop not run
    #5 needs a modified DLL
    #6 same way you do it (thanks for the 110% first try)

    If you turn off all victory conditions, there is a bug in Firaxis code that means that the AI won't go for conquest which can mean a very stale/boring AI. With at least one VC on, the AI will at least consider conquest if it has that inclination.

    I've got another mod that is in beta that is called "Victory by score". It turns off all VC's except time and modifies the way the score is calculated to balance all the different play styles. It also gives a score to completing the space race but tells the AI not to prioritise the space race over general progress. So it is still useful to complete the space race for a better end score.

    I actually really like that mod but most people like to play for the standard victory conditions which can be good too. The problem is that unless the AI is really helped, the AI's coding for the other victory conditions is quite simplistic and needs more work. That is why playing for a score victory is better because it's the only VC that the AI can consistently do well at with sufficient buffs. It is also easy to "tune" the AI with that type of VC idea.

    I'll upload both stay tuned I guess.
     
  20. Marshall Thomas

    Marshall Thomas Chieftain

    Joined:
    Dec 11, 2005
    Messages:
    700
    Because of the limitations of the AI, score victory (with all the others -except for domination- turned off) seems to be the best option. Funny you mention the space race as part of scoring, because that's what I've always thought.

    I'd definately like to try your Victory by Score mod. In the meantime, I'm about to begin a campaign on emperor with the changes I posted. Like you, I'm hoping for a challenge without being forced down a narrow path.
     

Share This Page