意想不到的自我实现减缓了城市:天际线II的开发,揭示技术报告

2024-10-21 13:38来源:

某软件开发商表示,《城市天际线2》独立验证了其“重”的原因。根据验证结果,推测该作品如此重量级发布的原因也被推断出来。

《城市:天际线II》是备受赞誉的城市发展模拟游戏《城市:天际线》的续集。继续之前的工作,Colossal Order将负责开发。在游戏发布之前,他们就宣布游戏将“没有达到预期的基准”。因此,这款游戏一开始就存在缺乏优化的问题,在发行后,我们收到了关于性能问题的报告。

在某些情况下,用户已经独立验证了性能问题的原因,并报告说“每个公民的牙齿都被详细绘制出来了”。有很多争议的事实是,即使是几乎不可见的部分也要详细渲染,这可能会影响性能。对此,开发者否认了角色有牙齿的说法,称牙齿对游戏性能没有太大影响,但也承认了其中的一些问题。

用户独立验证“是什么导致了重负载”

这次Paavo Huhtala对这款游戏的性能问题进行了独立的验证,详细的发现如下。报告已经完成。他是芬兰IT公司Reaktor的软件开发人员。尽管他将游戏引擎作为一种爱好,偶尔也会进行图像编程,但他在开头表示自己并不是一名专业的图像程序员。很明显,他的一些分析可能是错误的。

请注意,Mr. Paavo是在应用1.0.11f1补丁的环境中进行验证的,因此有可能在1.0.12f1补丁中修复了文章中报告的一些问题,该补丁将在稍后发布。然而,他认为,即使有了这个补丁,也很难说问题已经解决了。为了验证,我们使用了一台配备NVIDIA RTX 3080 GPU和AMD Ryzen 7 5800X CPU的中端PC。显然,图形调试器“Renderdoc”被用于调查。

Paavo先生测量了下图中的帧时间(画一帧所花费的时间)。据说测试是在游戏开始后不到一个小时就在一个人口在1000人左右的小镇进行的,可以说是一个人口和城市规模都比较小,操作比较轻的早期环境。另一方面,据说它需要大约87.8ms(毫秒)来绘制,假设它继续在这种状态下运行,帧率将约为11.4fps。如果你想以固定的60fps运行它,帧时间将需要大约16.7ms。至少从下图中可以看出,表演在他的环境中似乎不太舒服。

过于详细的角色模型和LOD问题

那么,是什么原因导致这项工作表现不佳呢?为了探讨这一点,Paavo先生介绍了绘制一帧时发生的各种过程,并分析了绘制每一帧所需的时间。他可能是在试图从所需的漫长过程的角度来分析这项工作的问题。

According to Paavo, the parts that took the most time in the frame time were the Pre-pass and Main pass. This work apparently uses deferred rendering, which draws and lights objects separately, and a 3D model is constructed through each pass. One of the reasons why these processes took so long was apparently the large number of polygons in the citizen character models. The characters in this work have separate polygon meshes for teeth, eyelashes, etc., and even when they are "naked" before hair, clothes, or accessories are added, a huge number of polygons are used.

Furthermore, the characters' polygon meshes do not have variations for LOD (Level of Detail). To put it simply, LOD is a mechanism that renders objects far away from the player's point of view roughly, while objects that are close to the player's perspective are rendered in detail. The aim is to change the drawing depending on the distance and reduce the processing required for drawing. However, at the time of Mr. Paavo's latest verification, this work did not have a variation such as reducing the number of polygons of the model seen from a distance, and it seems that the citizen model was rendered in detail no matter what distance it was viewed from. .The lack of character LOD is also reported by the developer and overseas media.PC GamerThis was acknowledged in a statement to.

Additionally, multiple 3D models with an unnecessarily large number of polygons were found not only in character models but also in small objects around town. Examples include objects such as a case of gas cylinders, a clothesline placed in a residential garden, and a computer keyboard or display inside a building. In addition to the clothespins on the clothesline, even small details that you don't normally see, such as the cables extending from the keyboard and display, were modeled. Additionally, there was a tendency for small items to not have variations suitable for LOD.

 

