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

维多利亚3开发日志#59 | 9/22 人工智能

2022-10-10 17:58 作者:牧有汉化  | 我要投稿

牧游社 牧有汉化翻译


Victoria 3 - Dev Diary #59 – AI

Wizzington, Game Director Victoria 3


Hello and welcome to the 59th Victoria 3 development diary! With the release of the game just a little more than a month away (which honestly feels surreal), one of the last remaining things for us to do alongside bug fixing is to put the final polishing touches on the AI for release. As such, this feels like a good time to talk about the AI of Victoria 3 - how it's designed, how it operates, and what tools modders have available to tweak it. However, I won't really be talking about which exact amount of difficulty the AI provides or which level skill it plays at. Firstly, because perception of AI performance is highly subjective and what is a 'good AI' means something different to just about every player, and second because there’s still a few issues to be ironed out before release, one example being AI-controlled countries too frequently experiencing revolutions (something that should hopefully be greatly improved now, but which has yet to be verified by QA).

大家吼,欢迎来到第59期维多利亚3开发日志!随着距游戏发布只有一个多月的时间(说实话,感觉很不真实),我们在抓虫子的同时,剩下的最后一件事就是为发布版本的AI做最后的抛光。因此,现在是聊聊维多利亚3的AI的好时机——它是怎么设计的、怎么运作的,以及modder们有哪些工具可以对它进行调整。然而我并不会聊AI能提供的准确难度或它技能水平怎么样。首先,这是因为对AI性能的感觉是非常主观的,而“好的AI”对每个玩家都不一样。其次,在发布前仍需解决一些问题,举个例子就是AI控制的国家革命太过频繁了(希望现在能大大改善,但这还需要QA去验证)。


So then, how does the AI in Victoria 3 work? Well, just as in our other Grand Strategy Games, the AI plays the same game you do. It uses all the same features, faces all the same restrictions, and does not receive the advantage of any 'cheats' (with some exceptions if you use certain Game Rules, but more on that later in this dev diary). In addition to this, there are four design principles that guides how the AI should act in Victoria 3:

那么,维多利亚3中的AI是怎么工作的?就像我们的其他大战略游戏一样,AI和你玩一样的游戏。它使用所有相同功能,面临相同限制,并且不接受任何“作弊”会带来的好处(如果你使用了某些游戏规则就会有例外,但本期开发日志后会有更多相关内容)。除此之外,还有四项设计原则,指导维多利亚3中的AI应该如何行动。


1. Roleplaying, not min-maxing: The AI in Victoria 3 should 'roleplay' rather than try to play optimally or 'play like a player'. AIs should not exploit the game and should be acting according to their internally set goals - as an example, it's perfectly okay for a small German state controlled by the AI to want to be absorbed into a unified Germany, even though being annexed is clearly not the optimal way to play Victoria 3.
1、角色扮演,而不是追求最优解。维多利亚3中的AI应当“角色扮演”,而不是试图发挥出最佳水平或者“像玩家一样进行游戏”。AI不应该利用游戏,而应该按照它们内置的目标行事——如AI控制的德国小国想要被吸收进一个统一的德国中,这应该完全可以接受,尽管吞并显然不是玩维多利亚3的最佳方式。

2. Transparency and clarity: The AI's gameplay strategy and decision-making should be comprehensive to a player - if an AI dislikes the player or won't go along with a player's proposal, the player should be able to understand why, and the internal strategies that the AI follows according to the 'roleplaying' principle should be clearly shown to the player.
2、透明度和清晰度。AI的游戏策略和决策对玩家而言应该是全面的——如果AI不喜欢玩家或者不愿意遵从玩家的提议,玩家应该能理解原因,而且AI基于“角色扮演”原则所遵从的内置策略应该清晰地展现给玩家。

3. Moddability, within reason: The AI should be as moddable as it is possible to make it without ruining the performance of the game. While it will likely never be possible (at least with current-gen hardware) to actually expose the AI's core decision-making loop to modders, anywhere where we can allow modders to hook into its decisions through triggers, defines or scripted values, we should do so.
3、在合理范围内的可模组修改性。在不破坏游戏性能的前提下,AI应该是尽量可通过模组修改的。虽然或许永远不可能(至少在当前世代的硬件条件下)将AI的核心决策逻辑完全开放给modder,但只要我们能让modder通过触发器、定义与脚本值来确保它的决策,我们就该这么搞。

