-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the AI unit growth bonuses and tune the income bonuses for different difficulty levels #8402
Remove the AI unit growth bonuses and tune the income bonuses for different difficulty levels #8402
Conversation
So, I finished my first test with this PR in game difficulty hard. Here are screenshots of some of the cities I captured, where even without the creature growth bonus and gold income bonus, the AI was unable to recruit most of the creatures. In fheroes2: Here are the save files: Then I watched a recent let's play of fheroes2 with these growth and income bonuses for AI in impossible difficulty mode. In fheroes2 (from the let's play): |
So what specific fixes are needed? In theory, we need some kind of formula |
Hello @oleg-derevenetz,
Giving more gold to the AI based on additional creature bonuses is not a solution for me, as it would destabilize the original game's "balance" between the different castles. In Heroes 2, gold (and other resources) is the main factor to consider. Increasing the AI's income with a simple percentage (without a convoluted formula) is simple for all players to understand and simple to put in place, and there's only one adjustment factor so it's easier to work out what's going wrong.
This would, I think, be a good basis for observing the effectiveness of AI, without giving an advantage that would ultimately be more beneficial to the human player. In the original game, the AI buys everything it can and never gives gold to the opponent. If I remember correctly, in Heroes 2, the bonuses for AI are as follows:
And it's not enough, in my experience, to give the AI the ability to recruit all the creatures available in Heroes 2 either. |
Well, let's try this way. I adjusted the income bonus in this PR according to this (well, almost - except the +1 of each resource, because this is not available now, it needs some additional code).
This will only work up to a certain limit. Let's say if on the Expert difficulty (+100% income) AI will already be able to buy out all the troops, then additional +100% income on the Impossible difficulty won't matter because there just will be no additional troops to hire. |
Okay.
If the AI has more gold, it can be more aggressive (recruit its creatures and build its cities, as well as having more active heroes with strong armies on the adventure map), and it can also recruit creatures from captured castles that the human player was unable to recruit. Another question I have is whether the AI knows how to use the secondary skill diplomacy. |
So, I continued my tests. In a first game, on expert difficulty, I played a bit relaxed, getting surprised by a more aggressive AI with better armies. In the second game, still on expert difficulty, the AI was just as aggressive, still with better armies, and it took me a little longer to defeat it, and it was more difficult than usual with the standard version of fheroes2. For me, the current AI income bonus values in this PR are fine. Here are the save files: |
More resources will certainly help AI develop its castles more intensively (even if there is only more gold, because AI is able to buy missing resources using marketplace if it has an excess of gold). The more interesting question is what will happen when it develops all the available castles, and it will be able to spend money only on hiring troops, and the number of troops now does not increase with increasing difficulty. I suspect that this should be more noticeable on L or XL maps, but with a relatively small number of towns/castles. Broken Alliance is a map of a medium size, AI finds and attacks the human player pretty quickly. |
First game on impossible difficulty, still Broken Alliance, this time I played a little more seriously. The AI heroes appear more quickly with armies of level six creatures. In fheroes2: Some towns where level six creatures are available for a number corresponding to several weeks' growth; A few unrecruited creatures from the week's growth, nothing too bad; Here are the save files:
That's what I've observed. |
First game on scenario Heroes on impossible difficulty, AI attacks me month 1, week 2, day 6, game over. In fheroes2: Second game on scenario Heroes on impossible difficulty, I win against AI month 3, week 3, day 6. In fheroes2: AI has nice armies, despite the fact that there is only one castle per player and only five gold mines to capture on the adventure map. In fheroes2: Here are the save files:
The aim is not to make the AI invincible, but to make the AI more harassing more quickly. |
Nevertheless, it would be desirable to make the AI represent some challenge for experienced human players too (at least on Expert and Impossible difficulties). I just tried to increase the creature growth for Expert and Impossible difficulties by 25% and 33% respectively (while maintaining the gold income bonus by 200% and 300% respectively) and propose to try to test this when you have time - what will be your impressions? Will the game become more difficult or not? |
Hello @oleg-derevenetz,
So, I continued my tests, this time with the Dominion scenario (PoL), an XL sized map, on impossible difficulty. In the first game, the orange AI player is superior in power month 3, week 2, day 3, no way to come back for my side. The AI is much more harassing than the last time I played this scenario. In the third game, I managed to stand my ground and get the edge over my opponents. However, the additional growth of AI creatures benefits the human player. Over time, it's this extra growth for the AI, which I ultimately benefited from, that ensures I get the upper hand over the other AI players. The human player benefits from the additional creature growth of the AI: (click to expand)First game: Third game: AI has not recruited the extra cyclops (however in numbers less than or equal to standard growth): AI has not recruited the extra cyclops (this time in excess of standard growth): A few extra creatures from Knight Castle: It also works for the Sorceress's castle: And it's bouquet time in the Wizard's castle: This just goes to show that additional creature growth for AI is more harmful in the end. In short, let's remove the extra growth completely for the AI and see how it performs with the current gold bonus. Here are the save files: |
Hi @LeHerosInconnu did I understand correctly that with increased unit growth the game becomes more challenging than just with increased money income, but AI just doesn't have enough money to hire all these units? Maybe then leave the increased unit growth, but increase the money income even more? |
The problem is that as creature growth increases, the most powerful castles, which are also supposed to be trickier to play on smaller maps, will become even more powerful, and on all map sizes. If we increase the gold income even further, AI heroes will roam the adventure map with invincible armies, and the human player will never be able to counteract this. What's more, it will be hard to differentiate between expert and impossible difficulty levels. As I wrote earlier, let's do a test with all creature growth bonuses removed, so with the gold bonus only, and see how it goes. |
If necessary, we can easily make different growth bonuses for different castles (and even for different dwellings).
OK, I removed the dwelling growth bonuses completely once again. |
I think it would be very complicated to make something coherent.
I'll run a test for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @oleg-derevenetz , I left 2 questions here. Could you please take a look at them?
Hi, all! I've made a couple of tests. I'm not against reducing unit growth bonuses. |
This giveaway will not depend on AI difficulty then.
There is no such a thing as providing resources based on starting faction. Resources are provided on per-castle basis for each castle in the kingdom personally. For instance, if a kingdom has Barbarian castle (with Cyclopes), Sorceress castle (without the Phoenixes) and Warlock castle (with Dragons), there will be 1 additional Crystal + 1000 Gold per day for Barbarian castle, 1000 Gold per day for Sorceress castle (no Mercury) and 1 additional Sulfur + 2000 Gold per day for Warlock castle.
AI will hire troops in the castle if it sees any threat nearby (and will not develop such a castle). But:
|
True. I was hoping that we are going to reduce all unfair AI perks with upgrading the code complexity, but the solution to boost AI with free resources each day feels like a step back for me. It would be harder to explain players, how many free resources AI gets each turn for each difficulty level, than they can see in map settings.
Got it, thanks for clarification.
Yeah. Sometimes this could be easily abused by a human, that is hiding in the fog nearby: AI just forgets he watched enemy walking around and making just a single step into a fog,
That how the things happen in H2: we do not always have enough gold to hire troops and develop castles. Human player has to make a choice and I suppose, AI has to behave similarly. Based on the overall kingdom efficiency and the presence of enemies nearby. I know this is not possible with the current level of AI, but we should be aimed to come to this some day. It's just my personal opinion and I couldn't change the decision alone here. I just want AI to have as less such unfair perks as possible. Or make them feel more natural, by adding % to the existing income, so player can still use tactic of capturing enemy mines to prevent his development. |
On Impossible difficulty, AI starts with 10K gold. This is literally nothing if your single castle wants 15K gold per week just to hire the weekly growth of Titans alone. This may help to speed up the development of the starting castle somewhat, but nothing more. Not such a huge advantage in the long term at all.
The resources on the map only help to develop the castles (to a certain extent). They don't re-appear every week and can't help with hiring new troops on weekly basis, especially in the long term. In general, this PR implements the @LeHerosInconnu's idea, and as far as I understand, according to his tests, game complexity really increases on the Expert and Impossible difficulties, just as planned. If someone has specific ideas on how to achieve a similar result in other ways, they can offer a separate PR. |
True! But the faster AI player develops his castle on the first days, the faster he can explore and conquer points of interest. The more resources he gets, the faster he hires new creatures/heroes and picks up more resources. So the less human player can pick up and the slower he develops then. Indeed, the income strictly depends on the number of towns and mines a player captured on the late game. But no one says, that all troops from all castles should be immediately hired. This is not how this game was planned to be played.
Considering the idea of making the game maximum tough and annoying from the enemy invasion perspective, why can't AI receive 10k gold daily then? Or even 20k gold daily to be sure he hires everything and everywhere? I feel this is not the way we need to make game hard on higher difficulties. |
@Branikolog , please focus on the current improvement proposal. Before the changes AI had gold bonus and monster growth bonus. After the changes AI has gold and resource bonuses. The question is which way is "less" cheating? |
After thinking a bit I think we might consider only giving the AI gold rather than resources. For example, there could be castles where no marketplace exists but then dwellings are being. AI would buy monsters even when they have no mines. We have logic to convert resources in castles when marketplaces are being built. In most cases this helps the AI to develop the castle and also buy many creatures. This could be a solution to satisfy @Branikolog as well. @oleg-derevenetz what do you think? |
@oleg-derevenetz , could you please create a separate PR with the changes for surrender? I can see that this PR takes a lot of discussion and it is good to agree at least on one part rather than delaying both. |
Hi @ihhub
You see, on Expert and Impossible AI will get starting resources which are more than enough to build the Marketplace in at least one castle even without mines. After that, the construction of new buildings in castles (as well as the upgrade towns into castles) becomes only a matter of time. Therefore, the argument "the mapmaker may want to remove particular mines from the map and AI will not be able to build some buildings" is untenable, at least on those difficulties where it has enough starting resources to build Marketplaces (AI builds them one of the first, immediately after the Statue). All that additional resources do at higher difficulty levels is accelerate this process, and not "allow" it in principle.
IMHO there is still time, 1.1.1 milestone is scheduled for early July only. If the process with this PR drags on, I can do it. |
Hello @oleg-derevenetz , we are planning to allow map makers to disable any buildings in castle. Having this option and AI with extra resources would lead to broken gameplay on some future maps or players would obviously know that AI is cheating. This isn't implemented yet so I would like to find a solution suitable for everyone. |
Hi @oleg-derevenetz , the proposed change improves the logic. However, I am still concerned about the resources for creatures from dwellings of level 6. To make sure that for players it won't be obvious that the AI is cheating I am suggesting to add a check whether at least one marketplace is build in any town or the corresponding Mine was captured by the AI. What do you think? |
0e85e39
to
10e41fa
Compare
Hi @ihhub
OK, so be it. Please take a look at the recent changes. |
@oleg-derevenetz , now I think this is the best solution we can have at the moment. Thank you very much for this update! |
Hello @oleg-derevenetz, What about the AI bonuses with the last changes made after my last test to date? |
Currently per-castle resource bonuses (on Expert and Impossible difficulties) are as follows:
The above bonuses are applied only if all the following conditions are met:
In addition, 1000 gold is always awarded for each castle in the kingdom regardless of its type and dwellings (separately, in addition to "usual" (non-AI-specific) gold income from castle). |
Okay, thanks. |
Hello @oleg-derevenetz, I made my report here: #8840. |
Related to #8321.
Also this PR tunes the AI surrender behavior.