維多利亞3開發(fā)日志#59 | 9/22 人工智能

牧游社 牧有漢化翻譯
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開發(fā)日志!隨著距游戲發(fā)布只有一個(gè)多月的時(shí)間(說實(shí)話,感覺很不真實(shí)),我們在抓蟲子的同時(shí),剩下的最后一件事就是為發(fā)布版本的AI做最后的拋光。因此,現(xiàn)在是聊聊維多利亞3的AI的好時(shí)機(jī)——它是怎么設(shè)計(jì)的、怎么運(yùn)作的,以及modder們有哪些工具可以對它進(jìn)行調(diào)整。然而我并不會聊AI能提供的準(zhǔn)確難度或它技能水平怎么樣。首先,這是因?yàn)閷I性能的感覺是非常主觀的,而“好的AI”對每個(gè)玩家都不一樣。其次,在發(fā)布前仍需解決一些問題,舉個(gè)例子就是AI控制的國家革命太過頻繁了(希望現(xiàn)在能大大改善,但這還需要QA去驗(yàn)證)。
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是怎么工作的?就像我們的其他大戰(zhàn)略游戲一樣,AI和你玩一樣的游戲。它使用所有相同功能,面臨相同限制,并且不接受任何“作弊”會帶來的好處(如果你使用了某些游戲規(guī)則就會有例外,但本期開發(fā)日志后會有更多相關(guān)內(nèi)容)。除此之外,還有四項(xiàng)設(shè)計(jì)原則,指導(dǎo)維多利亞3中的AI應(yīng)該如何行動。
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、角色扮演,而不是追求最優(yōu)解。維多利亞3中的AI應(yīng)當(dāng)“角色扮演”,而不是試圖發(fā)揮出最佳水平或者“像玩家一樣進(jìn)行游戲”。AI不應(yīng)該利用游戲,而應(yīng)該按照它們內(nèi)置的目標(biāo)行事——如AI控制的德國小國想要被吸收進(jìn)一個(gè)統(tǒng)一的德國中,這應(yīng)該完全可以接受,盡管吞并顯然不是玩維多利亞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的游戲策略和決策對玩家而言應(yīng)該是全面的——如果AI不喜歡玩家或者不愿意遵從玩家的提議,玩家應(yīng)該能理解原因,而且AI基于“角色扮演”原則所遵從的內(nèi)置策略應(yīng)該清晰地展現(xiàn)給玩家。
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、在合理范圍內(nèi)的可模組修改性。在不破壞游戲性能的前提下,AI應(yīng)該是盡量可通過模組修改的。雖然或許永遠(yuǎn)不可能(至少在當(dāng)前世代的硬件條件下)將AI的核心決策邏輯完全開放給modder,但只要我們能讓modder通過觸發(fā)器、定義與腳本值來確保它的決策,我們就該這么搞。
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、避免過于隨機(jī),避免過于確定。AI通常應(yīng)該根據(jù)我喜歡稱為“半隨機(jī)性”的說法來做決策。這意味著AI會審視它可以做出的選擇,給每個(gè)選項(xiàng)分配一個(gè)權(quán)重分?jǐn)?shù),然后基于我們希望它對該類型的決策有多高的不可預(yù)測性,來拋出一組隨機(jī)組合。例如,如果AI在兩個(gè)不同選項(xiàng)中做出選擇,這兩個(gè)選擇的基礎(chǔ)分?jǐn)?shù)是50和100,而這個(gè)決策的隨機(jī)性分?jǐn)?shù)R是1.0,這意味著這兩個(gè)選項(xiàng)的實(shí)際分?jǐn)?shù)范圍在(X/(1+R))到(X*(1+R))之間,即0.5倍到2倍的基礎(chǔ)分?jǐn)?shù)之間,或者拿這個(gè)特定例子來算,25-100對50-200。換而言之,雖然AI更有可能選擇100分的選項(xiàng),但它并不能保證一定這么做——價(jià)值50分的選項(xiàng)隨機(jī)化后最終分?jǐn)?shù)可能更高。然而,如果AI在兩個(gè)分?jǐn)?shù)為100和10的選項(xiàng)中做選擇,它將總會選擇隨機(jī)性為1的100分的選項(xiàng),因?yàn)殡S機(jī)分?jǐn)?shù)無法戰(zhàn)勝基礎(chǔ)分?jǐn)?shù)的差距。這是我們在所有游戲中都會使用的一種加權(quán)方式,可以讓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.
但這扯遠(yuǎn)了,讓我們來深入聊聊游戲中實(shí)際的AI機(jī)制!維多利亞3中AI最核心的機(jī)制是AI策略,它基于上述所有的3個(gè)原則。游戲中的每個(gè)AI國家在任何時(shí)候都受三種AI策略的支配——管理策略、政治策略與外交策略。一般來說,管理策略決定了AI如何發(fā)展其經(jīng)濟(jì)(例如,它應(yīng)該專注于建立經(jīng)濟(jì)作物的種植園,還是嘗試進(jìn)行工業(yè)化?)并平衡其預(yù)算;政治策略決定了AI傾向于哪些政府機(jī)構(gòu)與政治改革,以及它能有多堅(jiān)持這些政治改革;外交策略決定了AI想走什么樣的地緣政治方向(例如,它是想追求殖民化還是保持武裝齊全的孤立主義立場?)。一個(gè)AI國家選擇哪種AI策略是基于權(quán)重來半隨機(jī)決定的——例如,擁有強(qiáng)大的知識分子利益集團(tuán)的國家更有可能采取進(jìn)步的政治策略,但并不保證一定會這么做。

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在游戲開始時(shí),大清傾向于采取極其保守的策略——他們的目標(biāo)僅僅是維持內(nèi)部穩(wěn)定和保衛(wèi)他們已經(jīng)擁有的東西。
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的戰(zhàn)略系統(tǒng)不僅僅是粗線條的AI指引:它包含各種可以調(diào)整的數(shù)值,并與不同的戰(zhàn)略掛鉤。每個(gè)AI都有一個(gè)隱藏的“默認(rèn)”戰(zhàn)略,它設(shè)置的數(shù)值包括:另一個(gè)國家的服從對它有多少價(jià)值,它對哪些戰(zhàn)爭目標(biāo)感興趣,它應(yīng)該有多大的侵略性(以及對誰有侵略性),以及它在外交博弈中的基準(zhǔn)中立性(后面會有更多的介紹)。然后,這些默認(rèn)值可以被激活的AI戰(zhàn)略所覆蓋或添加。例如,AI對它有“征服”戰(zhàn)略欲望的任意地區(qū),會有一個(gè)默認(rèn)的征服地區(qū)戰(zhàn)爭目標(biāo)的權(quán)重評分,這個(gè)評分基于該地區(qū)的GDP和人口、AI是否能抵達(dá)該處、該地區(qū)是否相鄰、如果它不相鄰是否有港口等等因素。然后,如果這個(gè)AI國家有“統(tǒng)一德國”的外交戰(zhàn)略,這個(gè)戰(zhàn)略將為每個(gè)南北德意志文化的地區(qū)增加一個(gè)額外的權(quán)重分?jǐn)?shù)值。

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評估一個(gè)服從義務(wù)有多少價(jià)值的過程中,有一些腳本邏輯,我確信modder們會對其進(jìn)行修補(bǔ)!
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.
我提到了戰(zhàn)略欲望Strategic Desires——這類似于一個(gè)小型戰(zhàn)略,每個(gè)AI國家都可以對其他另一個(gè)外交相關(guān)國家(即他們可以根據(jù)利益存在、相鄰狀態(tài)等與之進(jìn)行外交互動的國家)采取這種策略。戰(zhàn)略欲望是半隨機(jī)決定的,在每一種AI戰(zhàn)略中都有一組權(quán)重——例如,一個(gè)擁有“獲取殖民地”AI戰(zhàn)略的AI國家,比擁有“維持力量均衡”AI戰(zhàn)略的AI國家更有可能想要征服或附庸未被承認(rèn)的國家。整個(gè)系統(tǒng)的一個(gè)主要優(yōu)點(diǎn)是,當(dāng)我們想讓AI追求特定的目標(biāo)時(shí),例如完成任務(wù)日志,就會變得更加容易——我們不需要為諸如英國在鴉片戰(zhàn)爭中從中國奪取條約港的行為編寫專門的代碼,我們只需在AI策略中設(shè)置適當(dāng)?shù)臋?quán)重,其余的AI就會自己處理。