4.Not too random, not too deterministic: The AI should generally make decisions based on something I like to refer to as 'semi-randomness': What this means is that an AI looks at the choices it can make, assigns a score to each, and then throws a set amount of randomness into the mix based on how unpredictable we want it to be for that particular type of decision. For example, if the AI is choosing between two different choices that have base scores 50 and 100, and the randomness factor (R) for this decision is 1.0, this means that the actual score ranges for each of the two is between (X / ( 1 + R ) ) to ( X * ( 1 + R ) ) - ie, between 0.5x to 2x the base score, or 25-100 vs 50-200 in this particular example. In other words, while the AI is far more likely to pick the option scored at 100, it's not guaranteed to do so - the option worth 50 could end up scoring higher after randomization. However, if the AI was picking between two options scored 100 and 10 instead, it would always pick the 100-value option with a randomness of 1 as the randomness simply can't beat out the gap in base scores. This is a type of weighting we use in all our games that lets the AI make 'sensible' decisions without being completely deterministic.
4、避免过于随机,避免过于确定。AI通常应该根据我喜欢称为“半随机性”的说法来做决策。这意味着AI会审视它可以做出的选择,给每个选项分配一个权重分数,然后基于我们希望它对该类型的决策有多高的不可预测性,来抛出一组随机组合。例如,如果AI在两个不同选项中做出选择,这两个选择的基础分数是50和100,而这个决策的随机性分数R是1.0,这意味着这两个选项的实际分数范围在(X/(1+R))到(X*(1+R))之间,即0.5倍到2倍的基础分数之间,或者拿这个特定例子来算,25-100对50-200。换而言之,虽然AI更有可能选择100分的选项,但它并不能保证一定这么做——价值50分的选项随机化后最终分数可能更高。然而,如果AI在两个分数为100和10的选项中做选择,它将总会选择随机性为1的100分的选项,因为随机分数无法战胜基础分数的差距。这是我们在所有游戏中都会使用的一种加权方式,可以让AI做出“合理”的决策,而不是完全确定。


But enough preamble, let's dig into the actual AI mechanics in the game! The most central mechanic to the AI in Victoria 3 is the AI Strategies, which follows from all three of these principles. Every AI country in the game is at all times governed by three AI Strategies - one Administrative, one Political and one Diplomatic. Generally speaking, the Administrative strategy decides how the AI develops its economy (for example, should it focus on building plantations for cash crops or try to Industrialize?) and balances its budget, the Political strategy determines which IGs and political reforms the AI favors, and how boldly it's willing to pursue those political reforms, while the Diplomatic strategy determines what geopolitical direction the AI wants to go in (for instance, does it want to pursue colonization or maintain a stance of well-armed isolationism?). Which AI strategies an AI country picks is semi-randomly determined from a set of weights - as an example, countries with a powerful Intelligentsia Interest Group are more likely to pursue a Progressive Political strategy, but never guaranteed to do so.

但这扯远了,让我们来深入聊聊游戏中实际的AI机制!维多利亚3中AI最核心的机制是AI策略,它基于上述所有的3个原则。游戏中的每个AI国家在任何时候都受三种AI策略的支配——管理策略、政治策略与外交策略。一般来说,管理策略决定了AI如何发展其经济(例如,它应该专注于建立经济作物的种植园,还是尝试进行工业化?)并平衡其预算;政治策略决定了AI倾向于哪些政府机构与政治改革,以及它能有多坚持这些政治改革;外交策略决定了AI想走什么样的地缘政治方向(例如,它是想追求殖民化还是保持武装齐全的孤立主义立场?)。一个AI国家选择哪种AI策略是基于权重来半随机决定的——例如,拥有强大的知识分子利益集团的国家更有可能采取进步的政治策略,但并不保证一定会这么做。


Qing at the start of the game tends to have extremely conservative strategies - their goal is solely to maintain internal stability and defend what they already have

在游戏开始时,大清倾向于采取极其保守的策略——他们的目标仅仅是维持内部稳定和保卫他们已经拥有的东西。


The AI strategy system is much more than just broad-strokes AI guidance though: It contains all sorts of values that can be tweaked and hooked into different strategies. Every AI has a hidden 'default' strategy which sets values such as how much it values an Obligation from another country, which Wargoals it's interested in, how aggressive it should be (and against who) and what its baseline Neutrality is in Diplomatic Plays (more on that later). These default values can then be overridden or added onto by the active AI strategies. For example, the AI has a default scoring for the Conquer State war goal against any country against which it has the 'Conquest' strategic desire, based on the GDP and population of the state, whether the AI can reach it, whether it's adjacent, whether it has a port if it's not adjacent, and so on. Then, if this AI country has the 'Unify Germany' diplomatic strategy, this strategy will add an additional value for every North and South German culture state.

