[关闭]
@fa93hws 2017-06-07T13:59:09.000000Z 字数 10228 阅读 1535

[310517][HOI4 Diary]Czechoslovakia and AI Update #2

HOI4


Hi everyone, this week we will be looking at the last nation for Death or Dishonor and get an AI update from SteelVolt. Lets dive in!
哈喽大家好,这周的DoD开发日志将会谈一下最后一个国策——捷克斯洛伐克。 当然还有ai的更新。

Czechoslovakia
捷克斯洛伐克
Czechoslovakia is probably the biggest what-if of the pre-war period. What if they had made a stand? What if the Allies had not rolled over and abandoned them? Or perhaps - what if Czechoslovakia had come to an “arrangement” with Hitler? What if they had decided not to rely on a France and Britain that failed to defend the Versailles settlement and decided to form an alliance of their own?
捷克斯洛伐克可以说是在架空历史中的战前有最多可能性的国家。如果他们强硬的应对德国绘怎么样呢,如果英法没有放纵德国而是力挺他们又会如何呢?又或者说他们更早之前就和希特勒暗地交易?再或者说他们不指望无法维护维也纳条约的英法,选择自己拉起一个联盟,历史又会如何呢?

Of course, standing up to Germany requires you to prepare the ground, and Czechoslovakia is not entirely without its problems. The marriage between the Czechs and the Slovaks is not a very happy one, you share a long border with the Germans and time is short until you have to make a choice to fight or surrender. You will have to make tough choices on what area to focus on first.
当然了,打铁还需自身硬,没有坚实的基础是很难和德国抗衡的。然而捷克和斯洛伐克的联盟并不是很牢固,再考虑到德捷那漫长的国境线,以及开战前短暂的准备时间,这就导致你不得不决定究竟先着眼哪个方面。

Extensive fortifications in the Sudetenland can slow the enemy down and possibly buy you the time until the western powers come to your rescue, but will take a lot of time to finish. Time you might want to spend on modernizing your army, expanding your air force or building up your industry.
你可以选择在苏台德地区疯狂建设碉堡,在英法能对德国形成威胁前争取足够的时间。不过这个建设的进程将会非常缓慢,或许这点时间你可能会觉得放在军队建设上更加值得?

Historically, Czechoslovakia punched well above their weight in the arms business, keeping pace with several major powers in the fields of aviation and armored warfare. This is represented in game by the national spirit “Skoda Works”, which gives you a fairly sizable boost to your factory output. Together with the export focus branch, you can potentially keep up with Germany in production of war material for a short while.
历史上,捷克斯洛伐克的军工产业相当发达,甚至在空军和装甲部队上不属于几大老牌帝国。在游戏中则表现为一个名为"斯柯达工程"的国家精神,一个客观的工业产能buff。再加上国家焦点,让捷克斯洛伐克的工业潜能与德国媲美。

Diplomatically, you have two basic choices: stand up to Germany or bow down. You then have several options on how to do either. If you decide to make a stand, you can put your trust in the west (Spoiler alert: this did not work out historically), or you can create an Entente of your own, with Yugoslavia and Romania. This path will likely take you to conflict with Hungary down the road.
外交上,对于德国的态度你有两种选择:要么强硬要么怂。当然在这两个大分支下都有些小选项。如果你选择强硬,你可以选择相信英法(开发者剧透"历史上这并没有什么卵用"),或者你也可以选择自己拉一个协约国并邀请南斯拉夫和罗马尼亚。 你选择强硬的话将会不可避免的与匈牙利发生冲突。

Alternatively, you can also decide to side with the world revolution and join the Comintern, but that might not make you very popular with your neighbors.
或者你也可以加入共产国际,加入世界革命的浪潮。然而在你的所有邻国眼里你可能也就变成了一个异类。

Should you decide that living on your knees is better than dying on your feet, you can try and appease Germany by handing over the Sudetenland right away and becoming a German puppet later. However, with Hitler seemingly hell-bent on humiliating the western powers, the Germans might not even accept such a low-key solution.
或许你会觉得好死不如赖活着,那你当然也可以乖乖的把苏台德双手奉上然后安心的做希特勒的小弟。然而似乎他总是一意孤行的喜欢羞辱英法,德国可能并不会这么简简单单的收编你,而是把整个捷克都吞了。

Finally, you can go fascist and try to meet eye to eye with the Germans, becoming either a full-fledged partner in the Axis or a German Satellite state (what that means exactly will be discussed in a future Dev Diary).
最后,你也可以转法西斯来跟元首试着对上眼,来成为一个轴心国中独立的一员,或是成为德国的从属国(这在今后的开发日志会详细的说明的)

Czechoslovakia also comes with voice overs for troops, new 3d models (the Czech have sweet tanks) and leader pictures adding flavor.
捷克斯洛伐克当然也会有新的3D建模和领导者头像