The Ottomans have a Belligerent attitude towards Egypt because of their very low attitude score combined with their 'Conquer' Strategic Desire奧斯曼人對埃及是好戰(zhàn)態(tài)度,因?yàn)樗麄兊膽B(tài)度評分很低,再加上他們的“征服”戰(zhàn)略欲望。
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.
當(dāng)然,AI戰(zhàn)略和戰(zhàn)略欲望在整個(gè)游戲局中并不是靜態(tài)的。這有些是在history文件中設(shè)定的,而其它的則允許半隨機(jī)地確定(如前文所述的那樣),但隨著時(shí)間的推移,你可以期待它們會發(fā)生變化。這種變化可以被某些事件加速——每個(gè)單獨(dú)的AI戰(zhàn)略和戰(zhàn)略欲望都有一個(gè)“轉(zhuǎn)變點(diǎn)”量表。當(dāng)該量表達(dá)到100時(shí),會導(dǎo)致它被重新擲骰確定,而且游戲中有很多發(fā)生在一個(gè)國家身上的事情會導(dǎo)致立即增加一堆“轉(zhuǎn)變點(diǎn)”并可能觸發(fā)重新擲骰。例如,如果一個(gè)國家宣布破產(chǎn),所有其他的AI國家都會在他們的戰(zhàn)略欲望上收到針對破產(chǎn)國家的一堆“轉(zhuǎn)變點(diǎn)”,并將更有可能擲出非友好的欲望,因?yàn)槠飘a(chǎn)國家被視為不值得信賴的盟友,并且容易被拿捏。
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.
另一個(gè)不太夸張的例子是,每當(dāng)一個(gè)國家成功頒布一項(xiàng)新的法律,其政治戰(zhàn)略就會增加一些“轉(zhuǎn)變點(diǎn)”。不過,達(dá)到100點(diǎn)“轉(zhuǎn)變點(diǎn)”并不一定意味著一個(gè)國家的AI戰(zhàn)略或戰(zhàn)略欲望會發(fā)生變化——“重新擲骰”的結(jié)果完全有可能是單純重復(fù)選中同樣的老東西,特別是如果AI對該戰(zhàn)略的腳本偏好很高的情況下。
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?
現(xiàn)在我們已經(jīng)談到了AI智能在戰(zhàn)略層面上是如何運(yùn)作的,讓我們換個(gè)角度,談?wù)勊诹硪粋€(gè)領(lǐng)域的運(yùn)作,也就是經(jīng)濟(jì)。維多利亞3的經(jīng)濟(jì)管理可能相當(dāng)復(fù)雜,因此,為其制作AI也不是一件小事。即使是看起來最單純的行動,也有很多因素需要考慮。舉個(gè)例子,假設(shè)AI正在考慮是否要建一個(gè)煙草種植園。很簡單,對嗎?我們只要看一下所涉及的預(yù)估勞動力成本與煙草的當(dāng)前市場價(jià)格,然后確定它是否會帶來利潤就可以了?
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).
好吧,不是這樣的。首先,一旦新建筑完工并開始向市場增加更多的煙草賣單,市場價(jià)格就會發(fā)生變化。更重要的是,商品替代也會在這里起作用。煙草供應(yīng)增加,隨著時(shí)間的推移,會導(dǎo)致人們購買更多的煙草作為他們成癮品需求的一部分,增加對煙草的需求,同時(shí)降低對其它商品如烈酒的需求(這反過來會影響AI對任何具有生產(chǎn)烈酒的生產(chǎn)方式的建筑的決策)。
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想建東西的時(shí)候,把所有因素都考慮進(jìn)去還不會嚴(yán)重影響性能呢?解決方案是一個(gè)叫作支出變量Spending Variable的系統(tǒng),作為一個(gè)AI預(yù)測自身經(jīng)濟(jì)與市場并做出相關(guān)決策的系統(tǒng),這名字可謂是十分低調(diào)。每個(gè)AI國家的支出變量都會追蹤像正在建造隊(duì)列中,或者正在招聘雇員的建筑產(chǎn)生的購買訂單和銷售訂單這樣的數(shù)值。這意味著,如果AI正在面臨工具短缺的問題,并且建造了一個(gè)工具作坊,它就能理解一旦工具作坊建造完成,工具短缺的問題就能得到解決,也不會開始建造第二個(gè)或者第三個(gè)工具作坊——但是卻會,比方說,在工具作坊的隊(duì)列后加一個(gè)需要用到工具的建筑,盡管這個(gè)決定在當(dāng)下的市場環(huán)境下肯定是一個(gè)糟糕的決定。支出變量當(dāng)然會追蹤遠(yuǎn)比購買訂單和銷售訂單更多的數(shù)據(jù),特別是那些不需要一直更改的復(fù)雜計(jì)算——比如決定AI是否覺得自己處于高度軍事威脅之下,從而優(yōu)先增加軍事支出。

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!對于玩家國家來說,支出變量也會進(jìn)行追蹤和記錄,并用于預(yù)測相關(guān)的目的——在這個(gè)案例中,你可以看出來擴(kuò)建伯羅奔尼撒的小麥農(nóng)場會對谷物價(jià)格產(chǎn)生影響,實(shí)際上反而會降低建筑的利潤,這意味著AI也知道這個(gè)!
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.
等到了用這些變量做支出決定的時(shí)候,AI實(shí)際上會用一個(gè)從維多利亞3開發(fā)過程中以及我們用的問題追蹤工具(JIRA)中得到了啟發(fā)的系統(tǒng)。AI會把所有能讓政府支出發(fā)生變動的東西記在一個(gè)表上,不論是增加還是減少。比如,對某個(gè)建筑進(jìn)行補(bǔ)貼,在某個(gè)地區(qū)建設(shè)兵營,或者降低另一個(gè)地區(qū)的政府行政部門等級。之后AI會給每一個(gè)行動指定一個(gè)優(yōu)先級和權(quán)重評分。
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.
優(yōu)先級是一種標(biāo)記,用于確定AI對某個(gè)特定事項(xiàng)增加或減少支出需要考慮的大致情況。當(dāng)增加支出的時(shí)候,AI總是會選取優(yōu)先級較高的事項(xiàng),而非優(yōu)先級較低的,降低支出時(shí)則會反過來——先砍掉優(yōu)先級較低的事項(xiàng)。同一個(gè)“事項(xiàng)”(比如,同一個(gè)地區(qū)內(nèi)的同一類建筑)在增加和降低支出時(shí)經(jīng)常有不同的優(yōu)先級,畢竟除非十分必要,AI應(yīng)該不太愿意把一個(gè)剛花了一大筆造出來的建筑進(jìn)行降級。
The priorities are as follows:
優(yōu)先級有以下幾種:
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.
必須整一個(gè):這是AI認(rèn)為極其重要的事項(xiàng),寧可破產(chǎn)也不能沒有。AI總是會增加這類事項(xiàng)的支出,且永遠(yuǎn)不會降低支出。這類事項(xiàng)用的地方很少,比如在行政力不足的時(shí)候,AI絕對不會考慮降級政府行政部門,因?yàn)槿鄙傩姓档投愂?,多半只會讓情況變得更差。
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.
應(yīng)該整一個(gè):這是AI覺得很重要,只要有一點(diǎn)盈余就該立即進(jìn)行的事項(xiàng)。AI只會在負(fù)債且沒有其他方法來平衡預(yù)算時(shí)才會減少此類事項(xiàng)的支出。
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.
想要整一個(gè):這是AI覺得相當(dāng)重要,有一定量的盈余時(shí)就會增加此類事項(xiàng)的支出,但不會為此負(fù)債,且一旦預(yù)算不足(當(dāng)然,臨時(shí)支出不會計(jì)入)且黃金儲備不夠高時(shí)就會減少此類事項(xiàng)支出。
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.
整一個(gè)也行:這是AI覺得優(yōu)先級較低,只會在有大量盈余且沒有地方花錢時(shí)才會增加此類事項(xiàng)支出。一旦盈余不好看了,AI就會立即削減此類事項(xiàng)的支出。
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覺得一點(diǎn)都不想要的東西。AI在任何情況下都不會增加此類事項(xiàng)的支出,且只要一有機(jī)會就會削減此類事項(xiàng)的支出。
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.
權(quán)重評分是一個(gè)半隨機(jī)決定的數(shù)值,用于決定同一優(yōu)先級的事項(xiàng)中應(yīng)該先做哪一個(gè)。比如,比利時(shí)AI可能會覺得在瓦隆尼亞或佛蘭德斯建設(shè)一個(gè)兵營,以及在佛蘭德斯建設(shè)一個(gè)海軍基地都是應(yīng)該整一個(gè)的,但增加的支出最后會輪到這三個(gè)中的哪一個(gè),就由考慮隨機(jī)性之后的每一個(gè)選項(xiàng)的評分決定了。兩者結(jié)合之后,這個(gè)機(jī)制會讓AI以既不那么決定論,也不那么隨機(jī)的方式行動,也能比一個(gè)僅依靠評分的系統(tǒng)更好地處理特殊情況。

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 buildingsAI的支出數(shù)據(jù)沒有顯示在界面上,因?yàn)槲覀冋J(rèn)為那樣透明度*過大*,但你可以通過控制臺收集它們。在這里,你可以看到普魯士認(rèn)為它的官僚機(jī)構(gòu)已經(jīng)很冗余了,而且一點(diǎn)都不認(rèn)為迫切需要建造更多政府行政建筑。
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.
講完了經(jīng)濟(jì)方面,讓我們再來談?wù)凙I在外交博弈中的表現(xiàn),因?yàn)樽罱@個(gè)領(lǐng)域發(fā)生了很多事情。如果你一直在關(guān)注官方直播和各種開發(fā)人員的AAR,你可能會熟悉alpha實(shí)裝版本的AI如何決定在外交博弈中支持哪一方:它會給每一方評分,然后在此基礎(chǔ)上加算游說你的提案的價(jià)值,以確定它是否愿意被游說(有時(shí)即使沒有被游說也會加入它強(qiáng)烈喜歡的一方)。這個(gè)系統(tǒng)現(xiàn)在得到了加強(qiáng),它有了一些新的數(shù)值來管理外交游戲中的AI行為:中立、同情、信心和膽量。我們將依次介紹每個(gè)數(shù)值,并解釋它們?nèi)绾斡绊慉I在參加外交游戲時(shí)的決策。
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.
中立:這是一個(gè)計(jì)算值,決定了一個(gè)AI國家不參與某個(gè)特定的外交博弈的意愿,基于AI正在追求的戰(zhàn)略、它們是否有債務(wù)、它們軍隊(duì)的狀況,以及它們是否認(rèn)為沖突值得關(guān)注等因素。為了讓AI站邊或允許自己被游說,現(xiàn)在加入一方的評分必須同時(shí)超過加入另一方的評分和它們自己的中立評分——因此,如果奧地利和普魯士在一場游戲中相互對立,而俄羅斯給奧地利的評分是30,給普魯士的評分是-10,此時(shí)俄羅斯的中立評分是50,那它將不愿意主動加入這場博弈,并將要求奧地利提供價(jià)值至少21評分的游說提案;對于普魯士,游說提案則需要價(jià)值至少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).
同情:這是一個(gè)半隨機(jī)的數(shù)值,是每個(gè)非領(lǐng)袖的參與者對兩方的態(tài)度,這個(gè)數(shù)值會直接加到他們在博弈中加入該方的意愿中。各個(gè)國家往往對防御方有較高的同情,對盟友的敵人有較低的同情,對與惡名昭著的敵人對峙的國家有較高的同情。同情也會在博弈的過程中發(fā)生變化。如果任何一方增加了額外的戰(zhàn)爭目標(biāo),都會根據(jù)所增加戰(zhàn)爭目標(biāo)的惡名而給對方產(chǎn)生同情,同樣,如果任何一方獲得來自未承諾國家的支持,都會根據(jù)新支持者相對于參與博弈的其他國家的強(qiáng)度而給對方產(chǎn)生同情(反之,失去支持者現(xiàn)在會給發(fā)現(xiàn)自己所得支持變少的一方增加同情)。

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
對他們來說,除了一點(diǎn)價(jià)值不高的服從外,大不列顛沒有興趣卷入這場西非爭端,因?yàn)樗麄兊闹辛⑿詫?shí)在太高。
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.
信心:這是一個(gè)計(jì)算值,只適用于外交博弈中每一方的領(lǐng)導(dǎo)國,并決定他們在博弈升級為戰(zhàn)爭時(shí)對自己勝利機(jī)會的看法。主要決定因素是雙方軍隊(duì)的相對實(shí)力和動員水平,但也有如他們對戰(zhàn)爭成本的承受能力、他們的內(nèi)部分裂程度以及他們認(rèn)為自己的國家軍隊(duì)有多大能力抵御對其領(lǐng)土的入侵等因素。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.
膽量:這是一個(gè)隱藏?cái)?shù)值,對參與外交博弈的每一方來說都是半隨機(jī)的。擁有某些戰(zhàn)略的國家、地位較高的國家、擁有強(qiáng)大軍隊(duì)的國家以及在博弈中面臨被吞并的國家往往有較高的膽量。膽量在多個(gè)不同的AI決策中發(fā)揮作用,例如它多早動員、多愿意在沒有任何提議的情況下加入博弈,但膽量的主要作用是與信心進(jìn)行比較,以確定AI是否愿意退讓而非讓博弈發(fā)展為戰(zhàn)爭。為此,信心和膽量相加,結(jié)果越低,AI就越有可能退縮。還有一些其他的因素,比如若博弈升級到戰(zhàn)爭,AI會從額外的戰(zhàn)爭目標(biāo)中損失多少,不過膽量是一種提供“可預(yù)測隨機(jī)性”的方式——也就是說,AI摩德納單獨(dú)面對奧地利的時(shí)候,它的信心得分會很低,需要一個(gè)非常高的膽量隨機(jī)擲骰點(diǎn)數(shù)才能讓博弈升級到戰(zhàn)爭,即使他們面臨被吞并的下場。

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面對同時(shí)和普魯士和俄羅斯交戰(zhàn)的前景,如果無法獲得更多支持,奧地利就有可能在這里退縮——盡管他們也可能考慮到其在帝國內(nèi)的地位,決定要不惜任何代價(jià)保衛(wèi)波希米亞。
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 是我個(gè)人的一項(xiàng)愛好(其實(shí)我早在2013年就開始擔(dān)任P社的AI程序員了,到現(xiàn)在差不多已經(jīng)10年了?。铱赡軙恢辈煌5卣?wù)撍?,但這樣這篇開發(fā)日志可能就會長得可怕,為了讓他簡短,我就專注于維多利亞3中的AI游戲規(guī)則,因?yàn)檫@和你在其他游戲中習(xí)慣的通常難度設(shè)置有一點(diǎn)不一樣。由于維多利亞3中經(jīng)濟(jì)的復(fù)雜性和關(guān)聯(lián)性,以及我們對模擬的總體承諾,我們不想簡單地來一個(gè)給所有AI增加生產(chǎn)加成或者火星收入的“高難度”,或者給玩家同樣加成的“低難度”。相反我們想專注于AI在地緣政治層面和玩家以及世界其他地方的互動?;谶@一理念,我們增加了兩項(xiàng)AI游戲規(guī)則,“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侵略性分為低、標(biāo)準(zhǔn)、高,相對比較直接:這個(gè)值越高,AI總體對其他國家就越有侵略性。這影響AI偏好的戰(zhàn)略期望,開啟外交博弈以實(shí)現(xiàn)這些期望的可能性,以及承受惡名的意愿。
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對玩家行為則分為寬松、標(biāo)準(zhǔn)和嚴(yán)苛,只影響AI對玩家控制的國家的看法,這是我們有的最接近難度設(shè)置的選項(xiàng)。在標(biāo)準(zhǔn)設(shè)置下,AI對玩家和其他AI國家一視同仁,沒有額外考量。然而,如果你想要更“友好”的體驗(yàn),你也可以選擇寬松——這會讓AI對玩家更可能有友好的戰(zhàn)略欲望,更可能在外交博弈中支持玩家,更不愿意征服玩家的本土(除非有宣稱)。相反,如果你是經(jīng)驗(yàn)豐富的玩家,想讓AI將你視為混沌的代理人,你可以把選項(xiàng)置為“嚴(yán)苛”——這會讓AI更加懷疑玩家的意圖,除非有非常明確的收益,否則不愿意在外交博弈中支持玩家,并且更愿意在合適的時(shí)機(jī)從玩家身上割一點(diǎn)肉。

