• Civilization 7 has been announced. For more info please check the forum here .

(1-VT) Remove Difficulty Randomization of AI Choices

Status
Not open for further replies.

Recursive

Already Looping
Moderator
Supporter
Joined
Dec 19, 2017
Messages
5,817
Location
Antarctica
Currently, when the AI is making a choice for city production, technology or social policies, it picks randomly between the top 2 candidates (below Immortal) or top 3 candidates (below Prince). This is less impactful for Social Policies since the AI is forbidden from opening a new branch while the currently open one isn't completed.

I would like to remove this randomness.

The AI picks its top choices using weighted randomization, not pure randomization. So for example, if it picks between the top 2 choices, choice #1 has a score of 500 and choice #2 has a score of 100, it will pick choice #1 five times more often (5:1 ratio). The intention of this is to reduce AI stupidity.

However, I believe that this serves to handicap the AI's intelligence because it causes problems in its scoring process to be glossed over because of the random element, and because the current system still causes the AI to make a stupid choice more often than I'd like. If one option has a 60% lower score than the top score, it probably shouldn't be picked at all, let alone 28.5% of the time.

I would like to disable the randomization to make it easier for players to spot peculiar AI decision-making (such as overly favoring a certain policy tree), because I want to make improvements to the AI's scoring process. I will be active in making these improvements if the proposal is passed.


I don't think the randomness adequately serves to make AI players diverse from each other either, due to its limited applicability and the observed data that AI often constructs all buildings early on in a city anyway due to its difficulty bonuses. Though based on the favorable response to my other difficulty proposal, the AI's construction bonuses will likely be nerfed a bit next version.

I will caution people that flukes do exist here and not to rely on only a single game (or even a few) for data collection.

The ability to randomize choices will not be removed from the code.

Moderator Action: Proposal has been vetoed, see explanation: https://forums.civfanatics.com/thre...ion-of-ai-choices.679963/page-5#post-16355125
 
Last edited:
Personally I think removing this randomization might railroad the AI into doing the same thing every games (thus the only difference between games is what civs are in the game) and generally be favoring "balance" over "player experience".
To prevent AI doing obviously dumb thing we can just have a limit within them the AI can randomly pick between 2/3 best choices, but if the points (advantage ?) difference is too big between the 1st and 2nd choice it would only pick the better one rather than having them all at equal chance. If the advantage/benefits between 2 choices are similar then randomization or not doesn't matter for balance, but at the same time might spiral into a very different route for that civ which spices up the game.
 
Just remove the randomization for hardcore players ie immortal deity difficulty. If all randomization and starting bonuses are removed, what will be the difference between chieftain and immortal?

I already dropped down to King so I can enjoy my civ5 games without having to brainstorm like if I am still at work. If the AI keeps being leveled to be efficient and difficult, maybe I will consider civ6.

So yeah I get the point and it is totally fair but please, think of the casual players who wants to just have a good time with the game and keep the AI dumb in some ways at lower difficulty levels.
 
Q: does this sync with the proposal Chieftain to be bonus neutral? If so I'd b3 looking forward to those changes too
 
If all randomization and starting bonuses are removed, what will be the difference between chieftain and immortal?
AI bonuses to yields, most notably: https://civ-5-cbp.fandom.com/wiki/AI_and_Difficulty
I already dropped down to King so I can enjoy my civ5 games without having to brainstorm like if I am still at work. If the AI keeps being leveled to be efficient and difficult, maybe I will consider civ6.
There are lower difficulties that you can try if King is too hard. You don't have to play optimally by any means on those difficulties.
 
Even in Settler the AI plays optimally with what they have, especially the tactical AI.
 
Just remove the randomization for hardcore players ie immortal deity difficulty. If all randomization and starting bonuses are removed, what will be the difference between chieftain and immortal?
The AI's other bonuses remain, especially A/B/C periodic yields. As I mentioned in the OP I have doubts about how impactful the randomization actually is.
Q: does this sync with the proposal Chieftain to be bonus neutral? If so I'd b3 looking forward to those changes too
Yes, if approved it does not conflict with that one.
 