AI Update #2
AI更新No2
Greetings, friends! SteelVolt here again
朋友们大家好,SteelVolt来给你们讲解AI更新了

They tell me it is time for yet another AI diary. Let me start off by thanking all of you who came to my talk at PDXCon. It was fun to see it be so popular that we could barely fit everyone in the room, and there were great questions, several of which I wish I would have had time to elaborate even more on.
上头告诉我今天是第二篇AI更新的时候了。首先我要感谢一下来PDXCon来听我讲话的朋友们。很高兴看到我们如此的受欢迎,热情的观众不得不挤在小小的房间里。很多提问都非常有技术含量,其中不少我真想跟你们继续深入的讨论下去。

At any rate, today I will be talking about the second major AI improvement that has been in the works for 1.4; roles. This is a major addition, plus some smaller changes, to how the template designs for the AI are scripted.
说回正题把,今天我们还是要谈谈1.4更新的AI改进了。主要是针对AI的模板设计增加了很多内容,当然也有一点点修改。
I am going to start off by apologizing to the modders: you will need to revisit you old scripts. The good news is that the scripting is now a far more powerful tool for directing the AI in what to build.
在详细说明AI改动前,我不得不跟mod制作者道歉,你们看来得重做这方面的脚本了。当然了,作为补偿,也要告诉你们一个好消息,脚本现在支持更多的关于AI军队模板设计的功能拉!

First of all: the AI no longer tries to make designs based on equipment. This led to some rather horrible wastes of XP, not to mention the template progression often took some rather strange turns. In stead, the target templates are grouped into roles, with the possibility to set individual uppgrade priorities both for roles as well as for templates. The details about how this is done can be seen in the examples in the spoiler further down.
AI改动的第一点是,装备模板的设计不再与装备挂钩,而是和装备的分类(后简称类,类之中的模板称为成员模板)相关。以前的AI模板的改进看起来总是像单纯的挥霍经验一样,更不用说有些模板看起来非常莫名其妙。现在你还可以针对类或是某个成员模板的优先度单独修改脚本。具体的细节可以看之后的demo脚本文件。

What this means is that the progression through types of equipment, for example armor types, can be grouped into a single role (armor). The production/deployment AI is also now scripted to build roles rather than specific equipment. That means that you through script set it up to have X% of the desired force as a specific role. This also means that entire roles can be turned on or off through script.
这也就是说模板的改进现在是基于他的类,举例来说,所有装甲装备都可以被分进一个泪——装甲部队。现在AI在生产/部署的时候将会读取脚本中与相应的类的段落而采取行动。具体的说,你可以在脚本中写,百分之多少的部队是某类的部队。这个功能当然也说明你可以让一个国家完全不建造某类部队。

A role can contain any number of target templates, which each have some new tweakable values attached to them, including a factor for production priority. This tweaks a base value calculated on the fitness score of each available template.
一个类的部队可以包含任意数量的成员模板,每一个成员模板都有自己的可修改的值,包括生产优先级。游戏中会基于这个优先级自动计算并调整每个成员模板的产量。

What all this means is that we have been able to improve the scriptability both of what the AI designs as well as what it builds, and while we have improved all of this for the base game through the script, I suspect modders will be able to spend significantly more time on it than we have had available for this update.
所有这些对AI的改进说白了,就是让你可以通过修改脚本,来调整AI会如何设计他们的模板以及如何建造。尽管在1.4发行的时候我们肯定已经通过这个功能修改了AI的智商了,不过毕竟你懂我们的,mod制作者能改进的东西我们自己绝对不会认真做的。

The last thing this ties in to is how the AI uses these roles, and for now it is a bit static: the AI will prioritize heavily to put divisions explicitly tagged with the 'garrison' role, into the garrison orders. As a bonus, here is a screen shot showing that, plus two new things that are scriptable through the system; division icon and reinforcement priority.
最后的改进是AI如何使用对应的类。目前来说这点AI将会表现的相对缺乏变化。AI会优先建设被标记为"卫戍"类的成员模板部队并且来执行卫戍命令。除此之外还有新的可mod变量,分别是师的图标以及补充死伤的优先级。