I call this combination of AI Game Rules the 'Metternich Mode'我把這組AI游戲規(guī)則設(shè)置稱為“梅涅特模式”。
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!
好了,這就是這篇日志的全部內(nèi)容——我希望你覺得它很清晰明確,我也希望你在游戲發(fā)布后覺得維多利亞3的AI很好玩,在結(jié)盟和對抗時(shí)都有足夠的樂趣。在此之前我們還有一些bug需要修復(fù),我們也會像其他游戲那樣,在游戲發(fā)售后繼續(xù)改進(jìn)、打磨以及提高AI的可模組性。我特別有興趣聽到游戲發(fā)售后社區(qū)對于AI游戲規(guī)則的看法,因?yàn)槲艺J(rèn)為為了達(dá)到我在這篇開發(fā)日志開頭提到的目標(biāo),允許玩家定制自己個(gè)人的AI體驗(yàn)是很好的解決方案。不過現(xiàn)在,讓我們告別并在下周的開發(fā)日志再見,屆時(shí) Michael 將介紹維多利亞3的模組功能。
翻譯:月蝕 雷敏Duke AntiAccess 子炎君 Yakuky
校對:三等文官猹中堂
歡迎關(guān)注UP主和主播小牧Phenix!
歡迎關(guān)注牧游社微信公眾號和知乎專欄!微信公眾號改版為信息流,歡迎【置頂訂閱】不迷路,即時(shí)獲得推送消息!
B站在關(guān)注分組中設(shè)置為【特別關(guān)注】,將會在私信內(nèi)及時(shí)收到視頻和專欄投稿的推送!
歡迎加入牧有漢化,致力于為玩家社群提供優(yōu)質(zhì)內(nèi)容!組員急切募集中!測試群組822400145!