Mr. Paavo pointed out that the problem is that there are too many detailed 3D models piled up that are rarely seen. In simulation games like this one, where you create a city, models that are not optimized may be crowded together in a single frame, which is an unnecessary burden on the GPU, he said. In addition to this, the game's "culling process", which reduces the load by not drawing invisible parts of objects, was insufficient. In addition, it seems that there was a large burden on processing shadows.

Why was it released with problems?

Mr. Paavo also speculates on the reason why this work was released with the problems mentioned above.According to him, the reason for the graphical issues is that Colossal Order is using Unity's new systemData-Oriented Technology Stack (DOTS)It is said that there are some points in which it is adopted.

The system being developed as DOTS is said to be created using a data-oriented approach that increases the independence of data, rather than the conventional object-oriented approach where data and processing are integrated.for exampleECS (Entity Component System)It is possible to rearrange data specifically for memory access efficiency.AlsoC# Job SystemIt is also possible to maximize the performance of a multi-core CPU by using .

According to Paavo, this work is being developed using Unity 2022.3.7 version as the game engine.In the same version, ECS, which is a part of DOTS,Burst compilerNew technologies such as these are being used. He also praised the introduction of DOTS in this work, "Cities: Skylines II," which makes use of multiple CPU cores much more efficiently than in the previous game. However, on the other hand, we speculate that many of the graphics-related problems are indirectly caused by the new mechanism.

这是因为这项工作使用Direct3D 11和Unity的高清渲染管道(HDRP)来绘制图形。然而,HDRP只适用于传统的基于单一行为的对象,所以使用DOTS(如ECS)构建的游戏将需要转换。Unity为此提供了一种机制。实体图形虽然有一个包可用,但Paavo说在这项工作中没有使用它。

为什么实体图形没有被用作适当的桥梁?在这方面,Paavo推测该特性在这一点上是不完整的,并且所支持的呈现功能是有限的。Unity官方网站查看实体图形,据说剔除处理处于实验实施阶段,并且不支持虚拟纹理等功能,这些功能应该使GPU上的纹理处理更高效。

因此,根据Paavo的研究,《Colossal Order》在使用DOTS时似乎自己建立了一个“连接”系统来绘制图形。因此,如前所述,剔除过程是在不足状态下实现的,这会影响性能。再加上前面提到的3D模型中的大量多边形和LOD不足,游戏目前对GPU的负载非常高。

因为我们的目标是克服以前工作中的问题

Paavo先生推测,Colossal Order采用DOTS是为了消除CPU使用瓶颈,这是之前工作中的一个问题。因此,针对多核cpu的优化似乎已经实现,他认为这款游戏作为模拟游戏具有更大的规模和深度。然而,工作室可能过于依赖官方引擎对DOTS渲染的支持,并不得不在最后一刻自己执行它,导致在优化完成之前发布。我解释了我的观点,没有这样的事情。他说他自己作为软件开发人员也有类似的经历,并且对这些情况有一定程度的理解。

帕沃还回答了一位读者提出的问题,“也许这个作品应该用虚幻引擎5来制作。”他说,对于LOD,你可以使用Nanite,同样的引擎,而对于照明和阴影,你可以使用Lumen和Virtual Shadow Maps等功能。然而,他也认为它不提供与ECS相同的功能,后者允许你构建游戏玩法逻辑和大规模模拟。

Paavo还解释说,因为UE5的编程语言是c++,所以它比Unity更不灵活,更容易创建mod。在之前的游戏中,mod是一个很受欢迎的元素,而开发mod的低障碍可能也是这款游戏的一个重要特点。Unity和UE5都需要资源密集型的专有执行,像Colossal Order这样的小公司可能不得不冒险依靠官方支持。

帕沃先生这次的验证结果报告是基于独立的验证和猜测,但它也提供了对这项工作存在的问题及其背景等各种情况的一瞥。自游戏发布以来,每周都会发布补丁,并进行优化以解决游戏玩法问题。看看未来的补丁是否会改善报告的性能问题将会很有趣。


飞翔网声明:未经许可,不得转载。
资讯