不过,AI的战略系统不仅仅是粗线条的AI指引:它包含各种可以调整的数值,并与不同的战略挂钩。每个AI都有一个隐藏的“默认”战略,它设置的数值包括:另一个国家的服从对它有多少价值,它对哪些战争目标感兴趣,它应该有多大的侵略性(以及对谁有侵略性),以及它在外交博弈中的基准中立性(后面会有更多的介绍)。然后,这些默认值可以被激活的AI战略所覆盖或添加。例如,AI对它有“征服”战略欲望的任意地区,会有一个默认的征服地区战争目标的权重评分,这个评分基于该地区的GDP和人口、AI是否能抵达该处、该地区是否相邻、如果它不相邻是否有港口等等因素。然后,如果这个AI国家有“统一德国”的外交战略,这个战略将为每个南北德意志文化的地区增加一个额外的权重分数值。


Some of the scripted logic that goes into AI evaluation of how much an Obligation is worth, something I'm certain modders are going to tinker with!

在AI评估一个服从义务有多少价值的过程中,有一些脚本逻辑,我确信modder们会对其进行修补!


I mentioned Strategic Desires - this is something like a mini-strategy, which each AI country can have against every other Diplomatically Relevant (ie, country they can diplomatically interact with based on Interests, neighbor status and so on) country. Strategic Desires are semi-randomly determined, with weighting for each set in the AI strategies - for example, an AI country with the 'Acquire Colonies' AI strategy is more likely to want to conquer or subjugate Unrecognized countries than one that has 'Maintain Power Balance' as its AI strategy. A major upside of this whole system is that it makes it much easier when we want the AI to pursue specific objectives, such as completing Journal Entries - instead of having to write specialized code for behaviors such as Britain seizing a treaty port from China in the Opium Wars, we simply set the appropriate weights in the AI strategies and the rest handles itself.

我提到了战略欲望Strategic Desires——这类似于一个小型战略,每个AI国家都可以对其他另一个外交相关国家(即他们可以根据利益存在、相邻状态等与之进行外交互动的国家)采取这种策略。战略欲望是半随机决定的,在每一种AI战略中都有一组权重——例如,一个拥有“获取殖民地”AI战略的AI国家,比拥有“维持力量均衡”AI战略的AI国家更有可能想要征服或附庸未被承认的国家。整个系统的一个主要优点是,当我们想让AI追求特定的目标时,例如完成任务日志,就会变得更加容易——我们不需要为诸如英国在鸦片战争中从中国夺取条约港的行为编写专门的代码,我们只需在AI策略中设置适当的权重,其余的AI就会自己处理。


The Ottomans have a Belligerent attitude towards Egypt because of their very low attitude score combined with their 'Conquer' Strategic Desire

奥斯曼人对埃及是好战态度,因为他们的态度评分很低,再加上他们的“征服”战略欲望。


AI strategies and Strategic Desires are of course not static across the entire campaign. Some are set in the history files, while others are allowed to be semi-randomly determined as mentioned above, but over time you can expect them to change. This change can be sped along by certain events - each individual AI Strategy and Strategic Desire has a 'change points' meter that causes it to be re-rolled when that meter hits 100, and there are a number of things that can happen to a country which immediately adds a bunch of change points and may trigger a re-roll. For example, if a country declares bankruptcy, all other AI countries will receive a number of change points on their Strategic Desire towards the country that declared the bankruptcy and will be more likely to roll a non-friendly desire, as bankrupt countries are seen as unworthy allies and easy pickings.

当然,AI战略和战略欲望在整个游戏局中并不是静态的。这有些是在history文件中设定的,而其它的则允许半随机地确定(如前文所述的那样),但随着时间的推移,你可以期待它们会发生变化。这种变化可以被某些事件加速——每个单独的AI战略和战略欲望都有一个“转变点”量表。当该量表达到100时,会导致它被重新掷骰确定,而且游戏中有很多发生在一个国家身上的事情会导致立即增加一堆“转变点”并可能触发重新掷骰。例如,如果一个国家宣布破产,所有其他的AI国家都会在他们的战略欲望上收到针对破产国家的一堆“转变点”,并将更有可能掷出非友好的欲望,因为破产国家被视为不值得信赖的盟友,并且容易被拿捏。


Another, less dramatic example is that whenever a country successfully enacts a new law, a number of change points are added to its Political strategy. Hitting 100 change points doesn't necessarily mean a country's Strategy or Strategic Desire will change though - it is entirely possible that the outcome of the 're-roll' is to simply pick the same old thing over and over again, especially if the AI's scripted preference for that strategy is high.

