Jump to content

DevDiary 30 - Tuning the AI


THQN Brad

Recommended Posts

  • THQ Nordic

Hello friends and welcome to the 30th DevDiary for “Knights of Honor II: Sovereign”! This time, we decided to delve a bit deeper into the world of AI and difficulty, explaining our thought process behind balancing pacing, making sure players are engaged in all stages of the game, and what sort of obstacles we met along the way. It must be said that much of the feedback we’ve seen from our closed beta testing has been invaluable on that front, for which we thank you all!

So what makes an AI “fun” to play against? While it must be challenging, it should also behave in a human way. In KoH2, the AI is constantly thinking about what actions to perform, with different priorities dictating which ones it will perform at any given time.

image.thumb.jpeg.93d47336cc1c4ded0068378fac15b7a6.jpeg

Early in development when systems were still being added to the game, the AI used to simply gather all of its armies and send them to a single location, which was simply overwhelming and not fun to play against. But as more decisions were added to the AI’s thinking process, waging war against another kingdom felt more manageable. While you move in with your armies, it might be considering its defenses against other hostile kingdoms, upgrading fortifications, gathering garrison troops, asking other kingdoms for support via diplomacy or even constructing buildings.

By adding these sorts of distractions, the AI starts to think (and feel) less like a machine, giving players time to react and adapt their strategies. And after a few campaigns, you might begin to notice small nuances like the AI preferring to defend its towns under siege and lead battles in home territories.

Behind the scenes, each AI kingdom also has a certain “budget” reserved for different areas of development. These are dictated to a certain extent by their current king’s abilities – for example, a ruler with good stats in religion focuses more on developing his kingdom’s piety and clerics, while someone well-versed in diplomacy would take extra care of maintaining strong bonds with other kingdoms and employing powerful diplomats. These are subtle factors and don’t dictate an AI’s behavior completely, but do play an important role in the grand scheme of things.

image.thumb.jpeg.bf4cde45aec29a7b1f1226a6165936e0.jpeg

And then, with all these tools in play, comes the fun (albeit sometimes grueling) part of balancing how AIs behave in certain scenarios. Diplomacy is a system that highlights this in interesting ways, as certain diplomatic offers have adjusted pros and cons, depending on if the recipient (or the subject) is an AI kingdom. For example, AI kingdoms are more likely to form royal marriages with players, so that you may have an easier time finding spouses for your king and ensuring the continuation of your royal dynasty. This is only valid on easy difficulty, though, with AIs being more reluctant to marry their princesses in general (to avoid losing lands to inheritance claims).

Yet, there are moments when even the AI surprises us with advanced plays, which aren’t exactly by the book. For instance, you may experience a kingdom inviting you to wage war against someone, only to find out moments later that they are in a defensive pact against you, alongside that kingdom. Or, seconds after marrying your princess to their prince, you receive a message that a foreign spy from the same kingdom has murdered your king, followed by foreign claims for inheritance. As painful as it might be on the receiving end, such experiences can define a campaign and make it more memorable.

image.thumb.jpeg.ed1159c2088d62950daecc00d29b969d.jpeg

Of course, the AI may sometimes seem clever by random, but most of it is driven by the game’s difficulty. For example, higher levels increase how much gold, books, religion and levies an AI kingdom gains. Starting conditions are also affected, such as how many wars you might end up in at the beginning of a campaign, or how long it might take before rebellious population starts to amass in your provinces.

In tactical battles, AI armies can also react better at higher difficulties. This may manifest in your marshals being more susceptible to being flanked and picked out by enemies, cavalrymen tending to prioritize archers more and ranged cavalry micro-managing against you while shooting.

In a sense, you could say that the AI “cheats” on some difficulty levels. In other cases, it is not unfair to say it makes mistakes intentionally, from time to time. But in the end of the day, our main goal is to deliver fun and memorable moments, and sometimes that extra spice can be the deciding factor.

image.thumb.jpeg.92612acedf2341a71d80cfdbbdac4c37.jpeg
 

