欢迎光临散文网 会员登陆 & 注册

EU4开发日志 | 7/19 AI改进

2022-08-23 03:21 作者:牧有汉化  | 我要投稿

牧游社 牧有汉化翻译


Europa Universalis IV - Development Diary 19th of July 2022

Gnivom, Revived AI programmer


Welcome to this week's Dev Diary! Today I'm back to talk about some of the changes we've made to the AI for 1.34.

欢迎来到本周的开发日志!今天我回来讲一讲我们在1.34版本号中针对AI做出的一些改动。


National Ambitions

国家野心


For a long time, there has been code and script for the AI to be aware of the conditions of its missions and decisions and try to achieve some of them. But because of various issues this has not had a significant impact.

长时间以来,AI都会在代码和文本的影响下关注自己的任务与决议的先决条件,并且会努力完成一部分。不过因为种种原因,这些因素的影响并不大。


For 1.34, we've made sure the AI takes many of these conditions into account, especially those related to conquests. We also made the AI pursue cultural unification, depending on government rank. These changes will work together with the AI's more organic desires to shape its ambition and strategy. The result is an effect which is just noticeable in terms of AI behavior, but compounds over time to create AI empires - sometimes historically reminiscent - that provide a real challenge to players who continue into the late game.

在1.34版本号中,我们确保AI会聚焦于任务与决议条件,尤其是和征服相关的条件。我们也让AI会根据政府等级的影响,来追求文化组的统一。这些改动与更加有条理的AI野心和战略调整是协调一致的。改动在AI的行为上起到了立竿见影的变化,不过两者的共同作用随着时间拉长也影响了AI帝国的发展:有时他们会让人联想起历史上的版图。这种长期影响会对玩到游戏后期的玩家带来切实的挑战。


We were a little worried that this might cause games to all look the same, but our hands-off overnight games look arguably even more varied than before.

我们担心过这种改动会让游戏变得千篇一律,但是我们挂机一晚上的游戏结果看着甚至比过去的还要多样化。


Here are a bunch of recent hands-off 1821 maps, only slightly cherry-picked:

这里是一些最近挂机到1821年的游戏地图,我们只挑选了其中一点:



It makes us happy and proud to see the AI form historical countries such as Germany, Italy and Qing.

我们很高兴也很自豪地看到了AI成立了历史上的国家,比如说德意志、意大利和大清。


Typically, these AIs balance off each other nicely. If your plan as a player is to "Kill Ottomans early, then chill", you may find that you've just aided some other AI in taking their place as your end-game boss. Admittedly though, a downside of this more opportunistic AI is less clean borders.

值得注意的是,这些AI很好地制衡了彼此。如果你作为玩家的计划是“早阉了土鸡早完事”,那你会发现你帮了一些别的AI接替了奥斯曼成为了后期大敌。不过我们必须要承认,现在更会投机取巧的AI边界更难看了(丑陋的版图-1000)。


Peace Negotiation

和谈机制


What started out as an investigation into why AIs often left OPMs alive in peace deals, turned into a slightly bigger project.

当我们开始调查为什么AI经常在和谈中放过一地小国时,我们慢慢开始发展出了一个更大的项目。


When the AI is winning a war, and making demands, it has a bunch of preferences that it tries to balance against each other for an optimal peace deal. This is unlike when it is losing, where it will only care about objective measures such as war score cost. However, when the AI is winning, but receives an offer, it has previously relied on very coarse-grained expressions for whether the offer matches its preferences:

当AI打赢战争并提出要求时,会有一系列试图制衡彼此来得到和谈最优解的优先偏好。当AI要输的时候就不太会这样了,这时AI只关注诸如战争分数花费这样的客观标准。然而,当AI要赢的时候收到敌方的提案,就会通过之前依赖的粗糙表述来判断要求是否符合其优先偏好:


“Does not want parts of the offer”
“不想要提案中的内容”

“Requires X to be part of the offer”
“要求X成为提案的一部分”

“Wants other concessions than gold”
“要求金钱之外的赔偿”


This has given clever players a little too much room to outsmart the AI.

这让聪明的玩家有了更多戏弄AI的空间。


In 1.34, the second expression in particular has been reworked, to allow the AI to express its preferences in more detail. Let's take a look at an example:

在1.34版本号中,第二条表述被重做了,从而让AI可以更详尽地表达其偏好。我们看一看下图的例子:


拿骚希望“释放日内瓦”而非“释放坎达尔”作为提案的一部分:-1000


Here, I was trying to get out of a bad situation by giving away my ally's land, but Nassau wouldn't have it. It's not that they don't want Candar to be released - note the green thumb - it's that they'd much rather have me release some of my own land. Unlike the old "Requires X to be part of the offer", this new condition can not be circumvented by completely filling the peace deal with less important treaties.

在这里,我试图通过卖掉盟友的领地来摆脱险境,但是拿骚不买账。这不代表他们不想看到释放坎达尔——注意一下绿色大拇指——而是他们更希望看到我释放一些我自己的土地。不同于先前的“要求X成为提案的一部分”,这里的新条件不能靠通过不太重要的内容填满条约来规避掉。


As a consequence of this, we’ve also been able to loosen up the "Does not want" condition by making the thumbs green in more cases.

作为结果,我们通过在更多情况下使用绿色大拇指的标志,放宽了“不想要”的条件。


One more subtle but important change is that when an AI warleader considers a separate peace with individual enemies, it will be more lenient. This helps expanding AIs take more stuff, while also reducing the risk and cost of war, compared to just waiting for the enemy warleader to sign a deal. It will also make it more risky for players to start a war where they rely too heavily on their allies.

另一个细微但重要的改变是,AI的战争领导方在向单一敌人提出和谈时会更宽容。相比于等待敌方战争领导方签订和约,这会让AI更好地扩张,而且也减少了战争的风险与开销。这对于试图发动过分依赖盟友的战争的玩家更加危险了。


As a related side note, we've fixed a crash related to the PRESS_THEM_FURTHER moddable define. If enabled, it makes your war allies who have been promised land get mad at not getting enough land, even if the war leader doesn't take anything for itself.

另外提一点,我们修复了PRESS_THEM_FURTHER可修改变量导致的闪退。如果这个变量启用了,就算是战争领导方自己没有获得土地,你许诺过土地的战时盟友也会因为没得到土地而非常恼火。


Independence Wars

独立战争



Given that we're doing a Scandinavia-themed update, it seemed appropriate to do something about subjects' willingness to declare independence. We haven't changed a lot, but subjects will overall be a bit bolder when it comes to declaring independence. In particular they may now do it while at war, if at 100% Liberty Desire, so no more constant wars to pacify your subjects. There's not much more to say about it, but we can for example see independent Sweden a bit more often, as well as a collapsing Timurids and occasionally breakaway nations in the Americas.

因为我们在制作斯堪的纳维亚主题的更新内容,做一些关于附庸宣布独立的意愿度的改动还是比较合适的。我们并没有改动很多内容,但是附庸总的来说会在宣布独立的时候更大胆。具体来说,他们如果达到了100%独立倾向,会在战争时期宣布独立,所以不再能通过持续不断的战争来安定属国。这没什么好说的,但是我们可以更容易地看到像瑞典独立这样的例子了,还有帖木儿的崩溃与偶尔独立的美洲殖民地国家。


War Evaluation

战争评估


防御战争:+30

马穆鲁克外交声望:+4
对敌方的态度:-20
厌战度:-11
突尼斯欠债202杜卡特:-6


When the AI considers starting a new war, it will look at basically the same information as the player can see in this window to figure out who will join on either side. Unfortunately, this has had a couple of bugs, related to the "Attitude towards enemies" and "Distant war" reasons potentially changing as the war starts and additional countries join. This has made both players and AIs declare suicidal wars.

当AI考虑发动新的战争时,会和玩家一样在窗口上看到两边都会有谁加入的信息。然而,这里面有一些与“对敌方的态度”和“遥远的战争”相关的bug,因为这些因素在战争爆发与他国参战后可能会发生变化。这会让玩家和AI都会发动自杀性战争。


These inconsistencies have now been fixed, where we could find them. But the problem remains when predicting acceptance for recursively called allies (such as allies of the Holy Roman Emperor when attacking a member state). Because of this, already in 1.33, the player interface doesn't try to tell you whether those countries will join or not. But the AI still tried to "look at the checkmark". In 1.34, the AI will simply assume that recursively called countries would all join. This will fix the "Burgundy suicides into Liege" bug.