另一个不太夸张的例子是,每当一个国家成功颁布一项新的法律,其政治战略就会增加一些“转变点”。不过,达到100点“转变点”并不一定意味着一个国家的AI战略或战略欲望会发生变化——“重新掷骰”的结果完全有可能是单纯重复选中同样的老东西,特别是如果AI对该战略的脚本偏好很高的情况下。


Now that we've talked about how the AI functions on a strategic level, let's switch gears and talk about how it operates in another area, namely the economy. The economic management of Victoria 3 can be quite complex, and as such, making AI for it is no trivial task either. There's a lot of factors to consider, even for the most straightforward-seeming action: As an example, let's say the AI is considering whether to build a Tobacco plantation. Simple, right? We just look at the estimated labor costs involved versus the current market price of Tobacco and make a determination on whether it'll turn a profit?

现在我们已经谈到了AI智能在战略层面上是如何运作的,让我们换个角度,谈谈它在另一个领域的运作,也就是经济。维多利亚3的经济管理可能相当复杂,因此,为其制作AI也不是一件小事。即使是看起来最单纯的行动,也有很多因素需要考虑。举个例子,假设AI正在考虑是否要建一个烟草种植园。很简单,对吗?我们只要看一下所涉及的预估劳动力成本与烟草的当前市场价格,然后确定它是否会带来利润就可以了?


Well, no. For one, that market price is going to change as soon as the new building is complete and starts adding more Sell Orders of Tobacco to the Market. What's more, goods substitution also comes into play here: The increased supply of Tobacco will, over time, lead to Pops buying more Tobacco as part of their Intoxicants need, increasing the demand for Tobacco while lowering it for other goods such as liquor (which then in turn would influence the AI's decision making regarding any buildings with production methods that produce liquor).

好吧,不是这样的。首先,一旦新建筑完工并开始向市场增加更多的烟草卖单,市场价格就会发生变化。更重要的是,商品替代也会在这里起作用。烟草供应增加,随着时间的推移,会导致人们购买更多的烟草作为他们成瘾品需求的一部分,增加对烟草的需求,同时降低对其它商品如烈酒的需求(这反过来会影响AI对任何具有生产烈酒的生产方式的建筑的决策)。


So then, how do you account for all these factors without crashing performance every time the AI wants to build something? The solution is a system called Spending Variables, which is a rather unassuming name for how the AI predicts and charts the course of its economy and market. Each AI country's Spending Variables tracks values such as the Buy Orders and Sell Orders that are going to be generated by buildings which are currently in the construction queue or in the process of hiring employees. This means that if the AI is facing a shortage of Tools, and starts building a Tooling Workshop, it can now understand that once the Tooling Workshop is completed, the shortage of Tools will be resolved, and thus doesn't start constructing a second or third Tooling Workshop - and can, for example, queue up a construction after the Tooling Workshop that is going to use Tools as an input, even though that would clearly be a terrible idea under the current market conditions. The Spending Variables of course track a whole lot more data than just buy and sell orders, particularly any complex calculation that doesn't need to be made all the time - such as determining whether the AI feels that it's under a heightened military threat and thus should prioritize military spending.

那么,你要怎么才能在每次AI想建东西的时候,把所有因素都考虑进去还不会严重影响性能呢?解决方案是一个叫作支出变量Spending Variable的系统,作为一个AI预测自身经济与市场并做出相关决策的系统,这名字可谓是十分低调。每个AI国家的支出变量都会追踪像正在建造队列中,或者正在招聘雇员的建筑产生的购买订单和销售订单这样的数值。这意味着,如果AI正在面临工具短缺的问题,并且建造了一个工具作坊,它就能理解一旦工具作坊建造完成,工具短缺的问题就能得到解决,也不会开始建造第二个或者第三个工具作坊——但是却会,比方说,在工具作坊的队列后加一个需要用到工具的建筑,尽管这个决定在当下的市场环境下肯定是一个糟糕的决定。支出变量当然会追踪远比购买订单和销售订单更多的数据,特别是那些不需要一直更改的复杂计算——比如决定AI是否觉得自己处于高度军事威胁之下,从而优先增加军事支出。


Spending Variables are tracked and recorded even for player countries, where they are used for the purposes of prediction - in the shown example, you can tell that expanding the Wheat Farms in Peloponnese is actually going to result in reduced profits for the building due to the price impact on Grain, which means the AI knows this too!