Naturally, AI and difficulty is a constantly-evolving part of our game (as in any game) and we’d love to hear from your thoughts on the topic. What do you think is the most critical part of making an AI feel “good”? Do you think an AI should have some extraneous elements added to help it, or should it be on an equal playing field with players?

We’re sure you’ll have many questions and comments on the topic, so feel free to raise them in the comments section below or on Twitch, during our DevStream on Thursday, November 3rd, @ 3:00 PM GMT / 11:00 AM EST. The Twitch stream will be hosted on the THQ Nordic channel: http://twitch.tv/thqnordic and we’ll be grabbing responses from this post and playing the game live!

Until then, we bid thee farewell. Go forth and conquer!


View full article

  • Thanks 2
Link to comment
Share on other sites

I think the worst thing Ai can do is spawn armies out of nowhere. The Total War series is a great negative example of that. When you have completely crushed the economy of an enemy realm but the AI can spawn a maximum size army of veteran units out of a single remaining city, which the player would be absolutely unable to do, this is just as annoying as immersion-killing.

Another example (also to be found in TW series) is the AI focusing on the player even though he is just one of many threats and by far not the biggest one. That becomes worse if all AI realms do that. Again this is annoying and immersion-killing.

This artificial difficulty reduces fun by a lot, so I hope you can avoid this completely.

  • Like 9
  • Thanks 1
Link to comment
Share on other sites

In my experience, the AI in the original KOH was way too boring. Even Hard mode wasn't really hard because the AI never prioritized elite units. Only famous rebels and crusaders actually had powerful armies. Every time I conquered enemy towns, they were filled with useless buildings. The AI always chose goods production over defense and military and often times produced duplicates instead of utilizing kingdom's special or local units. I hope the new AI can analyze its potential better and use its provinces resources accordingly.  

  • Like 2
Link to comment
Share on other sites

AI should definitely have a toggle-feature mentality. Toggle features are great because they are individually simple and intuitive, but allow for a large number of combos. Some combos can be balanced trade-offs, while others can minimax for devastating results.

A toggle mentality means that the AI can switch gears quickly, rather than being committed to a single course of action. If I open myself to a devastating counterattack, then the AI should switch gears to try and win quickly. If the AI has no hope of winning, it should respond with trying to force a draw.

 

The AI should also prioritize elite troops over basic ones. IRL, small elite armies were the norm, and filling the ranks with lesser troops was usually last-minute & temporary. If the AI is not in immediate danger, it should spend its resources on producing and maintaining elite troops and unique regional units rather than spamming massive cookie-cutter “swordsman” armies, like the Napoleonic period. After a war, lesser units should be the first to be disbanded.

The AI should prioritize archers for garrisons. In the first game, garrisons were random and often poorly-suited to defense. Since the town guards were so good, I always maxed out archers as garrisons, and this combo annihilated many AI armies.

AI should also focus on raiding regions it does not plan to conquer, and minimize raiding those it does plan to conquer. Small cavalry armies are good for this, and devastating an enemy’s backyard while conquering his front is a great way to pay for a war, both in-game and IRL. Masses of footmen should stick to sieges, while cavalry raids and reinforces field battles as a Quick Reaction Force (QRF).

  • Like 1
Link to comment
Share on other sites

Dear developers, I understand that you want to tell and show how development, adjustment, and correction are conducted, but I have questions for you. Please answer it honestly, sincerely.. You spend a lot of energy, money and time on videos about the game, on editing, on streams, on equipment and even on makeup... can you put all of the above into the efforts of other developers making changes and improvements so that the game comes out AT LEAST in the OBT? From December 10, 2019 (3 YEARS COMING SOON!!!) you have started to spend all of the above for the wrong purpose. 3 years, sorry for the slang, you are murdering the players waiting for the game. There is no game that has been released and there would be no errors, bugs, inaccuracies in it. But fixing them is a matter of a few patches... Honestly, the interest is already disappearing. This whole project resembles a pyramid scheme that keeps saying "Here, here right now, here soon.. a little more.." 3 years.. When this game comes out, it will visually resemble the 2014 game.. which is already obsolete... What is the approximate percentage of the game's readiness to understand how much longer to wait and whether to wait for this miracle at all?

Link to comment
Share on other sites

