Smart AI mod released!! Discussion on the mod

Discussion in 'Civ5 - Modpacks' started by Ninakoru, Mar 1, 2014.

  1. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Current changes:
    -----------------

    - AI ranged units are always able to move AND shoot on the same turn. (fully tested)

    - AI should not attack over and over a city with 1 HP remaining. (partially tested)

    - AI should use air sweep missions more consistently. (partially tested)

    - AI now doesn't randomly embark to water tiles (partially tested)

    - AI should use Great people more effectively, plant some improvements, early, and later use GP powers. (not tested)

    - AI will not use obsolete/no value items as part of a deal if asked to balance things out. (not tested)


    Personal valoration:
    ---------------------

    - AI will perform MUCH better on combat. Move + Attack will specially benefit naval battles, but also will make AI much more menacing with units like horse archers, war charriots, camel archers... On standard mobile ranged units like composite bowman while the benefit is not so big, they will also do it much better on city assaults and picking out enemy units on the field.

    - AI now air sweep prior to sending bombers to a target if possible and if their fighters are not already in intercept mode. This will make an AI with a strong air presence vastly more dangerous.

    - AI actively wont embark when moving to safe plots, but will do so if there's no other option. This will prevent AI from going to water in and out specially during combat, this could make any other player easily kill lots of units in any battle.

    - On the GP changes the most important is on Great scientists. Due to original conditions AI would always bulb the GP instead of building an academy, now will make academy most of the time if there's enough time to profit from it.

    File on CivFanatics:
    http://forums.civfanatics.com/downloads.php?do=file&id=22394

    File on Steam:
    http://steamcommunity.com/sharedfiles/filedetails/?id=233424615

    You can use this post to give any kind of feedback, is quite needed and appreciated.

    Have fun!
     
  2. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    Could you post the source code of your modified DLL? I'm interested in the type of changes needed for combat AI.
     
  3. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    10,021
    Location:
    France
    Nice to see someone starting work on the AI :D

    (and I second the request for the source code)
     
  4. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Sure! once the mod is stable, I have no problems to share the code :)
     
  5. Gamewizard

    Gamewizard Emperor

    Joined:
    Jan 24, 2011
    Messages:
    1,234
    Have played about 200 turns with your 2 mods enabled. I loaded up an emperor, Oceana game to test out the naval AI. Random rolled Carthage (lucky me!).

    The first 150 turns made me regret not going immortal as I easily steamrolled 2 CS and all of Assyria. I then decided to challenge the larger military of Hiawatha...and you wouldn't believe it...AI galleases that MOVE AND THEN ATTACK!?!? I couldn't believe it, so I turned on all animations in order to view the full beauty of it. Simply amazing.

    However, he embarked a knight outside his city, which was surrounded by my boats. :(

    Also, it would be great if you could look into having the AI retreat redlined units, particularly their boats. I had 2 trebs shooting at a galleas for 3 or 4 turns and eventually sunk it when it should have retreated 4 or 5 tiles to a city to heal.

    I also saw at least 3 academies planted early game by the AI.
     
  6. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Yeah, still AI will still embark under certain conditions. The most usual condition was when executing a tactical move to place the unit to a safe plot. The result was that most of the time the safest plot was on water, witch was totally false. Modified that and you should see much less random embark from the AI. There's still some work to do here.

    Still I have to make AI units flee more often, they tend to heal or stay until the end too much IMO.

    Is geat that the GS changes worked!

    Thanks for the feedback!
     
  7. Wodhann

    Wodhann South American Norse God

    Joined:
    Feb 27, 2014
    Messages:
    1,507
    Are these global changes? Do you intend to add difficulty-based decisions to make harder difficulties have more intelligent AI?

    I kind of dream of the day upping the difficulty level will not make the AI "cheat" and start with more resources, and instead will make them smarter.
     
  8. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,277
    Great work! Nice to see progress made to fix up the AI :)
     
  9. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Well, this changes are absolutely global, have nothing to do with difficulty handicaps.

    While I have over 30 points to take over, even if i fulfill all of them, AI will be more competitive, but not neat enough to severely lower their bonuses to keep difficulty. But at least should not be easily gamed like now :)

    To get your dream true, you need too much hours to nearly redo everything done until now by the original devs :crazyeye:
     
  10. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    Do you have a list of features that you're working on? I'm definitely interested in seeing more from you.

    I also had no idea that the AI couldn't move and shoot, that makes their poor performance with gatling guns much more obvious.
     
  11. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Yeah there's a huge list of AI stupid vehaviours, I had only tackled about 30% of that.

    http://forums.civfanatics.com/showthread.php?t=521140
     
  12. Krajzen

    Krajzen Deity

    Joined:
    Oct 23, 2013
    Messages:
    3,040
    Location:
    Poland
    Ninakoru, you are great :0

    Also I would love to see merging this mod with whoward dll :D (especially with his dll + city states diplomacy + civIV features)

    Then I will advertise your wonderful creation till death ;)

    I am slowly starting learning programming and I am especially interested in AI so if Civ6 will release with Ai problems :( (I hope they won't be as insane as Civ5 vanilla AI problems, when computer civs could barely do anything :p ) I will be on the first frontline to fix that :p
     
  13. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Thanks for the compliments buddy, not needed really :)

    I have done some more work, I've released a V2 version, with some changes that will definitively make AI perform better. The worker change being only changing a few lines, perhaps make the most difference of all the changes.

    V2 changes:
    ------------

    - AI will start disbanding archeologists if there are not valid targets. Stop making archeologists sooner than on the original dll. (partially tested)

    - AI will enphasize a bit more on workers. (fully tested)

    - AI will purchase units and buildings in cities under certain conditions, on the original only purchase units for operations and for defensive purposes, and no building purchase. (fully tested)

    - AI will disband long obsolete units like triremes on industrial era. (fully tested)

    - AI will evaluate with a decent importance science grand strategy at renaissance, on original was largely ignored until apolo program and latest eras. (fully tested)

    - AI will make better policy choices ignoring grand strategy until medieval and giving less importance to opening branches vs unlocked branches. (partially tested)

    - AI will upgrade more units per turn if there are lots of units that can be upgraded. Will also upgrade air units more often. (fully tested)

    - Corrected an unusual bug that could make the game crash when a settler was ordered by AI. (partially tested)
     
  14. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    I'm following this very closely. Discussion of AI improvement is always fun, as is discussion of the formation of a committee to discuss AI improvement, but sometimes it's better if someone just does it.

    It's a bit of work if you've never done it before, but would you be willing to set up a GitHub repository for these changes? There are a few out there to follow as examples:

    https://github.com/Gedemon/Civ5-DLL
    https://github.com/Sergeus/Civ5-WoTModDLL
    https://github.com/Pazyryk/EaDLL

    whoward69 did his properly (as usual) as a fork of Gedemon's repository:
    https://github.com/Gedemon/Civ5-DLL/tree/PNM_Various_Mod_Components_BNW

    This would make it possible for other dll modders to merge your changes into their own dlls.
     
  15. VicRatlhead5199

    VicRatlhead5199 King

    Joined:
    Jun 12, 2013
    Messages:
    966
    Location:
    Michigan
    Sounds like a great mod. AI Babylon ought be the threat he should be now. Hopefully this helps some of the other civs that are constant duds too.
     
  16. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    It is! While I still have some quips about the AI's inability to fight on open seas, if you prefer your war land-oriented you will have a new - and interesting - experience with this, specially with the move-shoot thing... which sounds like they were getting out of time to release the game or something like the Mew thing in the Pokémon games.
     
  17. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    I didn't use the tool before, but nothing too complicated :)

    https://github.com/Ninakoru/Civ5-DLL

    Forked from Gedemon CIV5-DLL, Added my modified files from the VS solution and modified the readme file to add all the methods witch I changed. I will make a separate post to announce it.

    Have fun!

    Sadly Babylon wont perform good enough, I still have much work to be done in order to that happens :)
     
  18. VicRatlhead5199

    VicRatlhead5199 King

    Joined:
    Jun 12, 2013
    Messages:
    966
    Location:
    Michigan
    I've always thought his biggest failing was that he almost always bulbed his first GS. If he plants just one early academy I'll consider him improved :goodjob:

    I'm going to put him in my next game and see how he does.
     
  19. Ninakoru

    Ninakoru A deity on Emperor

    Joined:
    Nov 14, 2002
    Messages:
    658
    Location:
    Madrid, Spain, Europe
    Yeah, unlike humans, AI doesn't get that much benefit of a higher science. I got babylon on my test games and didn't do it much better, sadly.
     
  20. VicRatlhead5199

    VicRatlhead5199 King

    Joined:
    Jun 12, 2013
    Messages:
    966
    Location:
    Michigan
    Well you're right, Nebby's not a whole lot better. Definite improvement on how they use ranged units though.

    Nobunaga rushed me and almost took my second city. He would have taken it except he placed an archer on the only open terrain tile adjacent to my city. Any melee he tried to move in to take it was vulnerable to me for at least 2 turns before having a chance to take the city. I spent a few turns fighting him off with the city at 0hp. The improved war actually gave me a little "next-turn-itis" last night and kept me up past my bed time :beer:

    Think there's any way to make them avoid occupying tiles adjacent to cities with ranged units or would that screw up their use of gatling guns? It's the only needed improvement I've seen so far. I'm not real far into the game yet.
     

Share This Page