The ability to prioritize roles for orders is something I want to make fully scriptable, but we have not had the time to do this properly for the next update. It is certainly something I am looking at for further improvements of the system.
对于不同类的训练的优先度我本来也是想把它做成可mod的,不过一天6小时的工作时间并不允许我这么做。今后的更新这个功能肯定是会有的!

  1. The new 'role' scope;
    1.4版本的装备分类写法
    armored_GER = {
    This can be named anything. It should not even matter if they have the same names across multiple files for different countries. This example will encompass all the target template entries related to this role. If you want several different armored roles, you are free to make multiple entries for armored. Really, it is all up to you.
    But before we get to the templates themselves, there are a couple of things that need to be set for the role:
    名字可以随便取。不同的文件,不同的国家内有相同的名字也没问题。这个例子会在之后出现多次。当然你也可以创建另外的装甲部队分类,这都是随你便的。回到脚本本身把,有些变量是必须定义的。

  2. Who is this available for:
    针对的国家

    available_for = {
    GER
    }

    Doing this means that this role is available only for Germany. Adding any tags will make it available for them as well. If you do something like this:
    这个意思是这个分类只针对德国,你也可以在花括号内增加其他的国家。

     blocked_for = {
        GER
    }
    

    Means that the role is blocked for Germany, and available for everyone else. This field also takes an arbitrary number of tags.
    这个意思是除了德国以外的国家都有效,这个花括号内同样可以写任意数量的国家

  3. What actual roles is this entry supposed to fill:
    定义分类所必须填写的变量
    This one is important, because it is what the production and deployment AI will be looking at.这一行非常重要,因为AI在建造和部署单位的时候会搜索这个关键词。

roles = {
armor
}

While you CAN use multiple roles, in the typical case it is recommended to stick to only one. The garrison role would have one looking like this:
尽管你是可以在一个大括号内设置多种分类的,但是推荐还是只填一个把。这个例子是卫戍类。

roles = {
garrison
}

And this would make the AI really want to put them in the garrison order.
这就会让AI把相对应的模板分类进卫戍类。

  1. Which existing templates should be included in this role:
    分进类的模板

upgrade_prio = {
factor = 2.0

   modifier = {
       factor = 5
       OR = {
       has_tech = basic_medium_tank
       }
   }

  modifier = {
     factor = 2
    has_tech = main_battle_tank

}
}

Setting the base factor to the same for all your roles means that a small random factor will make the AI update different roles each iteration. The modifiers are all multiplied in with the factor given that all the triggers in them are tested as true.
对于优先度,你可以给所有的类赋一个默认的值。不过这会给AI一些小幅度随机更新不同类的优先度的自由。之下的一些modifiers乘以最初定义的factor的积是最终的factor。

And with that, you can paste your existing template entries into the scope. Here are a couple of new features in those scripts:
把旧的脚本文件粘帖进来,加上这些新的变量基本就可以了。之后还有一点新的功能。

  1. The template entry name:
    模板名

    light_armor_default_GER = {
    This used to be vital to be correctly formated. This has no effect anymore, as it is no longer trying to match it to equipment. So name it whatever you want, even the same name within the same role should not matter. You're welcome ;)

  2. Upgrade priority:
    升级优先度

updrade_prio = {
factor = 2

   modifier = {
       factor = 2
   }

}

This is completely analogous to the role one, except it is only compared to the other templates within the same role, and has not effect on which role is updated, only which template.
这个变量跟类中的优先度的factor很类似,唯一的区别是他是比较这个类中成语模板与其他成员模板的优先度,这对于类的优先度没有任何影响,只对类中的成员模板有影响。

  1. But which template to focus production on:
    生产优先级

production_prio = {
factor = 1

  modifier = {
      factor = 1
 }

}

The AI will build the template with the best score for the role it is assigning to a deployment line. This score can be altered with this. You can use triggers in the exact same way as you would the upgrade prio seen higher up.
AI在生产模板的时候会自行根据参数调节,而这个参数就是在生产优先级中定义的factor了。这个factor的意义以及定义的方式都跟升级优先级中的factor一模一样。

And that is it! The rest is exactly as it used to, only more reliable. Since bugs have been fixed in the match score functionality, you may need to tweak the balance of some numbers, but there is no other new functionality in the system.
这就是所有的AI更新了。其余的大体上没有什么变化。细节上我们修正了几个bug,所以AI表现的会更加稳定。参数的设置不保证平衡性,所以你们可能得自己调。

Of course, all of this comes with a bunch of bugfixes in the template design code. The match score, for example, was still not properly calculated. For this update I actually had the time to sit down and really go through all of that properly.
当然了,一大堆在模板设计的bug都被修复了。AI对不同模板建造的数量权衡在之前经常都不尽如人意。这次的更新我彻底解决了这个问题。

All in all I think and hope that this will give everyone, from modders to casual players alike, a richer experience in HoI4
最后我的目的很简单,就是希望给所有玩家,从mod作者到休闲玩家,一个更丰富的游戏体验。

Next week we will be covering lots of bits and pieces, among them the new subject levels for axis nations.
下周的开发日志将会讲讲一些小细节,还有针对轴心国家的一些新东西。

Don't forget to tune in for World War Wednesday today at 16:00CEST at https://www.twitch.tv/paradoxinteractive as we will be continuing our single player campaign as Yugoslavia! (SteelVolt will also be there to answer AI questions)

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注