对于玩家国家来说,支出变量也会进行追踪和记录,并用于预测相关的目的——在这个案例中,你可以看出来扩建伯罗奔尼撒的小麦农场会对谷物价格产生影响,实际上反而会降低建筑的利润,这意味着AI也知道这个!


When it comes to making spending decisions based on these variables, the AI actually uses a system that was actually inspired by the development process for Victoria 3 and the issue tracker that we use (JIRA). The AI collects a list of all changes to the government spending it could do, in both directions. For example, subsidizing a particular building, constructing Barracks in a particular state, or reducing the size of its Government Administration in another state. It then assigns each of these actions a Priority and a Score.

等到了用这些变量做支出决定的时候,AI实际上会用一个从维多利亚3开发过程中以及我们用的问题追踪工具(JIRA)中得到了启发的系统。AI会把所有能让政府支出发生变动的东西记在一个表上,不论是增加还是减少。比如,对某个建筑进行补贴,在某个地区建设兵营,或者降低另一个地区的政府行政部门等级。之后AI会给每一个行动指定一个优先级和权重评分。


Priorities are a tag that determines the general circumstances under which the AI will consider increasing or decreasing their spending on this particular item. When increasing spending, the AI will always pick an item of higher priority over an item of lower priority, with the reverse being true when decreasing spending - low-priority items are cut first. It's quite common for the same 'item' (for example, the same building type in the same state) to have a different priority when it comes to increasing vs decreasing spending, as the AI should generally be reluctant to downsize a building it spent a bunch of money to construct unless it absolutely has to.

优先级是一种标记,用于确定AI对某个特定事项增加或减少支出需要考虑的大致情况。当增加支出的时候,AI总是会选取优先级较高的事项,而非优先级较低的,降低支出时则会反过来——先砍掉优先级较低的事项。同一个“事项”(比如,同一个地区内的同一类建筑)在增加和降低支出时经常有不同的优先级,毕竟除非十分必要,AI应该不太愿意把一个刚花了一大笔造出来的建筑进行降级。


The priorities are as follows:

优先级有以下几种:


Must-Have: This is something that the AI considers so critical it’d rather go bankrupt than be without it. The AI will always increase spending on a Must-Have, and never decrease spending. Must-Have is used sparingly, with an example being that the AI will never consider downsizing Government Administration buildings when in a Bureaucracy deficit, as lacking Bureaucracy decreases tax revenue and thus would likely just worsen the situation.
必须整一个:这是AI认为极其重要的事项,宁可破产也不能没有。AI总是会增加这类事项的支出,且永远不会降低支出。这类事项用的地方很少,比如在行政力不足的时候,AI绝对不会考虑降级政府行政部门,因为缺少行政力会降低税收,多半只会让情况变得更差。

Should-Have: This is something that the AI believes is very important and should be acquired as soon as they have a small surplus. The AI is only willing to cut spending on a Should-Have if they’re in debt and can't find any other way to balance the budget.
应该整一个:这是AI觉得很重要,只要有一点盈余就该立即进行的事项。AI只会在负债且没有其他方法来平衡预算时才会减少此类事项的支出。

Wants-to-Have: This is something the AI considers fairly important and will be willing to increase spending on if they have a modest surplus, but isn’t willing to go into debt for and will cut spending on if they have a budget deficit (not counting temporary expenses, of course) and aren't sitting on a large pile of gold reserves.
想要整一个:这是AI觉得相当重要,有一定量的盈余时就会增加此类事项的支出,但不会为此负债,且一旦预算不足(当然,临时支出不会计入)且黄金储备不够高时就会减少此类事项支出。

Nice-to-Have: This is something the AI considers low priority and will only be willing to increase spending on if they have a large surplus and nothing better to do with their money. They will cut spending on nice-to-haves the moment their surplus isn’t looking so good.
整一个也行:这是AI觉得优先级较低,只会在有大量盈余且没有地方花钱时才会增加此类事项支出。一旦盈余不好看了,AI就会立即削减此类事项的支出。

Should-not-Have: This is something the AI has determined it doesn't want at all. It will not increase spending on this item under any circumstances and will cut spending on it as soon as possible.
还是别整了:这是AI觉得一点都不想要的东西。AI在任何情况下都不会增加此类事项的支出,且只要一有机会就会削减此类事项的支出。


Score is a numerical value that is semi-randomly determined and serves as a tie-breaker between two items of the same priority. So for instance, the Belgian AI might consider Barracks in either Wallonia or Flanders and a Naval Base in Flanders to all be Should-Have, but which of the three it actually ends up increasing spending on is determined by the score of each after randomness is factored in. Together, these two allow the AI to make decisions in a way that should neither be too deterministic nor too random, and makes it easier to handle special cases than a purely score-based system would.