我们找到并修复了这个前后不一致的问题,但是问题还出现在了判断开战后召唤盟友时的接受程度的情况(比如说进攻一个神罗成员国的时候,其盟友是皇帝)。因此早在1.33版本号中,玩家结盟就不会试图告诉玩家哪些国家会来或者不会来了,然而AI还是会去“找标记”。在1.34版本号中,AI会默认所有接到召唤请求的国家都参战(然后进行评估)。这会修复“勃艮第一头撞死在列日”的bug。


Passive Subjects

消极属国


Players with Rights of Man are able to set their subjects' military focus to "Passive" and "Defensive", but these focuses have been a bit wonky for some time. We fixed a number of bugs with these for 1.34, and there is one I would especially like to share.

拥有“人权”扩展包的玩家可以设定附庸的战略方针为“消极”(在本土作战和避免作战)和“防御”(在友方领土防守),但是这些方针在一段时间以来已经不怎么好用了。我们在1.34版本号中修复了这方面的一些bug,其中一个值得我特地拿出来分享一下。


In very simplified terms, this is how Passive was originally coded:

简单来说,这是消极方针一开始编程的内容:


Code:
代码:

Objective #1: Avoid foreign territory.
目标1:避开敌方领土。

Objective #2: Avoid enemy armies on home territory.
目标2:避开本土的敌军。

Objective #3: Avoid attrition (with a big margin if possible).
目标3:避免损耗(如果部队数量很多)。


But then single-province subjects with big armies would stay and take attrition (especially if another country is also standing there), as well as when enemy armies are approaching. So the objectives were reordered:

但是这样一来,只有一个省份但是军队很多的附庸会原地不动、承受损耗(尤其是其他国家的部队也在这里站着),当敌人接近的时候也是如此。所以目标被重新排序为:


Code:
代码:

Objective #1: Avoid enemy armies on home territory.
目标1:避开本土的敌军。

Objective #2: Avoid attrition (with a big margin if possible).
目标2:避免损耗(如果部队数量很多)。

Objective #3: Avoid foreign territory.
目标3:避开敌方领土。


And it turns out the AI knows you can't take attrition while fighting a battle… So "passive" subjects would sometimes actively seek out enemy armies on foreign territory in order to avoid attrition!

结果表明AI目标自己在交战时不会受到损耗,所以“消极”的附庸有时反而会积极在敌境寻找敌军作战来避免损耗!


Other

其他


There have been a number of improvements to for example army and navy handling. This Dev Diary is already long enough, but the biggest bug worth mentioning is when the AI would just lock its armies in place near the coast, while its navy was too afraid (often irrationally) to come and pick them up. This easily caused e.g. Denmark/England/Spain not making themselves useful in wars.

我们在陆海军的操纵等方面作出了很多改进。虽然本篇开发日志已经很长了,但我们还是要提一下这个最大最恶的bug,那就是AI会把军队停在海岸边不动等待上船,而海军又(通常毫无道理地)不敢靠近海岸来运输。这使得丹麦、英格兰以及西班牙等国家很容易在战争中毫无作为。


Historically, many AI bugs have been caused late in the development cycle of a patch, perhaps because they often need time to be found. Right now, we're quite happy with the state of the AI in our internal builds so we will try not to repeat that mistake by stirring things up before 1.34 releases.

此前很多AI方面的bug都是在开发一个补丁的后期才出现的,这可能是由于需要一定的时间才能够发现。现在我们对于内部测试中AI的表现非常满意,因此我们也会尽量避免重复之前的错误,在1.34版本号发布前不会再乱搞。


Patch Notes

补丁附记


Here are roughly the AI-related patch notes so far. This is still WIP and a more final and curated list will be released in connection with the update as usual.

下面列出的是目前与AI相关的修改。目前补丁仍在制作中,更加全面的最终列表仍将与更新共同发布。


Buildings
建筑

- AI will now properly calculate when to construct Docks based on a multitude of factors such as sailor percentage, idea group choices, capital position and more.
- 现在AI能够以水手比例、理念组选择以及首都位置等因素为基础计算选择何时建造船坞。

- Fixed that AI sometimes deleted all forts right after a bad war.
- 修正了AI有时在战后会因经济问题拆除全部要塞的bug。

- Fixed another case of AI deleting forts unnecessarily.
- 修正了另一个AI抽风拆除要塞的问题。