There are lower difficulties that you can try if King is too hard. You don't have to play optimally by any means on those difficulties.
It is not too hard, I can play higher difficulties, it is just not fun. You totally miss the point. Some challenge with the AI not being a carpet would be nice. Under King, it is so easy it is not fun to me. Clearly there is shift in hardness with difficulty levels and if it the end it is only the bonus per era

As I mentioned in the OP I have doubts about how impactful the randomization actually is.
So you are saying that either a civ choosing an optimized policy for their abilities or not doesn't matter? For buildings I kinda agree as they eventually build them all but for policies or religion it is quite impactful I think and helpful to tame the difficulty (at lower difficulty than for power players).
 
I can foresee alot of AI vs. AI testing for this one in the future towards balance changes, though it would make the AI much more human like to a degree (Which I think would be great for the game overall)

I am all for this, as it has the potential to lead to a streamlining of difficulty scaling in the game, being only cost reduction increasing per difficulty scaler increase. Which ultimately would be much more manageable than multiple systems to govern in regards to future balance implementations.

The big question is are you able to implement code that would facilitate the AI being able to switch tactics in defense against other AI and human players?
Such as victory conditions coming to completion faster than their own objectives, or the enemy has an army that will decimate their own due to the unit characteristics?

Side note:
For future balance change referencing,
If looking to determine the effectiveness of the current implementation of code then why not ease back the restriction to have it so it is only 1/2 of the policy tree must be completed before switching?
For the tech tree, one could determine balance changes needed by implementing a +1 tech research before entering a new era?
 
I don't know how 'best choice' is determined for a civ, but if selected then a civ will always select the same policies which adds too much predictability in higher difficulties. And sometimes I am not sure if Assyria would have been better not choosing progress or Iroquois not choosing Authority. So my question is : how are 'best' policies determined for each civ? because I doubt each civ only have one optimal way to play that applies to every game.
 
It is not too hard, I can play higher difficulties, it is just not fun. You totally miss the point. Some challenge with the AI not being a carpet would be nice. Under King, it is so easy it is not fun to me. Clearly there is shift in hardness with difficulty levels and if it the end it is only the bonus per era
Yeah, I probably missed the point. You play on King, so you can enjoy the game, but it's not fun, because it's to easy. So what's the point? Removing random choices would make it slightly more challenging.
 
A dozen times yes. This will make player feedback and logs a lot more reliable, the benefits far outweigh the cost of railroading. The meaningful part of replayability comes from the map, the placement of civs and their interactions anyways. This wouldn't mean each civ will play the each game always the same, civs do react and change their strategies in-game, and there's also leader flavor randomization at the game start, which may direct them to different playstyles and probably plays a much bigger role than "choice randomization." I'd also reduce that to 1, but I'm alone in this (currently it randomizes 2 points, which may direct a civ to a very suboptimal victory condition. with one they'll go between their top VC or second best. e.g. a strong domination civ with science as secondary VC (let's say 10 attack, 8 science and 6 culture) can go culture as it can end up with 8 attack, 7 science and 8 culture.)

@Zuizgond
In this context, the AI uses a scoring system. I know about the city production more, so I'll use that as an example. AI will go through each item (i.e. building, unit, process, project) it can build in that particular city and assign scores. Scores are influenced by a lot of factors, flavors (leader, general strategy, city strategy) play a part, city or civ needs factor in, there can be hardcoded boosts for certain things etc. In the current state, the AI looks at the top 3 (or 2, depending on difficulty) items, and randomly selects one. With Recursive's proposal, it'll only select the top item. There's still randomization, flavors are both randomized and reactive so they change throughout the game, city/civ needs depend hugely on the map etc.
 
Last edited:
I understand the point of getting consistent AI for ease of balance, that's why I suggested using weighted randomization instead of equal chance randomization. If the benefits of 1st choice is 5 times the benefits of 2nd choice the chance of AI actually getting 2nd choice would be 5 times less (instead of equally 50%), or wouldn't be considered at all (cut off threshold of 10-20% difference for example). That way when there're a big difference AI will almost always pick the better one (thus keeping good AI decision) while when there's not much of a difference AI can branch out into a new build (thus keeping varieties)

