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

AI+ v13.1

AI Improvements for Civ VI

  1. ggalindo001

    ggalindo001 Warlord

    Joined:
    Jan 4, 2002
    Messages:
    253
    Siesta -- I used warlord just to be on the extremes. Running one with Quo now on Immortal to look at behavior. I ran one last night with Quo on Warlord, and by turn 250ish (late middle ages), everybody had 3-5 cities.

    One of the next things I want to look into is districts and if the AI is building enough districts. On a watery map, you would expect a lot of harbors.

    g
     
  2. V. Soma

    V. Soma long time civ fan

    Joined:
    Apr 13, 2004
    Messages:
    3,879
    Gender:
    Male
    Location:
    Hungary
    Gorgo attacked me with a varied army of 2 hoplites, 2 horses, archers, warriors and a ram... She went for my 2nd city in the middle and took it quick (!)

    I was kind of behind in tech and army: warriors and slingers... It took me much effort to get back that city and was lucky to get peace for 20 golds...

    EDIT:

    it is turn 124 now, AD 1260:

    I have 5 cities,
    Gorgo has 5,
    Trajan has 5,
    Gilga has 4,
    Tomyris has 3
    Monty has 2

    tech:
    I am now next to last in tech with 16 techs and 20/turn
    civs have 20-21 and ca. 30/turn - almost all civs are in the Medieval era
    well, Gorgo now makes 70sci/turn

    culture is kind of the same as science... here Gorgo is in Renaissance...

    I play Quo's Combined mod...
     
    Last edited: Aug 29, 2017
  3. ggalindo001

    ggalindo001 Warlord

    Joined:
    Jan 4, 2002
    Messages:
    253
    Update -- Autoplay with Quo's mod -- settler behavior is mostly good on islands map. However, two nice islands are not populated by turn 250 (1750s ish) on immortal.

    Decent mix of districts, tho not seeing many production districts by the AI.

    If you want to run the same map -- you start as Kongo, it is the big island Kongo is a part of that goes mostly uninhabited, as well as the island above.

    1329294617 -- game
    1329299631 -- map

    I'm going to run same game/map but without Quo's mod to see if I get any appreciable difference.
     
  4. Olleus

    Olleus Deity

    Joined:
    Oct 30, 2005
    Messages:
    6,478
    Location:
    Beyond the Veil
    I'm getting an error in my database.log. Only mod active (although I do have others in the mod folder) is yours, latest version. I doubt it's anything major, just an sql entry error probably.

    Code:
    [1125564.855] [Gameplay] ERROR: UNIQUE constraint failed: UnitAiInfos.UnitType, UnitAiInfos.AiType
    [1125564.855] [Gameplay]: While executing - 'insert into UnitAiInfos('UnitType', 'AiType') values (?, ?);'
    [1125564.855] [Gameplay]: In XMLSerializer while inserting row into table insert into UnitAiInfos('UnitType', 'AiType') with  values (UNIT_RANGER, UNITTYPE_RANGED, ).
    [1125564.855] [Gameplay]: In XMLSerializer while updating table UnitAiInfos from file delnars_fixes.xml.
    [1125564.855] [Gameplay] ERROR: UNIQUE constraint failed: UnitAiInfos.UnitType, UnitAiInfos.AiType
    
     
  5. Lion King

    Lion King Chieftain

    Joined:
    May 24, 2015
    Messages:
    57
    Gender:
    Male
    Location:
    Russia / UK
    Hey Siesta, it's great you are back!
    I did some testing of the latest version with slight amendment (slightly increased desire to built Science and cultural districts, as well as naval and air units):
    My observations:
    1. Settling - very good, usually by renaissance/modern era the land is filled with cities, also AI doesn't just try to place new city 3 hexes away from the old, he can build 4-5 hexes if the closest land plot has desert or so.
    2. District building - very good, I slightly increased cultural and science district desire to built (as I play with mod which reduces culture and science from pop by 50%). I've seen AI building all districts and especially I like the fact that I see production and market district built in many cities.
    3. Land warfare - good, apart from many stupid moves AI does. I also play with Rocketboots and AI siege help so it help AI moves quicker to cities and conquer them. Cities even fall in latest eras and also AI tries to use support units (mainly rams) which helps him a lot.

    4. Naval warfare/amphibious landing - oh god, poor AI doesn't know what to do with ships. It either sends them for scouting or just keep them at bay in the harbour. I tried to add ships to a normal city attack groups (by increasing max number) but so far I haven't seen them in action. Siesta, is it possible to create special operations "Naval assault" or something like this? I am really missing good naval fighting from civ5.

    5. Diplomacy/war declaration - AI stopped steamrolling city states at the beginning of the game. Now it is happening slowly throughout the game. Also AI now is less aggressive, especially in the latest eras, I would say it would be good to increase AI desire to wage wars in modern eras

    Overall, version 11.1 is probably the best one so far, on a land maps it gives you lots of fun fighting against AI hordes who is now also build districts and try to be ahead in science/culture.
     
  6. V. Soma

    V. Soma long time civ fan

    Joined:
    Apr 13, 2004
    Messages:
    3,879
    Gender:
    Male
    Location:
    Hungary
    Lion King - what difficulty level was that?
     
  7. Lion King

    Lion King Chieftain

    Joined:
    May 24, 2015
    Messages:
    57
    Gender:
    Male
    Location:
    Russia / UK
    It was on Emperor and on Deity. Do you see the different picture there?
     
  8. V. Soma

    V. Soma long time civ fan

    Joined:
    Apr 13, 2004
    Messages:
    3,879
    Gender:
    Male
    Location:
    Hungary
    Quick update on my Smoother king difficulty tiny continents game with v1.11

    in 1926

    it is me and 2 AIs left:
    Trajan is the competent AI with 7 cities, he is waging a long war against Gilgamesh and is winning that, Sumer has now only 2 cities left...

    I have cleared Gorgo and Monty on my continent, and then Scythia on a big island - have about a dozen+ cities...

    I have just reached Atomic age, both Trajan and I have 75 techs and about 300/turn sci at this moment

    EDIT

    1958, only Trajan and me left - and Rome declared war on me with 4k military, while I have 2k...

    Rome also turned to Fascism in the turn he attacked me...
    He has no navy but lots of land units - will he try land units in group on my continent?
    I have navy, so I can defend in the first wave...

    EDIT 2

    I won against Trajan by domination in 2014.

    Trajan made 2/3 of science victory, which was quite nice.
    He failed to make air and naval force - that made him lose easily against my forces of bombers and combined naval forces...
     
    Last edited: Sep 10, 2017
  9. Olleus

    Olleus Deity

    Joined:
    Oct 30, 2005
    Messages:
    6,478
    Location:
    Beyond the Veil
    So I've done some digging: the file delnars_fixes.xml is superfluous. All the changes inside of it have been added to the Vanilla game, the file doesn't even load at the moment because the SQL constraints fail. All it does is clutter up the logs with a bunch of errors, which is rather bad form. You can just get rid of the entire file without side effects.

    * The only thing it does do is give an AIUnitType to spies. As spies are not units that can move, this almost certainly does nothing at all.
     
  10. Sesostris

    Sesostris Chieftain

    Joined:
    Sep 8, 2013
    Messages:
    34
    So I'm back to CIV 6 for the first time after the summer patch, and AI+ isn't working. :sad:

    When I try to create a new game, it just says 'start game' briefly and then returns to the main screen. I've reinstalled the game and disabled all other mods, and I still get this error. I've uploaded my log files here.

    As far as I can see, database.log is complaining that some unit types don't exist.
     
  11. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    56
    @Siesta Guru
    If it's not too much trouble, could you explain how the AI's behavior trees are organized? I looked in base game files and can't make heads or tails of anything
     
  12. Wylding

    Wylding Chieftain

    Joined:
    Feb 25, 2017
    Messages:
    16
    Gender:
    Male
    I have tried this twice now & come up mixed results. Firstly, I enjoy that the AI is far more competitive; however, the settling behavior is way out of common sense. I am on the Play Europe Again TSL map (Deity), and Poland (for example) settled right next to Paris. This is well over 30 away. All of the other Civs are also doing this stupid stuff of settling 20 to 30+ hexes away; and ignoring good land right next them. In the above, obivously Poland saw something great in the hexes 4 to 6 away from Paris, but France was busy settling Prague, below Berlin. To me, this kills it completely for the AI trying to act better.
     
  13. Leyrann

    Leyrann Deity

    Joined:
    Jan 11, 2015
    Messages:
    4,016
    Gender:
    Male
    Location:
    Netherlands
    This isn't only the mod though, it's also present in the base game.
     
  14. Wylding

    Wylding Chieftain

    Joined:
    Feb 25, 2017
    Messages:
    16
    Gender:
    Male
    Thanks Leyrann, good to know it also base game. I will add in to this that without AI+ the AI settles much closer to its other cities, i.e. 3 to 8 hexes, from what I have seen.
     
  15. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    7,061
    My first time trying out the mod. I used it with 8 ages of pace/war and CQUI.

    Honestly, In my king game the AI was extremely passive. I was the lowest in military the entire game and dominating the AI in science, yet was never attacked. I even attacked a CS just to try and piss off the AI, got several denounces but still no declares.
     
    Olleus likes this.
  16. Lion King

    Lion King Chieftain

    Joined:
    May 24, 2015
    Messages:
    57
    Gender:
    Male
    Location:
    Russia / UK
    Hey guys,
    I am trying to alter the mod to make AI using ships and airplanes more often. Re ships - I think of two ways: either special operation needs to be creates e.g. "Naval Assault" where you can put minimum number of ships and force AI to use them. However, I am not familiar with operations node writing so I can very easily mess the whole thing.
    Or alternatively I can put max number of ships as non-zero value in current operations and this should also make AI to use them sometimes. However this might change other land operations impacting them in a negative way.
     
  17. Sole Survivor

    Sole Survivor Chieftain

    Joined:
    Sep 7, 2016
    Messages:
    10
    One thing I've noticed with the AI settling is that they often have a settler out but sometimes it takes them a very long time to actually put down a city. It's like they're searching for the perfect spot or something. It can sometimes leads to their cities not being very tighly clustered since they settle all over the map (depending on where the "best" tiles are, usually the ones with the most resources) which makes it easier to pick off their cities one at a time. Is there any way to get the AI to care less about finding that perfect tile and settle closer to their empire. By having a settler roaming for so many turns the AI is missing out on a lot of valuable time that could be spent building that city up and building another settler.
     
  18. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    56
    So what's up with behavior trees?
    As far as I can tell, they're linear ... not very tree-like. Because I'm seeing no way that they actually distinguish branches
    Example: The barb action tree. It seems like a linear series of actions.
    Like once the found city tree is activated, the attack city tree loops infinitely (which is expected behavior), but there are no branches anywhere.
    I'll be analyzing other trees to see if that's the case for everything
     
  19. Siesta Guru

    Siesta Guru Prince

    Joined:
    Dec 2, 2007
    Messages:
    498
    Location:
    The Netherlands
    @DemonEmperor

    The behaviortrees are very simplistic and don't really offer a lot of options. They're indeed essentially linear. The most you can really get out of them is structures like:

    state = 1;
    if state == 1{
    dostuff();
    state = 2;
    }
    if state == 2{
    dootherstuff();
    }
    Honestly I wouldn't bother trying on them too much. Besides not having much of control over flow, the conditionals are extremely limited and the actions basically consist of a few pre determined options only a few ever make sense in their context. They're also combined together using variables held invisibly somewhere in the c++ code that you cant really access. As a cherry on the cake, mistakes here often crash the client, and even if they don't, usually don't really give you any useful info.
    Structure wise, you basically have 3 types of xml tags.
    1. Definitions /datatypes. You cant do anything with these. It just helps you to see what can be done
    2. BehaviorTreeNodes. The meat of the behaviortrees. These form the 'tree' structures and indicate what type of node were dealing with.
    3. TreeData. Variables belonging to the nodes. The combination of NodeId and TreeName points to a unique node among the BehaviorTreeNodes. The DefnId shows you what type of variable it describes. Look up what nodetype its refering to in BehaviorTreeNodes, then combine that with the DefnId here. That points to a unique value in the NodeDataDefinitions that will tell you what kind of variable it is. If NodeDataDefinitions mentions a DefnId that isnt used in the TreeData, then you can add it yourself if you want to.

    The Jumptos in BehaviorTreeNodes organize the flow somewhat. A node with a jumpto is basically like a set of brackets, starting with the node youre in, ending right before the mentioned node, or if you want, they form a branch. Use a jumpto with the first nodeid no longer in the tree to exit the tree, the operation that this tree was running on will end when you do that. Since the jumptos basically indicate branches/brackets rather than gotos you cant actually jump back to earlier nodes nor can you switch to other branches. Using Concurrent, Priority and Sequence nodes you can create a sort of structure of if statements. "Sort of" because as far as I remember (it's been a while) it's impossible to do proper "else" and "elseif" blocks. I gave up trying anyway

    Some node types basically halt execution of the tree until some condition is met. For example, a move to node will not complete until the units have reached their goal. Others basically pass instantly, sometimes unexpectedly. The make formation node for example always passes instantly. If units cant make formations the turn that node is acitvated, the tree will keep going on

    If you want more detailed info on any of the nodes in particular I could try and give you some pointers. All my knowledge is experimental/inferred though, so in some cases I don't know what exactly is going on either
     
  20. Siesta Guru

    Siesta Guru Prince

    Joined:
    Dec 2, 2007
    Messages:
    498
    Location:
    The Netherlands
    Ah, thanks for the info, that's good to know! I'll remove it for the next patch


    Hmm. Is it possible that you're using an old version of ai+? I don't think I'm using UNITTYPE_AIR anymore. (though it's odd it complains about that because UNITTYPE_AIR and UNITTYPE_AIR_SIEGE should both be in the latest civ veriso
    Try seeing if perhaps you have an old version in your civ mods directory. Deleting that and using the steam version instead may do the trick


    Messing things up is part of the charm!
    So yeah I've considered both aswell. I'm pretty sure the non-zero value on standard operations isn't going to work well. If you set a minimum number, they wont ever attack over land. If you dont, its basically free to ignore the ships. In my own tests using that strategy it does end up rarely sending a ship along with an assault if you do set a value. However, it seemed to struggle more with some attacks where it wanted to send a ship along, but couldnt for pathing related reasons (it can get stuck in operations if it cant complete move orders). I wasn't really happy with that so ended up not going for it.
    The new operation method is more promising. I've not tried this extensively myself and it can work in theory. The biggest problem youll probably encounter is that there is no good control over what operations are launched when. If you set different priorities, they may either never start the ship operations or may never start the regular operations (even when there arent any ships). If they have the same priority, they may still end up not starting operations (the way it determines when to start what operations is basically a mystery) or theyll be trying to fill up both operations at the same time with recruits, failing on both.
    I'd just try it using a best guess on the variables (there are some examples of new operations in my military.xml that may help on the structure), then keep an eye on the game and especially on the logs (especially the operations and behaviortree related ones). Then tweak if it isnt working right. Be especially mindful of the 'priority', 'minoddsofsucces', the allowed distances, and operation limits that are scattered throughout the system. You may need a new category of operations, or could try reusing another. If you reuse another, the game has a tendency to completely some operations

    Just make sure to mentally prepare for a lot of test games..
     

Share This Page