|
本帖最后由 紅塵市長 于 2014-3-16 18:58 编辑
How Things Work: Architecture and Space in SimCity
游戏的原理:模拟城市里的建筑和空间。
Jan30, 2014 Cristian St. Aubyn, Senior Technical Artist
殿堂级精英控译
I'm Cristian St. Aubyn, a Senior TechnicalArtist at the Maxis Emeryville studio, and I work on the art creation process.Recently we released our Modding Policy; you can read that here. Modding is an important part of thehistory of our studio, and we're excited to see what you create.
我是Cristian St. Aubyn, 一名Maxis Emeryville工作室的技术顾问,而我的工作是监管艺术创作过程。我们刚刚才更新了我们的Mod管理条例你可以去这儿读它。建模是我们工作室历史上很重要的一部分而我们也很希望看见你们创造的东西。
Today, I'm happy to introduce you to the firstin a series that we call "How Things Work". This series will help youunderstand the underlying ideas and processes of how we create game assets forSimCity. We hope that this gives insight and understanding that will help youcreate and build Mods.
今天我很高兴的向你介绍全新的博客系列:游戏的原理。这个系列将会帮助你了解到在创造模拟城市的一个物件时背后所需要的思考和工作。我们希望通过阅读和理解这些东西能够更好地帮助你创造和建造自己的MOD.
This first blog is an introduction to how wecreate buildings in SimCity. Our pipeline is complex so I will start with abasic description of the building geometry and then go into the more involvedtopics later. For those interested, we use Maya in combination with a series ofin-house custom tools to create almost all of our game models.
这第一篇博客将会简介我们怎样的去建造一栋房屋。我们的流水线非常的复杂所以我会先讲解基本的建筑多边形然后再讲解更深层的话题。我们基本上在使用maya和一系列的自制工具来创造所有游戏里的模型。
--------------------------------------------------------------------------------
SimCity is a sandbox style game. A player's citycan have an unpredictable combination of buildings, roads, and the like. Unlike"Levels" in more linear games we do not have strict control over thetype and amount of geometry that needs to be rendered at any given time.
模拟城市是一个沙盒类游戏。玩家的城市里可以拥有不可预估的楼房道路的组合。不像普通的线性游戏那样我们无法去强制性的限制任意时间里所能渲染的多边形种类和数量。
Our game engine needs to perform well regardlessof the city that a player winds up creating. To address this issue we look atthe play area and set various "budgets"; in this case polygon budgetswhich are based on the two dimensional space a game asset occupies.
我们的游戏引擎无论玩家创造什么都必须要有一个良好的表现。为了解决这个问题我们将重点放在了区域大小和区域预算上面。而现在我们就要讨论在一个二维平面面积基础上的多边形预算。
Smaller buildings have lower polygon budgets,bigger buildings have larger ones. As long as all buildings stay within theirbudgets, a city filled from edge to edge with any combination of buildingsshould stay within the polygon limits of our rendering engine.
小型的建筑拥有少量的多边形预算,大型建筑拥有大量的多边形预算。只要所有的建筑都没有超过他们的预算的话那么一个从边境建造到边境的城市无论拥有多少种类的建筑都不会超过我们渲染引擎的多边形上限。
--------------------------------------------------------------------------------
Here are a series of screenshots showing what variousbuilding geometry looks like.
下面是一系列的截图来展示各种建筑的多边形:
This image shows one of the smallest buildingsin the game, the "Shotgun Shack." It has the lowest polygon budget ofall, but due to its small footprint it turns out to be a potential performancehog. While each one isn't very complicated, they can be placed very closetogether. When they all add up, a city filled edge-to-edge with "ShotgunShacks" would represent a lot of polygons.
这张图展示的是游戏里最小的建筑之一:平民小屋。它拥有游戏里最小的多边形预算,但是由于他的面积很小所以会造成一个潜在的问题。尽管每个都不是很复杂但是他们却很紧凑。所以当所有这些小屋子加起来的话一个全部铺满了平民小屋的城市也会有很多的多边形。
"Shotgun Shack"
--------------------------------------------------------------------------------
Here's the "Highrise Office", anexample of a larger more detailed building. Buildings like this take up muchmore area and therefore have higher polygon budgets.
这张是高密度办公楼,一个拥有很多细节的建筑。像这样的建筑会占去很大一片面积当然也会拥有更高的多边形预算。
"Highrise Office"
The repetitive nature of the middle of thebuilding allowed us to concentrate most of the geometric detail at thestreet-level and at the top of the building where a player is more likely to see it.
这栋楼房直挺挺的腰部允许我们将大多数的多边形细节放在大道和楼顶层面,而这两个部分一般都是玩家们最容易注意到的部分。
"Highrise Office" Street Level
You can see that polygons have been used at thebase to create architectural detail at the street level. This helps make themodel unique compared to other tower style buildings. It also adds interest atthe street level that players will see when they are zoomed in.
你可以看见用在街道层面的增加建筑几何细节的多边形。这些帮助这个模型从其他高层建筑里区分开来。而且它也使我们我们放大到街道时显得更加的有趣。
"Highrise Office" Roof
Considerable polygons were also focused on thetop and roof of the model as this part of the building will show significantlyas the game camera passed over the building.
而另外一部分的多边形则被使用在了楼顶部分,这一部分的建筑会在游戏摄像机从建筑上空掠过时展现它们的细节。
--------------------------------------------------------------------------------
"Medium" sized buildings can actuallyvary in size, but the lot space they take up on the game map affords then ahigher budget than small buildings. While modeling such a building the polygonsneed to be used where they will give the building detail appropriate to itsdesign.
中等密度的房屋拥有不同的大小,但是它们占据一个更大的空间所以它们比小型建筑拥有更多的预算。当建造这种建筑时多边形将会被使用在最能体现他们设计的地方。
The coal mine shown below needs to have askeletal industrial look. Modeling this much cross bracing would not bepossible in the budget allocated to small buildings. However, this relativelysmall building sits on a medium size lot and has a fairly generous budget forthe physical size of the model itself.
下面这张挖煤机需要一种工业化的骨架结构。建造这种交叉状的模型将使我们保持预算的理想化为泡影。但是这个看起来很小的建筑是放在一个中等的区域里的。所以这个模型的多边型基本上支撑起了它的结构。
"Coal Mine"
"Coal Mine" Detail
--------------------------------------------------------------------------------
Level of Detail:
细节层次
When a model is close, it needs a lot of detail,but when it’s seen from far away, it can be represented with simpler geometry.
当一个模型离我们很近时它需要展现很多的细节。但是当它离我们很远时我们就可以用一个很简单的多边形来代表它。
This is common technique in game engines, andinvolves building multiple LOD’s (Level of Detail) for each model. Using LOD’sdramatically improves performance, and can also help mitigate aliasing andother visual problems.
这项技术在游戏引擎里很常见,通常一个建筑都会拥有很多层的LOD(细节层次)。使用LOD会极大地增加引擎的表现而且也会减少多重锯齿和其他资源瓶颈问题。
In SimCity, buildings are authored in fourLOD’s, going from the most detailed to the least detailed. The game engineautomatically selects a given LOD based on the model’s distance from thecamera.
模拟城市使用四层细节,从最大细节排列至最小细节。游戏引擎自动根据摄像机位置为每个模型选择细节层。
LOD-0 is the highest resolution version, LOD-1is reduced by 50%, LOD-2 is reduced by another 50%, and finally LOD-3 isreduced another 50%.
LOD_0是最高细节度的模型,LOD_1减少50%多边形,LOD_2再减少50%,LOD_3再减少50%
Here’s a High Wealth, Low Density House and its chain of LOD’s.
这是一张高收入低密度住宅的LOD链:
"Modern House" LOD-0
Highest polygon version of the model. In thiscase it is under budget so there is less difference between LOD-0 and LOD-1
最高细节度的多边形模型。这个例子里面因为它并没有超过预算所以LOD_0和LOD_1的差别很小。
"Modern House" LOD-1
Decorative details have been removed such as thebalcony railings and the trim at the edges of the metal roves.
少量的细节被抹去了,比如阳台的栏杆和屋顶边缘的折角。
"Modern House" LOD-2
Geometry has been significantly simplified whilemaintaining the overall mass of the building. Curved shapes use less divisionsand narrow elements such as the roof edges and decorative cross beams have beenremoved.
大量的多边型被简化了但是建筑的总体体积却没有变化。曲面被更少的分段代替了而更细的东西比如屋顶边缘和装饰性的横梁都被移除了。
"Modern House" LOD-3
This LOD appears when the camera is at asignificant distance from the model and the building will be fairly small onscreen. Polygons have been removed everywhere possible leaving only the formsthat would show a visible “Pop” if they disappeared when the model transitionedfrom LOD-2 to LOD-3.
这层LOD会使用在非常非常远的建筑上面,这种时候建筑已经非常的小了。所有可能的地方都被移除掉了多边形从而只剩下了一个纸板壳子来不让模型在从LOD_2到LOD_3的转变中突然消失。
--------------------------------------------------------------------------------
Building Scale:
Technically speaking a Maya unit translates toone meter in our game engine. However, the assets in our game are not true toscale. Small elements are usually exaggerated and very large objects are scaleddown. Consider the image on the right comparing a house, a three story buildingand the Empire State Building (which is over 1200 feet tall). If the gamerepresented a modern skyscraper to scale small buildings, cars, and pedestrianswould be all but invisible by comparison.
从技术上来说每个maya单位在游戏引擎里代表着1米。但是我们游戏里的模型却并不服从真实的比例。小的物体通常被放大了而大的物体通常被缩小了。想象一下右边这张平房和三层小屋和帝国大厦(大概1200英尺高)的对比图。如果游戏将摩天大楼与小楼房和汽车与人等等的比例做到真实的话那么我们基本上就看不见后面三者了。
The best approach to creating a building inSimCity is to find something that “Looks” like the right size in the game andwork from there.
那么当你建造一个模拟城市的建筑时,最好的方法是将这个模型缩放到游戏里看起来顺眼的大小然后再继续你的工作。
--------------------------------------------------------------------------------
A bit more about polygon budgets:
更多关于多边形预算的东西
As I mentioned before polygon budgets are basedon the area a building occupies. This is actually measured by the lot size ofthe building not the model itself. Square area is what is taken intoconsideration not volume. So a taller building is not allowed more polygonssimply for being tall. Fortunately most tall buildings sit on larger lots andtherefore have reasonable budgets compared to smaller buildings.
我之前提到了多边形预算是基于楼房占去的面积来决定的。而我并没有开玩笑。平面面积而不是体积决定了建筑的多边形数量。所以一个高的建筑并不允许因为高了点就能使用更多的多边形。幸运的是大多是高的建筑都有一个大的地基,所以它们比小型建筑有着更多的多边形预算。
The budget is: 0.5 triangles per square meter (for LOD0)
预算是:每平方米0.5个三角(LOD_0)
As an example all Shotgun Shacks sit on 16m x32m lots:
用一个16mX32m的平民小屋做例子:
16m x 32m = 512m2
512m2 x 0.5 triangles / m2 = 256 triangles (256个三角面)
LOD-0 = 256 x 100% = 256 triangles
LOD-1 = 256 x 50% = 128 triangles (128个三角面)
LOD-2 = 256 x 25% = 64 triangles(64个三角面)
LOD-3 = 256 x 12.5% = 32 triangles(32个三角面)
For LOD-3, the “Shotgun Shack” would need to bereduced to 32 triangles or less. 32 triangles isn’t much, but when a playersees LOD-3 of a building, it’s pretty far away.
对于LOD_3,平民小屋必须被降至32个三角面甚至更少。32个三角面并不多,但是当LOD_3被加载时这个楼房已经很远很远了
Our buildings fall into two categories:
我们的建筑被分为两个大类:
"RCI Buildings": The residential,commercial, and industrial buildings that appear automatically in zoned areas
RCI建筑:自动在相应规划区长出来的住宅,商业,和工业建筑
"Placed Buildings": The player placedbuildings such as fire stations, power plants, tourist attractions, etc.
放置建筑:玩家放置的建筑比如消防站,发电站或者是旅游观光点等等。
When creating Player Placed buildings we areoften more generous on the polygon budgets for two reasons. Firstly, we wantthese buildings to look a little more interesting as they are special assets.Secondly, they typically show up in limited amounts; you cannot fill theplayable area with City Halls for example.
当我们创造放置建筑时我们通常在多边形预算上比较宽松。有两个原因:第一,我们想要这些建筑看起来比较有趣,因为他们比较特殊。第二:他们通常都有数量限制。你不可能将所有游戏区域都盖满市政大厅吧>_>。
When creating custom buildings you could ofcourse ignore the budgets we follow, but keep in mind the performance problems.If high polygon buildings start to fill a city it will not only affect framerate, it could even start to take up too much memory. This can become asignificant problem on lower spec machines.
当创造放置建筑时你基本上可以无视我们的多边形预算,但是请不要忘了潜在的性能问题。如果大量高精度的建筑充斥着整座城市的话那么其影响的将不仅仅是你的fps了,它还会占去大量的内存。这在某些低配机器上会造成严重问题。
--------------------------------------------------------------------------------
I hope this helps give you an idea of how tocreate building geometry that fit within budget. Next time, I will tell youmore about the building shader we use. Here’s a sneak peak at how the buildingshader allows us to add detail, depth, color variations and more.
我希望这能够给你一个大概的指导来帮助你建造一个不超过预算的建筑。下次我将告诉你我们使用的着色器。接下来是我们使用的楼房着色器,它让我们添加各种细节深度和随机颜色。
Unshaded geometry
Same Model in game with shader applied
Head over to our Modding thread here.
Until next time,
Cristian
|
评分
-
查看全部评分
|