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. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    No naval carpet of doom problems seen in my game. Their building navies but are using them (against each other)
    Oh, I had an immediate use for Radio. I'm after cultural victory in mine and faith bought a GE the turn before Oxford completed and rushed Effiel Tower with it in addition to being the first in the world to choose an ideology. I actually did have coal but I can always reach Radio faster than build 3 factories.
    That actually is the last critical world wonder to my cultural victory strategy, Broadway or Sidney would be nice but not needed.
     
  2. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    With regards to peace deals:

    As I understand it, what people want is that DURING the locked-into-war period, the AI will only accept white peace without conditions.

    As I understand it, what people want is that AFTER the locked-into-war period has elapsed, if the AI is still at war and loosing, then it can accept peace with conditions.

    Is that correct? I have a got a save game situation like this which I could use to write new code.

    EDIT:
    Problem is that this would change the lua code which is going to knock out mods that change lua like the enhanced user interface.
     
  3. dhialuck

    dhialuck Chieftain

    Joined:
    Jan 7, 2008
    Messages:
    31
    Location:
    UK
    Thank you for taking a look at this Glider, btw I am software developer working mainly on Python and C++/Java and I am really tempted to get started in modding the A.I and helping you basically but we can talk about this later and great work so far.
    #1 is not that critical to be honest but yes that would be great to have it implemented to prevent the A.I from stubbornly sacrificing resources and units in the locked period.

    #2 I do not think there is a problem with this one tbh, the reverse situation is the bug we mentioned before when the A.I accepts a blank peace while clearly winning.

    So as to not cause any breaking can a quick fix to the bug be:
    _If the A.I is winning the war make the make-peace button widget not-selectable (grayed out) or is this the fix that will break other mods ?
     
  4. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    #1 If the Locked in value makes sense (such as the minimum 5 turns or that + the extra time for an alliance 15?) it's actually fine as is.

    It's when the locked in number of turns for some reason got set higher (military strength?) that there might be a problem and the real solution is to unfreeze it if the the AI is no longer strong.

    #2 Code is actually working fine when AI is losing. It's when the AI is winning and is not locked that there's an issue, and the real solution is for it to only accept either what it demanded or equivalent value thereof.

    If you're going to make a hack to where the human can't propose if the AI is winning then it needs "Take it or leave it" message added to the measure along with disabling changing the list and disabling everything except "accept" & "reject".

    Ideally though it would upon the human proposing calculate to see if the human is offering the same (or more) as the AI demanded.

    Yes, any LUA mod has potential to break other user interface mods.
     
  5. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Thanks for the feedback dhialuck and Joncnunn.

    I have already fixed the bug in BNW with the AI accepting white peace when it is winning a few days ago and will include it next version. I was mainly after fixes to issue #2 but looks like I can hold off on that (I haven't even got a proper save game of any issue).

    EDIT:
    Shaking my head that Dhialuck's white peace bug in BNW was not fixed years ago. All I can think is that players actually like the bug because it makes the game easier even if the poor old AI is made to look like a fool through no fault of its own (it is an interface bug and it will break compatibility with other mods).
     
  6. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    Some more turns in my game. (Note that I did NOT pick Rationalism) but instead on my game going for cultural victory went Tradition, Aesthetics, Freedom and now have the level 3 Tenet)

    The AI promoted itself to Deity +4 and Deity +5 when a GS was born and there were no remaining good spots for an Academy so I bulbed it, not only finishing an expensive tech I was researching at the time but it overflowed to make the next 2 techs (the only possible options) take one turn each.

    I'm no longer signing RAs as I'm much more interested in using the cash to keep my military up to date to counter the fairly large but an era out of date AI fleets I'm seeing. It may also be a good thing that militaristic city states granted me 3 siege units (along with some other types). No, I'm not at war, but I always want to be prepared.

    I was finally able to propose a World Resolution but the vote hasn't taken place yet. It may be interesting to see what Deity + 5 with AIs having a large number of cities does to the chances of a human completing Worlds Fair in the Modern era.

    The Two AIs that went Order are suffering massive ideological happiness issues (from myself). Both of my game long friends went Freedom.
     
  7. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Thanks. I'm actually relieved that they are suffering massive happiness issues from ideology. I was worried that by setting this mod back to the defaults on happiness, that a lot of the fun stuff like seeing city flipping, rebellions in the AI would go missing because the AI would never have happiness problems. Good to see that they are but the way this mod plays will be very different on terrestrial maps compared to island maps and so only time will tell.

    The critical thing on large islands is whether the AI has the capacity to decide that it is your turn to die. If it decides that, I say you will die if you are on deity +5 (except that coastal cities on large islands are notoriously hard to capture for the AI).

    EDIT:
    Thing to keep in mind is that deity +5 on large islands is not the same thing as deity +5 on terrestrial maps. The reason is that the effect of the PEM (per-era-modifier) is proportional to the number of cities the AI has. Unfortunately there is nothing I can do about that with this PEM concept for adjusting the in-game difficulty. So the difficulty of this mod will never be totally independent of chosen map.
     
  8. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    That would actually have reverted my copy to what my preexisting happiness mod was, looking that up, AI Default Handicap unaffected, but the per difficulty ones changed to 100.
    Basically default behavior on Immortal is 85% so instead of the AI having 90% * %85 = 76.5% normal unhappiness it has 90% unhappiness.

    Well, the closest AI to me actually is AI Maya, who in fact became even closer when they "colonized" my own landmass (in a bad city spot in which if I get that city by any means I need to raze it down to build the city in the correct spot 3 hexes away; with my starting landmass not having a secondary happiness source at all I didn't get the happiness to afford it at the time. Plus the site I had in mind didn't turn useful until the first of the last game resources were revealed. As to AI Maya's spot, it's 4 hexes away from the closet resource with all discovered other than uranium :lol: )
    They've frequently been at war with their other neighbor (AI Iroquois)

    It also looks like every AI at some point has been at war with AI Assyria, probably because AI Assyria conquered a city state early (since liberated by AI England)

    So my diplomatic defense is that two of the AIs hate 2 other civs more than they do me.

    Edit: One of AI Maya's city did in fact revolt to me, but with it being next to the Mayan capital but on the south side (by comparision I'm in the north west), it was undefendable and so big it would take forever to raze so I sold it to AI Brazil (after relocating the great work of music to one of my cities) to finish my round of unit upgrades.
    This will also give these two AIs land envy of each other. :smoke:
     
  9. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Damn, your reports about this mod are of limited use because of all your changes. The data needed is players who play this mod, not a modified version of this mod.

    Whatever.
     
  10. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    Recalculating what AIs happiness levels would have been:
    Prior to the AI Maya revolt, they'd still have had overall negative unhappiness, but post losing the size 22 city in a revolt would now be hovering around +2 overall.
    AI England at the same time instead of being around -18 overall would have been around -5.

    Edit:
    I was able to host Worlds Fair at Deity + 5 with most of AIs in modern era (by a narrow margin of 35 hammers)
    AIs Maya & England have gotten themselves out of overall happiness problems looks like via selection of happiness tenets within Order since it so rapid, (but I can't rule out a large happiness building wave)

    AI Iroquois and AI Brazil actually decided it was time for AI Maya to die, preempting whatever Maya may have been planning. Result of that war:
    1. Maya captured the city I gave Brazil
    2. Iroquois captured 4 Mayan cities, but not were important.

    AI Maya just revolted to Freedom. AI England is the only AI left that went Order and they have a revolutionary wave.

    I ended up winning a cultural victory without going to war at all.
    The combination of having been friends to military city states for much of the game, which provides a lot of extra military strength (in the eyes of the AI), making early friends with Brazil & Portugal, and AI Assyrian's early conquest of a city state ensured that all of the AIs had some AI as a higher priority to go to war with than me.
    At the game end, tech spread was roughly equal to that seen when the AI in base game Immortal.

    My happiness mod of keep the AI Default Handicap happiness values but change the AIHappinessPercent in the various levels to 100 in combo with this mod shows good happiness behavior on immortal, which actually would suggest that base game happiness bonuses to the AI on Immortal is too generous.
    On Emperor level, it's less likely for the difference to be noticed. (And on King and below there's no difference at all)

    It is still possible to host Worlds Fair and Olympics with the AI scaled up to Deity +5 with a tall 4 city empire, but the human must go all out for it. (I won by a margin of 35 hammers for Worlds Fair and 120 for Olympics. In the first case, if I hadn't been running 2 hammer cargo ship routes to my capital I'd have gotten beaten out.)

    AI fleets got up to good sizes, but were thinned out fighting each other and so there wasn't any naval carpet of doom, but I note that on my map types its easier for land carpet of doom scenarios to develop. In addition this can be eye of the beholder, I might think the AI has done an outstanding job placing a defensive fleet and someone else might call it too big a carpet.
     
  11. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    I'm in another game now,
    The good news is that AI on AI naval wars are incredibly good when the human cracks up the tech pace and researches cheap techs to push the AI up to Deity +3 early via great Hammer start and Great Library. (This is also a hint, if you don't want the AI pushed up early, skip Great Library)

    The bad is that AI triremes can indeed form carpets the AI is unable to move them out of. For a while there I thought they were planning to attack one of my more distant cities from them even though I had one much closer. (It's possible this problem could also occur with other coastal only ships, its fine with ocean ones)

    There's really no good solution to this without opening up the entire AI naval targeting and teaching it that while it's ok to send a few triremes as naval scouts
    1. They shouldn't be sent in a planned military attack too far away.
    2. When they reach a tech allowing unit upgrades their top priority should be returning to home waters to upgrade to deep sea vessels.

    I still have 3 Crossbows stationed near that carpet just in case, it is after all AI Rome, who I think have a high descriptive rating.
     
  12. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Did the mod slow your victory down? Maybe I'll set AIHappinessPercent=100 across all levels what do you think?
     
  13. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    This version got RAs back to normal values (instead of the previous Beta versions leaking the AI's science back to the human thru them.) which eliminated the insane early victories from it.
    It's really domination victory type that would be slowed down the most compared to base game. A good diplomat can just watch the AIs fight each other and enjoy the show while continuing on his own peaceful victory path.
    There's quite a range on when victory occurs on Immortal on base game depending upon which AIs are closest, presence/absence of mountains, etc. that I have to think about what base game would be like with this specific layout (Unfortunately, "save map" won't give you the same starting locations or opponents while the 4000 BC Autosave already has the presence or absence of the mod locked in.)

    I think that the happiness change would work well. You'll want to test on Emperor since my test was on Immortal.
     
  14. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    I've done a merge of the community patch core with this mod, let me know if anyone wants it.
     
  15. dhialuck

    dhialuck Chieftain

    Joined:
    Jan 7, 2008
    Messages:
    31
    Location:
    UK
    oh I am definitely interested! how can I get it?
     
  16. Casworon

    Casworon Prince

    Joined:
    Aug 9, 2014
    Messages:
    437
    Definitely! Been loving this mod!
     
  17. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Hi Dhialuck and Zenphys thanks for the support makes the effort of uploading this and checking it worthwhile if someone is actually going to use it.

    I thought I'd first release it as a beta initially because it is a **BIG** change from V20 since it includes the community patch V61. (Just the core balance code and AI improvements not the game changing stuff).

    So feel free to ADD whatever mods you want that are compatible with WHowards picknmix they should work with this mod.

    There is one "issue" that I am not sure about. I fixed the bug in the game where the AI will except white peace even when it winning the war. Issue is that in this beta, if the AI wants to give you a city to end the war, the interface code forces the player to accept that city (negotiation is not possible). This could be a good thing (forces player into more interesting scenarios) but might also be a bad thing. I'm looking into it but for the moment, I'd appreciate player feedback on what is a BIG change for this mod with the inclusion of the community patch.

    I've played through quite a few hours on it and feel that it working well except for that problem I mentioned. Feedback appreciated because with all these changes, the more testers, the quicker we can sort out if there are any issues.

    Change log
    • Community core balance patch included with their improvements to city placement and other AI improvements
    • Compatibility with WHowards picknmix mods
    • Flexible difficulty algorithm tweaked to exclude top civ
    • Flexible difficulty can go down below set difficulty as well as up
    • AI more likely to DOW a human leading in tech
    • AI unhappiness percent 100
    • Can't force AI to accept a peace deal it does not want (BNW bug fix)
    • No more civilian traffic jams built in
    • Tweak scores for a better timed victory

    Chow.
     
  18. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    Thanks. I'm looking at the files now since my most recent game just ended.

    Does the score mod affect the end game final score, or does it only affect score victory?
    If it's only the in progress score / the tiebreaker if the game actually reaches 2050 AD it doesn't really matter to me, but if it affects final score it appears to reward wide empires and punish tall empires. (Someone pulling off an OCC Babylon Space victory around turn 250 wouldn't want to be called Dan Quayle)

    I'm not seeing any XML files from the community mod, so I guess you're not including them?
    (That's actually fine with me, I think the community mod went in the wrong direction by changing minimum city distance back to vanilla CD release.)

    If the AI is more likely to DOW a human with a tech lead, doesn't that make it more likely the AI will get its head handed to it?

    I'm not actually sure when the system would flex below stated difficulty if the top civ is excluded. The only time I've seen it down to stated difficulty level is extremely early (before anybody has techs, and one turn from completing a beeline)

    On the issue, so the human can't declare that AI city useless but must take it for peace? ;) No big deal, human can sell it to some other AI if he would have preferred cash.
     
  19. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,832
    Location:
    Where animals hop not run
    Hi Joncnunn - the mod is still not a polished final product bear that in mind (just a beta). To really polish it up properly, I would need a lot of positive feedback from players because the polishing is tedious.

    Does the score mod affect end game score?
    Yep. Should have thought about that, you are correct. Personally I couldn't give a rat about Dan Quayle but I should do something about it ;) For now the fix is to just delete Scores.xml if the score biasing is not to your liking. I made tech = 1 so that you don't have to do the maths when comparing techs with the AI.

    I'm not seeing any XML files from the community mod, so I guess you're not including them?
    I tried to make it no different to the base game. The included XML from the community patch should be sufficient and some of it is not XML but SQL. There are a couple of minor differences so far I've noticed. The happiness indicator in the UI doesn't update until the next turn. Also, for some reason your units wake up if they are healing and see an enemy even though I thought I turned that off.

    If the AI is more likely to DOW a human with a tech lead, doesn't that make it more likely the AI will get its head handed to it?
    Possibly, but then again possibly not. Time will tell I guess! In my current game, I started on prince and so had to manage the tech lead to avoid the AI difficulty blowing out. I accidentally hit the tech lead and some of the AI's got jack of me and dowed. It really hurt because their combat bonuses are impressive and did slow me down! (I play on quick oval map at the moment which is pretty challenging).

    so the human can't declare that AI city useless but must take it for peace? No big deal, human can sell it to some other AI if he would have preferred cash.
    Yep. Actually that is my thought too. It makes the games more interesting as well. It also depends on what happens in multi-player. In a human MP game can a badly defeated player annoy the victor by insisting on more cities than the victor actually wants?

    EDIT:
    Areas that could do with polishing:
    • Combat changes need to be represented in the UI in standardised format
    • The difficulty notification code needs to be standardised
    • Some of the variables should be soft-coded rather than hard-coded (like AP score).
    • The code should be converted into WHoward preprocessor directives format
    • The code should really just be a fork off from the community patch on Github
     
  20. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    I just thought of something, if the AI wants to give you GPT or luxury for peace, can you still get them to give you gold all upfront instead?
     

Share This Page