- Fixed bug that 'Conqueror' ruler personality made AI delete all/most forts.
- 修正了“征服者”统治者特质会导致AI拆除全部或大部分要塞的bug。

- AI less keen to build fort in capital (though still preferred). This will somewhat reduce the fort slog in Central Europe.
- 降低了AI在首都建造要塞的权重(虽然仍然优先)。这将或多或少地降低中欧地区的要塞强度。

Budgeting
财政

- Changed AI budgeting algorithm to be more flexible. Fixes e.g. small CNs sometimes not colonizing when they should.
- 修改了AI的财政算法使其更加灵活。修正了如小型殖民领有时在应该殖民时却不进行殖民等问题。

Geopolitics - Declare wars
地缘政治——宣战

- Fixed some cases of AI declaring war over provinces it can't/won't take.
- 修正了一些情况下AI以无法或不会夺取的省份作为借口宣战的问题。

- Made AI less likely to declare war on island nations it lacks the transports to invade.
- 现在AI在缺少运输船时更不倾向于向岛国宣战。

- Fixed bug that revolutionary AI could declare war on coalition target with any cb, thinking coalition members would join.
- 修正了AI革命后认为包围网成员将会参战因而可能以任何理由向包围网目标宣战的bug。

- AI is no longer blocked from declaring independence when at war.
- 现在AI能够在战争中宣布独立。

- Fixed bug that sometimes made aggressor AI erroneously think HRE allies would refuse to join when attacking HRE minors.
- 修正了作为进攻方的AI有时会错误认为在进攻神罗小国时帝国内盟友不会参战的bug。

Geopolitics - Missions and Decisions
地缘政治——任务与决议

- Added AI weights to mission trees which make them now more considerate which mission they want to strive for and how much (for context related reasons).
- 增加了AI在任务方面的权重,使得现在AI更慎重决定优先完成的任务及其优先度(原因与背景条件有关)。

- AI now understands and tries to achieve army_size and army_size_percent triggers in missions.
- 现在AI能够理解并完成任务中的army_size(陆军规模)和army_size_percent(陆军规模比例)要求。

Geopolitics - Other
地缘政治——其他

- Fixed bug that AI couldn't get hostile towards, and hence rarely attacked, others’ vassals and some other subjects.
- 修正了AI不会对其他国家的附庸和一部分其他形式的附属国产生敌意态度,因而很少攻击他们的bug。

- AI is now better at evaluating when to annex/integrate a subject.
- 现在AI能更好地评估何时吞并附属国。

- Fixed bug that catholic AI colonial nations avoided expanding into overlord's Tordesilla regions.
- 修正了天主教AI殖民国避免在宗主国被托尔德西利亚斯条约认可的区域进行殖民的bug。

- Reduced AI avoidance of having interest in provinces that are vital to allies.
- 降低了AI避免将盟友的重大利益省份视为利益攸关的倾向。

- AI Duchies are now permanently interested in provinces of their culture, Kingdoms their entire culture group, and Empires also all provinces on their border.
- 现在AI公国会永远将同文化省份视为利益攸关,王国将整个文化组视为利益攸关,帝国将所有接壤省份视为利益攸关。

Peacemaking
和平条件

- Fixed some issues with AI peace acceptance 'wants other concessions than gold' and 'does not want anything else', causing AI to often leave OPMs in peaces.
- 修正了AI在和平条件中“比起金钱,更希望其他让步”以及“不想索要更多”,导致一地小国在战后仍然存活的问题。

- Fixed bug sometimes preventing AI from taking the last enemy province.
- 修正了有时AI无法索取敌人最后一个省份的bug。

- AI warleaders are now more happy to make separate peaces with non-cobelligerents.
- 现在AI战争盟主更愿意与非联合参战的敌人单独议和。

- AI will unconditionally surrender in more cases.
- 现在AI将在更多情况下无条件投降。

Army
陆军

- Fixed one bug that made AI send armies far away instead of defending home.
- 修正了一个AI将军队派往远方而不防守本土的bug。

- Made AI more likely to reinforce adjacent battles.
- 现在AI更愿意支援临近的战斗。

- Improved AI attrition handling. Should get both less attrition and less confused behavior.
- 提高了AI对于损耗的控制能力。这应该能够减少AI的损耗以及迷惑行为。