19 hours ago, 4eLoVeKTaPoK47 said:

Dear developers, I understand that you want to tell and show how development, adjustment, and correction are conducted, but I have questions for you. Please answer it honestly, sincerely.. You spend a lot of energy, money and time on videos about the game, on editing, on streams, on equipment and even on makeup... can you put all of the above into the efforts of other developers making changes and improvements so that the game comes out AT LEAST in the OBT? From December 10, 2019 (3 YEARS COMING SOON!!!) you have started to spend all of the above for the wrong purpose. 3 years, sorry for the slang, you are murdering the players waiting for the game. There is no game that has been released and there would be no errors, bugs, inaccuracies in it. But fixing them is a matter of a few patches... Honestly, the interest is already disappearing. This whole project resembles a pyramid scheme that keeps saying "Here, here right now, here soon.. a little more.." 3 years.. When this game comes out, it will visually resemble the 2014 game.. which is already obsolete... What is the approximate percentage of the game's readiness to understand how much longer to wait and whether to wait for this miracle at all?

Well we all saw what happened to Cyberpunk which was released before it was finished (due to pressure from fans and shareholders). And because of that I would rather wait for the game to be released when it is ready than have it tomorrow and be full of bugs and unplayable.  

Link to comment
Share on other sites

On 04.11.2022 at 17:09, DoVlaLegend said:

Что ж, мы все видели, что случилось с Cyberpunk, который был выпущен до того, как он был закончен (из-за давления со стороны фанатов и акционеров). И из-за этого я предпочел бы дождаться выхода игры, когда она будет готова, чем получить ее завтра, полную ошибок и неиграбельную.

The developers of cyberpunk themselves said that the game is ready for N% (almost 100%, I don't remember the exact number, I won't lie) On KOH's account, the game has been hanging on STEAM for more than a year as "Coming soon". Can I at least tell you the approximate date? This is firstly, and secondly, comparing a project like cyberpunk and KOH is like earth and sky (no need to be offended, but these are different projects, ranging from budget to graphics quality and player capabilities). It's like comparing MARIO and DOTA2

Link to comment
Share on other sites

On 11/4/2022 at 5:09 PM, DoVlaLegend said:

Well we all saw what happened to Cyberpunk which was released before it was finished (due to pressure from fans and shareholders). And because of that I would rather wait for the game to be released when it is ready than have it tomorrow and be full of bugs and unplayable.

They came up with such a topic as OBT a long time ago. I just came to the conclusion that if the developers have not yet announced the MBT, then the game is ready at best by ~ 50%...3 years..and this is not the beginning of the project, but the announcement of the already existing, compiled material, with its bugs, flaws, etc. I very much doubt that this will be a class AAA game, I am even convinced that the developers are not striving for this, but if they are going to, then I want to disappoint them, at least for too long

Link to comment
Share on other sites

23 minutes ago, 4eLoVeKTaPoK47 said:

just came to the conclusion that if the developers have not yet announced the MBT, then the game is ready at best by ~ 50%...

Publicly, they said the game is in it's "final stage".  They also said publicly that the only things they have left to work on are multiplayer connectivity and localization.

Make of that what you will.

For me, that tells me they only have two more things to do.  They said localization take time because of all the detail that goes into it.  I don't know about multiplayer.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 11/1/2022 at 11:38 AM, redsimon said:

I think the worst thing Ai can do is spawn armies out of nowhere. The Total War series is a great negative example of that. When you have completely crushed the economy of an enemy realm but the AI can spawn a maximum size army of veteran units out of a single remaining city, which the player would be absolutely unable to do, this is just as annoying as immersion-killing.

Another example (also to be found in TW series) is the AI focusing on the player even though he is just one of many threats and by far not the biggest one. That becomes worse if all AI realms do that. Again this is annoying and immersion-killing.

This artificial difficulty reduces fun by a lot, so I hope you can avoid this completely.

 

Ahh tw AI, part of why I dont play TW anymore. But this game (KOH2) has the best AI (and the only AI I really plan on playing), that is other humans in campaign MP. Not really AI but you get what i am saying.... i hope. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.