权重评分是一个半随机决定的数值,用于决定同一优先级的事项中应该先做哪一个。比如,比利时AI可能会觉得在瓦隆尼亚或佛兰德斯建设一个兵营,以及在佛兰德斯建设一个海军基地都是应该整一个的,但增加的支出最后会轮到这三个中的哪一个,就由考虑随机性之后的每一个选项的评分决定了。两者结合之后,这个机制会让AI以既不那么决定论,也不那么随机的方式行动,也能比一个仅依靠评分的系统更好地处理特殊情况。


AI spending data isn't shown in the interface as we consider that to be *too much* transparency, but can be gleaned using the console. Here, you can see that Prussia thinks it has a good surplus of Bureaucracy and doesn't see any pressing need for more Government Administration buildings

AI的支出数据没有显示在界面上,因为我们认为那样透明度*过大*,但你可以通过控制台收集它们。在这里,你可以看到普鲁士认为它的官僚机构已经很冗余了,而且一点都不认为迫切需要建造更多政府行政建筑。


Moving on from the economy, let's talk about how the AI behaves in Diplomatic Plays, as this is an area where a bunch of things have happened quite recently. If you've been following the official streams and various developer AARs, you may be familiar with the way that the alpha implementation AI used to decide which side to back in a Diplomatic Play: It would assign a score to each side, then add the value of a sway offer on top of that to determine if it was willing to be swayed (and sometimes join a side it strongly preferred even without being swayed). This system has now been enhanced with a few new values that govern AI behavior in Diplomatic Plays: Neutrality, Sympathy, Confidence and Boldness. We'll go through each one in turn and explain how they influence AI decision-making when taking part in a Diplomatic Play.

讲完了经济方面,让我们再来谈谈AI在外交博弈中的表现,因为最近这个领域发生了很多事情。如果你一直在关注官方直播和各种开发人员的AAR,你可能会熟悉alpha实装版本的AI如何决定在外交博弈中支持哪一方:它会给每一方评分,然后在此基础上加算游说你的提案的价值,以确定它是否愿意被游说(有时即使没有被游说也会加入它强烈喜欢的一方)。这个系统现在得到了加强,它有了一些新的数值来管理外交游戏中的AI行为:中立、同情、信心和胆量。我们将依次介绍每个数值,并解释它们如何影响AI在参加外交游戏时的决策。


Neutrality: This is a calculated value that determines how much an AI country wants to stay out of a particular Diplomatic Play, and is based on factors such as which Strategy the AI is pursuing, whether they're in debt, the shape of their army, and whether they consider the conflict to even be worth caring about at all. In order for an AI to take a side or allow themselves to be swayed, the score of joining one side must now beat out both the score of the other side and their Neutrality Score - so if Austria and Prussia are opposing each other in a play, and Russia gives Austria a score of 30 and Prussia a score of -10 while their Neutrality Score is 50, they will be unwilling to join the play on their own accord and will demand a sway from Austria worth at least 21, while for Prussia the sway offer would need to be worth at least 61.

中立:这是一个计算值,决定了一个AI国家不参与某个特定的外交博弈的意愿,基于AI正在追求的战略、它们是否有债务、它们军队的状况,以及它们是否认为冲突值得关注等因素。为了让AI站边或允许自己被游说,现在加入一方的评分必须同时超过加入另一方的评分和它们自己的中立评分——因此,如果奥地利和普鲁士在一场游戏中相互对立,而俄罗斯给奥地利的评分是30,给普鲁士的评分是-10,此时俄罗斯的中立评分是50,那它将不愿意主动加入这场博弈,并将要求奥地利提供价值至少21评分的游说提案;对于普鲁士,游说提案则需要价值至少61评分。


Sympathy: This is a value that is semi-randomly determined for each non-leader participant towards the two leaders, and which is added directly to their willingness to join that side in the play. Countries tend to have higher sympathy for the defender, lower sympathy for enemies of their allies, and higher sympathy for countries that are facing off against an enemy with high infamy. Sympathy will also change over the course of the play: Any side which adds additional wargoals will generate sympathy for the opposing side based on the Infamy of the wargoal added, and similarly any side which receives support from an uncommitted country will generate sympathy for the other side based on how powerful that new backer is in relation to the other countries involved in the play (conversely, losing a backer increases sympathy for the side that now finds itself with less support).