- Fixed bug that AI helped allies with rebels even when at peace.
- 修正了AI在和平时仍帮助盟友剿匪的bug。

- AI overlord now treat subjects' rebels like their own in more cases.
- 现在AI领主在更多情况下会将附属国的叛军也视为自己的叛军。

- Fixed bug that made AI ignore flanking when evaluating battle.
- 修正了AI在评估战斗时忽略侧翼攻击的bug。

- Fixed multiple cases of AI subjects being stupid when set to Passive or Defensive.
- 修正了AI附属国方针为消极或防御时会犯蠢的多种情况。

- Increased preferred size of AI armies, especially late game.
- 增加了AI倾向于维持的军队规模,尤其是游戏后期。

- Increased AI desire to disrupt sieges, especially with high progress.
- 提高了AI打断敌方围城的欲望,尤其当围攻进度较高时。

- Improved AI logic for when to abandon sieges.
- 提高了AI对于何时放弃围城的逻辑能力。

- Made AI armies prioritize coordinated offensives more.
- 现在AI会更优先开展协同进攻。

- Made army AI try to stay close to enemy armies when it has nothing else to do.
- 现在AI军队在无事可做时会盯防敌军。

- AI somewhat more likely to defend homeland.
- 现在AI略微更倾向于防守本土。

- Improved AI for consolidation before battle.
- 提升了AI在战斗前合并军队的智能水平。

- Fixed instance of AI armies going back and forth when sieging.
- 修正了AI在围城时反复横跳的问题。

- AI vassals no longer delete exiled armies if they can get home.
- 现在AI附庸不会将无法返回本土的放逐状态军队解散。

- Fixed issues with autonomous sieging and rebel suppression missions.
- 修正了自主围城和主动镇压叛乱任务的问题。

- Fixed case of AI armies canceling movement every other day
- 修正了AI军队每过一天都取消行动的问题。

Navy
海军

- Fixed some issues with AI naval invasions.
- 修正了AI海军入侵的一些问题。

- Made AI better at understanding when a naval invasion risks being intercepted.
- 现在AI更能意识到海军入侵被拦截的风险。

- Fixed bug that made AI often unassign general when naval invading.
- 修正了AI经常在海军入侵中解职将领的bug。

- Fixed yet another case of AI naval invasion stalling forever.
- 修正了另一个AI不断停止海军入侵的问题。

- Made AI fleets consider troops further away when protecting straits.
- 现在AI舰队在保护海峡时会考虑到更远处的陆军。

Trade Company
贸易公司

- Fixed bug that AI sometimes wouldn't ever core Trade Company provinces.
- 修正了AI有时不在贸易公司省份造核的bug。

- AI will no longer accidentally remove trade companies by creating states.
- 现在AI不再因直辖而意外移除贸易公司。

Cheats
作弊

- Fixed bug that AI could add provinces to HRE when emperor, even if not a member.
- 修正了AI在当选神罗皇帝却并非成员的情况下能够向神罗添加省份的bug。

- Fixed bug that AI could use Break Alliance for Favors diplomatic action with Leviathan disabled.
- 修正了AI在不启用利维坦时仍能使用人情外交行动中的断绝盟约的bug。


That's it for today. I hope you found this Dev Diary interesting!

以上就是今天的内容了。希望大家能够喜欢!


Next week my colleague @Pavía will be showing all the new Monuments that will be added in the 1.34 Update, along with some game balance and changes we want to share and discuss with the community, coming also for free in the update.

下周我的同事@Pavía将向大家展示1.34版本号加入的新奇观,以及一些游戏平衡性的调整和其他改动,这些都包含在免费更新中。



翻译:Strategemata 李勋回来了

校对:113322qwe1 三等文官猹中堂


欢迎关注UP主和主播小牧Phenix

欢迎关注牧游社微信公众号和知乎专栏!微信公众号改版为信息流,欢迎【置顶订阅】不迷路,即时获得推送消息!

B站在关注分组中设置为【特别关注】,将会在私信内及时收到视频和专栏投稿的推送!

欢迎加入牧有汉化,致力于为玩家社群提供优质内容!组员急切募集中!测试群组822400145!   

本作品英文原文著作权属Paradox interactive AB所有,中文译文著作权属牧有汉化所有。 


EU4开发日志 | 7/19 AI改进的评论 (共 条)

分享到微博请遵守国家法律