As I have stated my opinion in the new version thread, VP AI is currently already at good level on average, thus putting more effort to improve it won't give better return than improving player experience, and striving for perfect balance would lead to a bigger amount of extra rebalance work after you want to implement new gameplay elements. Unless you're planning to wrap up all development for VP soon (aka no more new gameplay elements) then focusing on perfect balance right now isn't a good investment.
 
I understand the point of getting consistent AI for ease of balance, that's why I suggested using weighted randomization instead of equal chance randomization. If the benefits of 1st choice is 5 times the benefits of 2nd choice the chance of AI actually getting 2nd choice would be 5 times less (instead of equally 50%), or wouldn't be considered at all (cut off threshold of 10-20% difference for example). That way when there're a big difference AI will almost always pick the better one (thus keeping good AI decision) while when there's not much of a difference AI can branch out into a new build (thus keeping varieties)

As I have stated my opinion in the new version thread, VP AI is currently already at good level on average, thus putting more effort to improve it won't give better return than improving player experience, and striving for perfect balance would lead to a bigger amount of extra rebalance work after you want to implement new gameplay elements. Unless you're planning to wrap up all development for VP soon (aka no more new gameplay elements) then focusing on perfect balance right now isn't a good investment.
First paragraph: This might be a good counterproposal, if you want to make it.

Second paragraph: I disagree. A good part of why VP is refreshing to many players is the comparative AI intelligence, and numerous players have mentioned this before. This isn't really seen in the 4X genre. Improving AI is improving player experience. If I interpret "perfect balance" to mean "training the AI to make optimal choices with existing mechanics", then I will say the addition of major new mechanics is unlikely at this point, so it would be a good investment to balance AI scoring and the mechanics themselves. Perfection also isn't the goal, just competency.
 
If the addition of major new mechanics is unlikely at this point then I agree we can put bigger chunk of effort finishing off the AI and balance.

Regarding counter proposal, I prefer to leave it to your discretion as you would be more familiar with the technical side of things. I won't know if my suggestion would create a bigger cpu load than needed or any other side effects. If you think it's a viable/good idea then feel free to adjust it to your liking, I take no credit.
 
After re-reading the proposal, the lower the difficulty the randomness shoud be there with the weight leading towards the less optimum move . Diety however makes no choices Diety AI always picks the best move. Can that be done ? an example Settler AI picks if given the choice the wrong move 90% and scale it back to Immortal making a 5% chance the wrong move ? Would that even be possible?
 
After re-reading the proposal, the lower the difficulty the randomness shoud be there with the weight leading towards the less optimum move . Diety however makes no choices Diety AI always picks the best move. Can that be done ? an example Settler AI picks if given the choice the wrong move 90% and scale it back to Immortal making a 5% chance the wrong move ? Would that even be possible?
What would that be simulating? An artificial intelligence doesn't artificially do something it evaluates to be stupid. No one does. They choose something because they use an irrational metric for determining what is smart.
Whatever the procedure does, on any difficulty, it should be maximizing something. Then the computer player can reflect on its strategy coherently; barring that, it can have a strategy.
 
What would that be simulating? An artificial intelligence doesn't artificially do something it evaluates to be stupid. No one does. They choose something because they use an irrational metric for determining what is smart.
Whatever the procedure does, on any difficulty, it should be maximizing something. Then the computer player can reflect on its strategy coherently; barring that, it can have a strategy.
I get your point but at lower difficulties the AI must be easier to beat by making less optimal choices? if the AI made the same choice at settler and a diety whats the point of the difficulty level youd might as well as scrap the difficulty level and have one AI what does that achieve for the casual player? Shoud it not be like the chess games ? for example a grand master AI would make the optimum moves vs a Beginner AI it must be simulating that difficulty if not then its no point to having difficulty levels? In the case above what should Settler AI be Maximising ? another way should the Diety AI be minimising?
 
Status
Not open for further replies.
Top Bottom