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

New AI playing to win system

Discussion in 'Civ4 - Better AI' started by jdog5000, Mar 22, 2010.

  1. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Yeah, and RoM can have up to 100 leaders. So I know what I am talking about here. A few extra XML values is a small price to pay.

    Unless I misunderstand Random Personalities, the values for the victory strategies would get swapped too, because they are part of the LeaderHeadInfos. I fail to see how that would present a problem.
     
  2. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    If traits play a role for Victory Strat values, and I was hoping they sometimes do even when jdog sets them manually, then they might not make as much sense when paired with different traits.
     
  3. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    The system is subtle at the beginning, but has a much stronger effect the closer the AI gets to victory.

    What I think will make for interesting gameplay is exactly when a leader who normally is not a warmonger gets a dice roll that starts them on Conquest1 for a particular game. For that game their unitprob and warrand will be a little different ... not a lot, just a little. In this game they'll get a little nudge down the conquest path, and if the circumstances in the game make it so their foray into militarism works well, then they'll do it more. If it doesn't work out and they don't become a top power, then they won't start higher levels of the Conquest strategy and might instead decide they still look good for their normal approach of Culture or Space or whatever.

    With this new system we can set the odds that a leader will play as expected or try something different.

    This is already in 0.90 :) Will have to make sure rebels never do it RevDCM though, or at least not until they have a city or two.
     
  4. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Traits and all other AI variables travel together. Even with Random Personalities the AI's don't have random traits, they take on the traits and all other AI variables from a random other leader definition in XML (with very low odds of picking themselves).
     
  5. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Great, I'm glad you're on board!

    I think it should be fun ... maybe not by the time you get to the 100th leader (!), but I had fun setting up values for the leaders last night.

    Don't get started just yet though, I'm going to recenter the distribution as right now the AIs start two level 1 strategies on average ... I'm going to tune it down to 1.5.
     
  6. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Awesome, can't wait to see the turtle strategy in effect in RevDCM. This will adress the second biggest problem with the AI (the biggest being the lack of city specialization, as this totally hampers the AI's economy when compared to a human, using national wonders correctly is a huge part of Civ4). Have you tested it out yet, how does this effect warmongering AIs?
     
  7. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    I'm not saying random traits, I was actually under the impression that even under random personailities, traits still stick to the leader name and are not randomized at all. At least every screen is telling me Toku is still Agg/Prot and Frederick is still Phil/Org, is that simply a lie? Then that needs to be adressed somehow.
    It didn't cross my mind yet that this info could simply be wrong, I always thought the rest of the AI variables get changed while the traits stick..
     
  8. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Your confusing XML traits and the traits each leader has. XML traits always stay with a leader, even with random personalities, mostly because they don't affect how leaders act.

    The actual XML values that control how the AI acts are in the LeaderHeadInfos, and those all will be swapped (excepting art and name) with Random Personalities.
     
  9. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Ok then I am not confusing anything. I was hoping the traits each leader has (Phil/Agg/Prot/Cre/Fin/etc) would now actually affect how a leader acts, by having an influence on how jdog distributes the VC strat values. If they don't then nvm.
     
  10. Chewie

    Chewie Chieftain

    Joined:
    Jan 28, 2002
    Messages:
    80
    Location:
    Brisbane, Australia
    I came searching for exactly this, sounds great! :) Any idea when it will be ready - or still a while off?
     
  11. gavagai

    gavagai Chieftain

    Joined:
    Feb 22, 2005
    Messages:
    23
    Okey, I wonder. How will the system work when only one victory condition is selected, for example only 'Conquest'? Will the AI's go straight into level 4 mode for conquest or will they just do level 1 and 2 until midgame and then go for level 4? And if they do, will that be a problem?
     
  12. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,325
    How could you actually tailor the AI to diplo? Make it gift techs and try to run other people's favorite civics?

    Diplo takes a lot of predictive ability + long term planning, which is not something our brute force calculation friends show as a strength :p.

    Overall though this looks like a very interesting change that could drastically improve the AI.
     
  13. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    A development version will be up in a few minutes, the AI selection of what strategies to run is fully implemented but not all of the intended effects of the strategies have been implemented. More details when the devel version is posted.

    Absolutely traits played a big role in how I picked where leaders fell in the distribution.

    Having only conquest enabled currently doesn't change how the AI selects whether or not to run conquest 1 and 2, or when to start 4. It does mean that the AI won't run another strategy of course. So, in terms of AIs going for conquest it wouldn't be too different from a game with all victories enabled (until the later parts where AIs who would play towards Culture or Space would instead play normal).

    Running "Aggressive AI" makes all AIs more inclined to pursue Conquest and Domination, so if you do want to see the AI really go all militarily, that's the way to go.

    Yeah, how to go for diplo is not easy to figure out. The most obvious thing is for these AIs to target the techs which let them build the wonders, because if they build the wonder they are on the ballot. Beyond that I'm not really sure yet ... starting war only against poor relations will definitely play a role. Maybe paying more attention to attitudes of third parties for open borders and other trades. Favorite civic matching is an interesting one, gamey perhaps but could be effective.

    The AP resident has more interesting options, like setting a vote on a group war against a player who won't vote for them.

    If anyone has ideas, I'm all ears.
     
  14. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Espionage-> forcibly switching religions & civics may help for Diplo victories.
     
  15. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    And that was what I was criticizing. These traits (CvPlayer::hasTrait(TraitTypes eTrait)) will stay with the leader name where everything else gets swapped with Random Personalities, so the personality of one leader, including initial victory strat odds, get paired up with a different leader's 2 traits that might not be cut out that well for the same victory strats.

    Am I still not making myself clear? :crazyeye:
     
  16. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    You've been clear, but I just don't think you understand the other side of the argument. This victory logic is part of the AI personality, and it, like other personality traits will swap if random personalities are switched. This is how it should be. You disagree, but from my perspective you are dead wrong here; the AI's preferential victories should be part of the roleplaying personality.
     
  17. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    I can understand you, phungus, when you say it's all about roleplaying.
    I still think it's weird that on the one hand, "traits played a big role" in how jdog picked strat values, yet on the other hand nothing changes if these traits are repaced by completely different ones; looks like a double standard.
     
  18. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,891
    Well, economical traits are quite useful for military victories. The only cause of traits not fitting the playstyle that can arise is AI's with militaristic traits deciding to play very peacefully.
     
  19. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,325
    Speaking of gamey but effective, one of the easiest ways to win diplo is to get #1 in pop (not by much, even just barely like ~25% is fine) and then gift mass media to some chump to build the UN, such that the #2 in pop civ will vote for you. It's very possible to win with ~25% pop and only 2 other AIs voting for you this way.

    Having the AI not declare war on people's friends would be an interesting approach. Having it gift to +4 fair trade, gift a resources (eventual +2 resource supply), and match favorite civics with AIs that are below +8 net but pleased are things that could help the AI pursuing diplo.

    I actually recommend against training the AI in the AP metagame because the AP is broken. Making it build it in an obscure religion and then only spread to more than 1 city for civs that like them would cause the player to insta-lose on occasion. Humans do this and then stop it after a few games because it tends to get boring ;).

    If you can get the AI to pick a probable opponent and probable civs that would vote for it with some degree of accuracy, you could make a contender for UN victories.
     
  20. Maxwarrior

    Maxwarrior Chieftain

    Joined:
    Dec 14, 2008
    Messages:
    6
    Location:
    Sumter, SC
    How's the development going? Have you been successful or have the changes caused other issues?
     

Share This Page