全站通知:

资产编辑工具

阅读

    

2023-11-30更新

    

最新编辑:Lu_23333

阅读:

  

更新日期:2023-11-30

  

最新编辑:Lu_23333

来自城市:天际线WIKI_BWIKI_哔哩哔哩
(重定向自资产编辑工具
跳到导航 跳到搜索
页面贡献者 :
Lu_23333
xl123071
魔十四
daiyuntao
黄奶村小鱼
施工中:欢迎协助编辑本页,请参考帮助:编辑帮助帮助:编辑规范。请从以下方面协助编辑:
  • 需要翻译此页面

资产编辑器是一个可以用来装饰现有资产、创建新资产或创建道路组件如立交桥等并导入游戏的强大工具。

资产编辑器通过主菜单的“工具”子菜单启动。

文件:Cities Skyline Asset Editor.png
Asset Editor (click to enlarge)

基本用法

文件:Asset Importer.png
Asset Types (click to enlarge)

创建资产是基于 资产类型的,在开始创建你自己的资产时,你可以从多种多样的预定义模板中选择一种,这些模板提供了资产各自的特别功能和属性。比如说,当你选择车辆-公交车时,你可以导入你自己的3D公交车模型,而这个3D模型会自动地匹配同公交车一样的动作(比如车轮旋转,转向灯闪烁等等)!有时你需要遵守一些特殊的规则比如调整模型的朝向来达成正确的动作。

当你单击新建资产,会出现一个选择主题的窗口。主题是一组具有相似风格资产的集合,如原版的欧风、温带、热带等等。这些主题通常有一种纯净的美。你可以从中选择一种原版自带的基础主题或者任何你自己创建或者从工坊订阅的自定义主题。主题不会影响你的资产本身,但是基础主题的选择会稍微影响资产的不同模板的可用性。对主题的选择同样会影响资产在不同主题中的外观。尤其是雪地主题,这个主题可以用来预览资产中雪纹理的外观是怎样的。

在主题加载之后,会弹出一个选择资产模板的窗口。

文件:7 asset importer.jpg
Asset Importer (click to enlarge)

一旦选定了资产模板,就可以单击选择模板来开始创建资产。你可以选择原版资产或者之前创建的资产。勾选读取已有装饰会连同装饰和资产本身一同加载。选择正确的资产模板是很重要的,因为很多属性都从基础的模板继承且不能更改。包括AI(也就是定义资产的游戏功能)和用户界面中的位置等等。

对于某些资产类型,下一个窗口允许你选择一个自定义的模型(.fbx格式)或模板的默认模型,在这个界面,你同样可以调整模型的大小、朝向,或将模型坐标置于底部中心。当然,在建模软件中提前设置好尺寸大小和朝向会更加容易。由于不同软件导出.fbx文件的方式不同,通常需要把比例设置为100。当然也可以提前在建模软件中设置。选中模型后在预览窗口鼠标左键拖动可以从不同角度预览模型。你可以点击右上角的“最大化”按钮来在更大的窗口中预览模型,这种模式下,还有一个“状态”滑条,可以模拟模型失火后的外观。

文件:8 asset properties.jpg
Asset Properties (click to enlarge)

更多细节

下一步是装饰工具,你可以在这里给资产添加物件装饰。一些物件是随机的,摆放时会随机选择不同的物件,从而让资产看起来更加多样化。由于这个原因,资产最终外观看起来可能不像在编辑器里的外观。

底部是预览工具的工具栏,你可以在这调整时间(即光照效果),在冬季主题中还可以选择是否下雪,需要注意的是这只是预览,即使关闭下雪,在游戏中你的资产仍然会有雪的外观。

你可以在右下角的面板里调整资产的各项属性和数值。

文件:Subbuilding button.png
Sub building button (click to enlarge)

建筑物还可以用附属建筑物进行补充,附属建筑物将与主要资产一起放置。单击屏幕右下角的“添加子建筑”按钮可以放置新的子建筑。子建筑与主建筑一起复制和保存,因此对原始模板的更改需要重新导入和保存。某些建筑类型可能无法完全用作子建筑。

Additional information on some of the properties:

  • Buildings/Circular: instead of the usual rectangular area the asset will occupy a circular area. Since the circular area is not currently shown in the asset editor, this may cause overlapping in the game if the building model is too large, and may thus require some experimentation.
  • Buildings/Expand front yard: automatically spawned buildings have a variable length (e.g. 1x1 can also be spawned as 1x2, 1x3, or 1x4). This variable specifies whether the extra space is added on the front or back yard of the building.
  • Props/Create ruining and Trees/Create ruining: if selected, a small worn out patch is created under the asset
  • Props/Variations and Trees/Variations: some asset templates support variations. When placing a prop or tree with variations in game, the final model will be randomly selected from the variations.
文件:9 asset save.jpg
Asset Save (click to enlarge)

The asset can be saved from the menu reached from the icon on the top right corner or pressing ESC. It will become available for use in the game, and can be found in the same category as the template that was used in its creation.

Custom animation is not supported by the base game, but can be added with other mods.

文件:10 in game asset.jpg
Custom asset in game (click to enlarge)

Thumbnail

In all editor tools, when a small folder icon is seen, you can click it to open the folder containing the currently displayed assets.

For example, when saving an asset, this functionality can be used to change the thumbnail and tooltip image of the asset seen in the in-game UI. This is done by replacing the files in this folder with new ones (of the same name, type and size). The changes will be instantly reflected in the save asset panel. Replacing the main thumbnail image also automatically regenerates the other states of the button, which can then be replaced with custom ones if so wished. Please notice that this temporary folder will be deleted when the save panel is closed, so the original files should be stored elsewhere.

Specifications for imported assets

Modeling

This section is highly dependent to what modeling software you are using but below should apply to most of them.

The System Units of the modeling software should be set to metric with 1 unit = 1 meter.

Keep in mind that buildings in the editor are on a grid system called cells. Each cell is 8m x 8m. (See the section 'Buildings > General' for the max building cell sizes)

It is important for the model to be one single object with no hierarchy. So make sure to collapse the hierarchy in 3DS Max for example. It is also important for the model to use a single material, otherwise it will be split in sub-meshes and will fail to display parts of it.

If your model imports sideways, you need to experiment with the pivot so that your modeling software matches Unity's coordinate system (left handed coordinate system, +X is right, +Y is up and +Z is forward (into the screen)). Pivot in your model needs to be 0 on Z-axis and in the bottom center of the building. For instance, 3DS Max needs a +90degrees rotation on the X-axis to match Unity's coordinate system. The vertices at the bottom of the building need to be at 0.

Assets size need to fit to a grid where 1 cell is 8x8 meters. When importing an asset, there are constraints on its size depending on what template you use. (i.e. zoning buildings can be at most 4x4 cells while city service buildings can be 16x8). Those limitations are not currently documented in one place but the decoration editor will limit the cells size of a building depending on its type so you should first play around with the template you are planning to use before modeling something which may be too large. Pretty good floor height would be 2.5 to 3 meters.

A good size for a standard door would be roughly 2 meters. In shopping centers or such it could be higher. If the building is very tall, let’s say much more than 10 floors, the artist needs to scale down the floor height. This is done because the building would appear too high in the game and this would lead to two problems. 1. the game’s camera would take a jump upwards and then down again whenever the building is crossed in the game world. 2. It would make it hard to see the street level clearly.

The model size is not limited other than by Unity's limit of about 65000 vertices per mesh, but even approaching that is too much for single assets. To give some rough guidelines, the triangle count of the building models in the stock game ranges from less than 1000 triangles for the smallest and simplest buildings to about 5000 for large and complex buildings. A few exceptional buildings use up to 10-15k triangles. Vehicles typically have [[1]] triangles, while trees vary from a few hundred for simple bushes to about 2000 for the more complex ones. Also note that a large number of props can also make the asset rendering slower, which is why there is a limit in the asset editor.

The game automatically creates both texture-based and 3D snow on all assets in the winter theme, so the same asset can be used for any theme. The generated snow can be disabled locally with vertex colors on the models. Set the color to (255, 255, 0) to disable all snow and to (255, 255, 128) to only disable 3D snow.

Generally the buildings use 1024x1024 texture maps, or 1024x512 if the building is small or simple. If working on a large building, try to see if it can be fitted in 2048x1024 size before making a 2048x2048 sized map. We try to refrain using 2048x2048 maps, and use them only in really important and huge buildings, such as a stadium or an airport.

The material for Buildings supports up to 6 textures in TGA format, each needs to use the same filename as the FBX file with a texture type suffix. All main model textures have to have the same resolution.

  * "_d" suffix stands for the diffuse texture (RGB)       - 3 color channels texture defining the albedo.
  * "_a" suffix stands for the alpha texture (Mask)        - 1 color channel mask specifying per pixel transparency.
  * "_c" suffix stands for the color texture (Mask)        - 1 color channel mask specifying per pixel where the color variations can be applied.
  * "_i" suffix stands for the illumination texture (Mask) - 1 color channel mask specifying per pixel if the diffuse color should be considered emissive.
  * "_n" suffix stands for the normal map texture (RGB)    - 3 color channels tangent space normal map.
  * "_s" suffix stands for the specular texture (Mask)     - 1 color channel mask to specifying per pixel specularity.

The model import user folder is located at:

  • On Windows %localappdata%\Colossal Order\Cities_Skylines\Addons\Import
  • On Mac /Users/<username>/Library/Application Support/Colossal Order/Cities_Skylines/Addons/Import
  • On Linux /home/<username>/.local/share/Colossal Order/Cities_Skylines/Addons/Import

LOD (Level of Detail)

You may notice your custom models sometimes gets very distorted when viewed from far away : that's because the game automatically generates a low poly version (LOD) of your model and your texture in order to save resources. To solve this problem, you need to provide your own low poly version of the model (the fewest polys the better) and name it yourModelName_lod.fbx

For growable assets, the suggested limit on this is 100 triangles. For larger buildings and monuments, you can go slightly higher (200). For props and vehicles, less than 50 triangles should be enough. A typical texture size for the LOD models is 128 x 128. For the sake of other players, please abide by these LOD limitations unless its absolutely necessary to break them. This is how the game regains performance when you are zoomed out. The effect of the LOD model on runtime performance is often more significant than the high detail version. If the LOD model is too complex, the game may consider the asset broken and display an error message.

Your low poly model should have a new UV set that is probably different than your original high-poly model, this is anticipated. The UVs should be kept in the 0...1 interval, since the LOD textures use a texture atlas and values outside that range will result in colors being taken from other random models. The game will automatically bake the textures from your high-poly base model to your new low-poly model upon import. Also, make sure no vertices in both high detail and LOD models are below the 0-level since they can confuse the baking process. Often problems with the baking are related to trying to reuse UV space for parts of the buildings that are not similar enough (remember that the baking also bakes normals using the detailed geometry, even if no normal map is defined).

If for some reason you would like to override the auto-texture generation process (also called baking), you can create a diffuse texture for this low-poly model by importing a texture with "_lod_d" suffix (lowercase "lod" is important). If the diffuse texture is overwritten, the baking process is skipped entirely, so normals, speculars, etc also need to be set manually, or you lose the advantage from the automatic normal map creation. Note: due to a bug in version 1.1.0, using this feature requires additionally importing both lod_s and lod_a for the model to work at all; neutral ones can be used.

Asset types

  • Intersections
  • Parks
  • Buildings (city services ploppable and zone spawnable)
  • Trees
  • Vehicles
  • Citizens

Buildings

General

  • Buildings are on a grid in the editor. In the grid, each tile is called a cell.
  • One cell is 8m x 8m.
  • Max size for automatically spawning buildings: 4x4 cells.
  • Max sizes for manually placed buildings: 16x8, 15x9, 14x11, 13x12, 12x13, 11x14, 9x15 or 8x16 cells.

支持的贴图文件

  • Diffuse
  • Normal map
  • Specular (Grayscale. 100% white areas are rendered as windows)
  • Alpha (Grayscale)
  • ColorMask (Grayscale. White color means that diffuse map is multiplied by variable color)
  • Illumination (Grayscale. Illumination color is taken from the diffuse map)

Illumination Map Details

      0 = No illumination 
      120 = Full illumination
      128-255 ( Windows Random Illumination Values)
      192 (Neutral illumination value)

The likelihood of a window to be lit at a given time and its intensity are randomized for values within 128 and 255, the closer the value is to a boundary the more likely it is to be lit and stronger.

Trees

General

  • Assets imported as trees will automatically sway in the wind.
  • Tree LODs are automatically created (using billboarding), this cannot be overridden.

支持的贴图文件

  • Diffuse
  • Normal map
  • ColorMask (Grayscale)
  • Alpha (Grayscale)

ColorMask details

The color mask in the built in trees is intended to be used to mark the foliage with black and the trunk/branches with white. More exactly, the parts of the tree for which the mask is white are not affected by the brightness and color variations, automatic texture-based snow, and normal recalculation from position (tree leaves are typically created with alpha masked, double-sided planes which cannot provide good normals). Notice that the automatic snow can also be disabled completely for a custom tree using the asset properties panel.

A missing colormask defaults to white. Please notice that this means a colormask is needed for the tree to get any snow cover in the winter theme.

Props

支持的贴图文件

  • Diffuse
  • Normal map
  • Specular (Grayscale)
  • Alpha (Grayscale)
  • ColorMask (Grayscale. White color means that diffuse map is multiplied by variable color)
  • Illumination (Grayscale. Illumination color is taken from the diffuse map)

Vehicles

General

  • The connected parts of a vehicle mesh that touch ground (y close to 0) are automatically recognized as wheels and will rotate when the vehicle moves. You should therefore not connect the wheels to the body of the car, or the whole car will rotate.
  • As with buildings, vehicle LOD models are created automatically if not overridden with a "[modelname]_lod.fbx".
  • Vehicle trailers can be customized from the properties panel. Note that if a custom trailer is created, it will become available for selection only after restarting the game or visiting the main menu. The selected trailer asset is saved in the same file with the main vehicle asset.
  • Sound, light and emergency effects are automatically inherited from the template and cannot be customized as of yet.

支持的贴图文件

  • Diffuse
  • Normal map
  • Specular (Grayscale. 100% white areas are rendered as windows)
  • Alpha (Grayscale)
  • ColorMask (Grayscale. White means that diffuse map is multiplied by a variable color. If the template has an emergency light effect, the color mask needs to be 0 in the areas that should light up and the color variations can only be used to modulate the color of the emergency (police, fire, ambulance) lights)
  • Illumination (Grayscale. This has a unique usage for vehicles: 0.5 is the neutral color. 0 is used for turning signals and 1 is used for braking signals and headlights.)

Citizens

General

  • Custom citizens use skeletal meshes with existing animations. Custom animations are not currently supported. LODs are not animated but use normal meshes.
  • Template skeletons that can be skinned with custom meshes are located in game folder under Cities_Skylines/Files/Templates/
  • Using the right skeleton for template citizen yields the best result (for example BluecollarFemale_skeleton for Bluecollar Female, -2, -Snow, and -Snow 2)
  • Some citizens are currently only available in certain themes, and custom citizens using template that is unavailable in a used theme are not loaded.
  • Custom citizens spawn randomly using the same logic as built-in citizens.
  • Custom animals are still in experimental phase, but can be used via scripting.

支持的贴图文件

  • Diffuse
  • Normal map
  • Specular (Grayscale)
  • Alpha (Grayscale)
  • ColorMask (Grayscale)
  • Illumination (Grayscale)

Roads

详见 道路编辑器

说明

请帮助检查更新本页。最后检查:版本1.7

本页内容最初译自官方Wiki:Asset Editor,经双方编辑后内容可能与来源不同。