同情:这是一个半随机的数值,是每个非领袖的参与者对两方的态度,这个数值会直接加到他们在博弈中加入该方的意愿中。各个国家往往对防御方有较高的同情,对盟友的敌人有较低的同情,对与恶名昭著的敌人对峙的国家有较高的同情。同情也会在博弈的过程中发生变化。如果任何一方增加了额外的战争目标,都会根据所增加战争目标的恶名而给对方产生同情,同样,如果任何一方获得来自未承诺国家的支持,都会根据新支持者相对于参与博弈的其他国家的强度而给对方产生同情(反之,失去支持者现在会给发现自己所得支持变少的一方增加同情)。


With nothing more in it for them than a little-valued Obligation, Great Britain has no interest in getting involved in this West African dispute as their Neutrality is simply too high

对他们来说,除了一点价值不高的服从外,大不列颠没有兴趣卷入这场西非争端,因为他们的中立性实在太高。


Confidence: This is a calculated value that only applies to the leader of each side of the Diplomatic Play, and determines how they feel about their chances to come out on top if the Play should escalate to war. This is primarily determined by the relative strength and mobilization level of the two sides' militaries, but also by factors such as how well they can bear the cost of a war, how internally divided they are and how capable they think their own national forces are to fend off incursions into their territory. The lower the AI's confidence, the more willing they are to back down, and the more keen they will be to try and secure additional support from uncommitted participants.

信心:这是一个计算值,只适用于外交博弈中每一方的领导国,并决定他们在博弈升级为战争时对自己胜利机会的看法。主要决定因素是双方军队的相对实力和动员水平,但也有如他们对战争成本的承受能力、他们的内部分裂程度以及他们认为自己的国家军队有多大能力抵御对其领土的入侵等因素。AI的信心越低,他们就越愿意退让,也越热衷于尝试从未承诺的参与者那里获得额外的支持。


Boldness: This is a hidden value that is semi-randomly determined for each participant in the Diplomatic Play. Countries with certain Strategies, higher-ranking countries, countries with strong militaries, and countries that are facing annexation in the Play tend to have higher Boldness. Boldness plays a role in multiple different AI decisions such as how early it mobilizes, how willing it is to join plays without being offered anything, but the main role of Boldness is to be compared against Confidence to determine whether the AI is willing to back down rather than let the play go to war. For this, Confidence and Boldness are added together and the lower the result, the more likely the AI is to back down. There's some other factors to this as well, such as how much the AI stands to lose from additional wargoals that could be pressed if the Play escalated to war, but Boldness serves as a way to provide 'predictable randomness' - that is, an AI Modena facing off against Austria alone would have such a bottomed-out Confidence score that it would need an very high random roll for Boldness to let the play escalate to war, even if they’re facing annexation.

胆量:这是一个隐藏数值,对参与外交博弈的每一方来说都是半随机的。拥有某些战略的国家、地位较高的国家、拥有强大军队的国家以及在博弈中面临被吞并的国家往往有较高的胆量。胆量在多个不同的AI决策中发挥作用,例如它多早动员、多愿意在没有任何提议的情况下加入博弈,但胆量的主要作用是与信心进行比较,以确定AI是否愿意退让而非让博弈发展为战争。为此,信心和胆量相加,结果越低,AI就越有可能退缩。还有一些其他的因素,比如若博弈升级到战争,AI会从额外的战争目标中损失多少,不过胆量是一种提供“可预测随机性”的方式——也就是说,AI摩德纳单独面对奥地利的时候,它的信心得分会很低,需要一个非常高的胆量随机掷骰点数才能让博弈升级到战争,即使他们面临被吞并的下场。


Facing the prospect of war with both Prussia and Russia, there is a chance here that Austria is going to back down here if they can't secure more support - though they might also decide that Bohemia must be defended at all costs given its integral status in the Empire

面对同时和普鲁士和俄罗斯交战的前景,如果无法获得更多支持,奥地利就有可能在这里退缩——尽管他们也可能考虑到其在帝国内的地位,决定要不惜任何代价保卫波希米亚。


AI is a personal passion of mine (I actually started out as an AI programmer for Paradox back in 2013, almost 10 years ago now!) and I could probably keep talking about it forever, but this dev diary is getting awfully long, so to wrap it up I just want to cover the AI Game Rules that are available in Victoria 3, since they're a bit different from the usual difficulty settings you might be used to. Because of the complex and interconnected nature of Victoria 3's economy, and our general commitment to simulation, we didn't want to simply have 'High Difficulty' mean that all of the AIs start producing more goods or have a bunch of income created out of nothing, or 'Low Difficulty' mean the same for the player. Instead we decided to focus on how the AI interacts with the player and the rest of the world on a geopolitical level. Following this philosophy, the two AI Game Rules we've added are called 'AI Behavior towards Players' and 'AI Aggression'.

