Tuesday, December 11, 2018

Helping the unfortunate

The AI in Civ 6 has some issues.  The game is incredibly complicated though, so I don't blame the developers - making an AI that is better would be a serious endeavour, and would certainly end up making the overall game experience worse.  You can't have a powerful AI for a super complicated task that runs quickly, and I have no interest in playing Civ with 15 minute intervals between my turns so the AI can think a lot.

But you can, if you work at it, do things to make the AI better that don't have any cost at all in terms of coding time or performance.

For example, in the game you gradually build up influence to earn Envoys.  Envoys can be sent to city states to earn their favour, and the attendant bonuses.  There are two early policies that you can implement to affect this.

1.  Charismatic Leader - earn 2 more Influence per turn towards Envoys.

2.  Diplomatic League - when you send your first Envoy to a city state, it counts as 2 Envoys.

Now the AI, when it is picking a policy, is going to pick randomly between these two things.  They both affect city states, they take up the same policy slot, and they show up at the same time.  The problem is that the AI will just park on one or the other (or perhaps swap back and forth randomly), but the player won't.  The player will sit on Charismatic Leader until they have saved up 3-4 Envoys, then swap over to Diplomatic League for a single turn, send their saved Envoys to any city state where they currently have no Envoys, then swap back.  In this way the player gets 90% of Diplomatic League, and 90% of the benefit of Charismatic Leader.  The AI gets 50% of each.  

I don't know if the AI is smart enough to never take Diplomatic League again once it has Envoys with every city state, but given the way the rest of the game works I suspect it will still have Diplomatic League in use even then, which is a total waste.

This is a crushing disadvantage for the AI, since the player gets nearly a full extra policy worth of power.  This can feel good for the player, using tactics to get a big advantage like this, but it means that the AI just falls behind, and that means that in order to pose a challenge the AI needs to be given lots of kludgy bonuses.  More production, more food, more science, etc.

When policies grant steady benefits over time the player can still maximize value.  If a policy grants a bonus to libraries and universities, for example, it pays to swap into that just as your universities finish production.  The trouble comes when some policies can have all of their benefits packed into a tiny span of time, and others are stuck purely giving ongoing benefits.

One thing I have been aiming to do is change these sorts of policies that have benefits that are packed into a tiny time span.  (Another example is Professional Army, which cuts upgrade costs by 50%.  Players swap into that for 1 turn, upgrade their entire army, then back out again.)  I don't need to get rid of their effects entirely, and I don't necessarily want to.  What I want to do is give those policies extra ongoing benefits so that if the AI parks on them it actually gets something out of the deal, and reduce the one shot benefits so the policy swap trick isn't so powerful.

For Professional Army I reduced the benefit from 50% to 25%, and gave it an ongoing bonus.  It is a fine policy for the AI, who will use it randomly, but swapping in to it for a single turn is way less broken for the player.  Diplomatic League on the other hand is a thornier beast.  The granularity of 1 vs. 2 doesn't lend itself to a partial nerf, so if I want to change it I have to change it completely.  I can just add on an ongoing benefit though, which wouldn't change anything for the player who is doing the policy swap thing, but would at least make it a decent policy for the AI.

I am performing similar changes for wonders, districts, units, and buildings.  When I see something that is just trash and you should never make it, I upgrade it until it is worth building.  Aqueducts, for example, are hot garbage.  You can reasonably build one to get a eureka, but never a second one.  That is a terrible situation because the AI keeps on building them, wasting its resources, and players never build them, so they have fewer interesting decisions.  I made aqueducts grant 4 food and 1 more housing, and now suddenly they are a good thing to build.  I don't make them in every city or anything, but now building them is a real choice.

My mantra here is that there should be many instances of 'sometimes' when discussing strategy and few instances of 'always' or 'never'.  If the answer to 'when do I build this?' is 'never' then something needs to change.  That isn't interesting for the player, and it makes the AI unnecessarily stupid.

1 comment:

  1. Of my two games, one was with Rome, with Baths, and that was my second game, so I didn't even question the value of aqueducts. It seemed like housing was something I wanted - I hate the idea of having food production go to waste!

    But the Internet seems to agree that aqueducts aren't too useful. Huh. Unless later updates to the game have changed how they work, of course. A peril of starting a game years after everyone else!

    ReplyDelete