AI 是我个人的一项爱好(其实我早在2013年就开始担任P社的AI程序员了,到现在差不多已经10年了!),我可能会一直不停地谈论它,但这样这篇开发日志可能就会长得可怕,为了让他简短,我就专注于维多利亚3中的AI游戏规则,因为这和你在其他游戏中习惯的通常难度设置有一点不一样。由于维多利亚3中经济的复杂性和关联性,以及我们对模拟的总体承诺,我们不想简单地来一个给所有AI增加生产加成或者火星收入的“高难度”,或者给玩家同样加成的“低难度”。相反我们想专注于AI在地缘政治层面和玩家以及世界其他地方的互动。基于这一理念,我们增加了两项AI游戏规则,“AI对玩家行为”和“AI侵略性”。


AI Aggression goes Low - Standard - High and is relatively straightforward: the higher this is, the more aggressively the AI will act in general towards all other countries. It affects which Strategic Desires they tend to prefer, how likely they are to start Diplomatic Plays to carry out those desires and how willing they are to take on Infamy.

AI侵略性分为低、标准、高,相对比较直接:这个值越高,AI总体对其他国家就越有侵略性。这影响AI偏好的战略期望,开启外交博弈以实现这些期望的可能性,以及承受恶名的意愿。


AI Behavior towards Players, on the other hand goes Lenient - Standard - Harsh and affects only how the AI views player-controlled countries and is the closest thing to a Difficulty setting that we have. With the regular setting of Standard, the AI treats the Player the same as if they were another AI country, with no special considerations. However, you can also set it to Lenient if you want a 'friendlier' experience - this will make the AI more likely to have friendly Strategic Desires towards player countries, make them more likely to support the player in Diplomatic Plays, and will make them unwilling to conquer the player's Homelands unless they have a claim on it. Conversely, if you're an experienced hand at the game and want the AI to treat you like the agent of chaos that you are, you can put this setting to 'Harsh' - this makes the AI far more suspicious of the players' intentions, less willing to support them in Diplomatic Plays unless they have something to very clearly gain from it, and more willing to knock the player down a peg or two should a good opportunity to do so arise.

AI对玩家行为则分为宽松、标准和严苛,只影响AI对玩家控制的国家的看法,这是我们有的最接近难度设置的选项。在标准设置下,AI对玩家和其他AI国家一视同仁,没有额外考量。然而,如果你想要更“友好”的体验,你也可以选择宽松——这会让AI对玩家更可能有友好的战略欲望,更可能在外交博弈中支持玩家,更不愿意征服玩家的本土(除非有宣称)。相反,如果你是经验丰富的玩家,想让AI将你视为混沌的代理人,你可以把选项置为“严苛”——这会让AI更加怀疑玩家的意图,除非有非常明确的收益,否则不愿意在外交博弈中支持玩家,并且更愿意在合适的时机从玩家身上割一点肉。


I call this combination of AI Game Rules the 'Metternich Mode'

我把这组AI游戏规则设置称为“梅涅特模式”。


Alright then! That's it for this dev diary - I hope you find it enlightening, and I hope you find the AI in Victoria 3 fun and interesting to play with and against when the game releases. We still have some things to fix before then, and we're of course going to continue improving, polishing and increasing the moddability of the AI post-release as we do with all our games. I'm particularly interested in hearing about any additional ideas for post-release AI Game Rules that the community may have, as I think that allowing players to tailor their individual AI experience is a great way to deal with some of that subjectivity I mentioned at the start of this dev diary. For now though, farewell and join us again next week as Michael introduces us to Modding in Victoria 3!

好了,这就是这篇日志的全部内容——我希望你觉得它很清晰明确,我也希望你在游戏发布后觉得维多利亚3的AI很好玩,在结盟和对抗时都有足够的乐趣。在此之前我们还有一些bug需要修复,我们也会像其他游戏那样,在游戏发售后继续改进、打磨以及提高AI的可模组性。我特别有兴趣听到游戏发售后社区对于AI游戏规则的看法,因为我认为为了达到我在这篇开发日志开头提到的目标,允许玩家定制自己个人的AI体验是很好的解决方案。不过现在,让我们告别并在下周的开发日志再见,届时 Michael 将介绍维多利亚3的模组功能。



翻译:月蚀 雷敏Duke AntiAccess 子炎君 Yakuky

校对:三等文官猹中堂


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

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

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

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

维多利亚3开发日志#59 | 9/22 人工智能的评论 (共 条)

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