地圖修改

模組製作· 约 33 分钟阅读

本頁面講述的內容長期有效。

此頁面正在翻譯中

地圖依靠多張不同的圖像文件(.bmp 位圖格式)來形成各異的地圖效果和屬性。

省份地圖

provinces.bmp 控制省份的位置和形狀,它和 definition.csv 協同工作。所有的省份都擁有一個唯一的紅-綠-藍(RGB)顏色組合。 「Province.bmp」文件定義了省份之間的位置關係。「definitions.csv」文件則定義了省份更多的細節。如果想在海洋中添加新的省份,那麼在編輯這個文件的時候不需要調整地形地圖。此外,每一個省份都必須擁有一個唯一的RGB十進制顏色代碼,否則你會遇上同一個省份同時出現在兩個或者更多的位置。要注意,設置這個文件中的任何像素為完全的黑色(0,0,0)將使遊戲崩潰。

provinces.bmp 文件應該是RGB模式,並且保存為24位位圖圖像文件(.BMP)。 在使用GIMP 2.8進行修改後需要以「不寫入顏色空間信息」模式以及24-bit(24位格式)進行保存。

Europa Universalis IV\map\province.bmp
Europa Universalis IV\map\province.bmp

地形地圖

terrain.bmp 控制地形分配和紋理材質。它和 terrain.txt 協同工作。 「Terrain.bmp」文件定義了每一個省份的地形種類。需要注意的是修改這個文件的內容會可以改變每個地形種類在地圖上表現出來的地圖紋理(質地)。

在map\terrain文件中列出了所有的地形種類(你可以在該文件的色彩表中找到想要的可用顏色)。最常用的地形顏色為平原(86 124 27),丘陵(0 86 6),海岸線(255 247 0),山脈(65 42 17),沼澤/濕地(75 147 174),草原(200 214 107),沙漠(200 214 107)。

terrain.bmp 文件應該是索引模式,並且被保存為8位位圖圖像文件(.BMP)。確保顏色表保持不變,並且排序和基礎版本相同。 因此在使用GIMP 2.8進行編輯後需要以「不寫入顏色空間信息」模式進行保存。

Europa Universalis IV\map\terrain.bmp
Europa Universalis IV\map\terrain.bmp

森林地圖

trees.bmp 控制在地圖上的樹木布局。它和 terrain.txt 協同工作。trees.bmp的解析度影響樹木布局的密度。 「Trees.bmp」是設定地圖上3D森林分布的文件。你可以在map\terrain.txt文件的最後找到樹木種類的描述以及對應的顏色。

trees.bmp 文件應該是索引模式,並且被保存為8位位圖圖像文件(.BMP)。確保顏色表保持不變,並且排序和基礎版本相同。 因此在使用GIMP 2.8進行編輯後需要以「不寫入顏色空間信息」模式進行保存。

Europa Universalis IV\map\trees.bmp
Europa Universalis IV\map\trees.bmp

河流地圖

rivers.bmp 控制在地圖上的河流布局。 河流必須始終是1像素寬。 「Rivers.bmp」文件定義了地圖上的河流系統。每條河流都只是一個像素寬度的線條。一個位於河流端點的綠色(0 255 0)像素小點代表了河流的源頭。紅色(255 0 0)的像素小點則用來劃分河流的支流。每一組河流系統只能擁有唯一一個源頭,所以給支流的端點處添加綠色像素小點是錯誤的。此外,還有一些可用的藍色陰影用來表明河流的大小。

rivers.bmp 文件應該是索引模式,並且被保存為8位位圖圖像文件(.BMP)。確保顏色表保持不變,並且排序和基礎版本相同。 因此在使用GIMP 2.8進行編輯後需要以「不寫入顏色空間信息」模式進行保存。

下列顏色用於 rivers.bmp:

  • 綠: (0, 255, 0) - 一條河流的源頭。
  • 紅: (255, 0, 0) - 流入源。用於加入多個「源頭」路徑進入一條河流。要注意,流入源不需要綠色源頭像素。
  • 黃: (255, 252, 0 ) - 流出源。用於從一條河流向外分支。
  • 藍: (0, 225, 255) - 河流用最窄材質。
  • 藍: (0, 200, 255) - 河流用窄材質。
  • 藍: (0, 100, 255) - 河流用寬材質。
  • 藍: (0, 0, 200) - 河流用最寬材質。
Europa Universalis IV\map\ivers.bmp
Europa Universalis IV\map\ivers.bmp

高度地圖

heightmap.bmp 決定地圖的3D模型。 ( 0, 0, 0 ) 是最低點,(255, 255, 255) 則是最高點。海平面被設置在 (94, 94, 94),所以那以下的任何值都會被淹沒。

使高度之間的過渡平滑,否則會產生明顯的鋸齒狀邊緣。

顏色越淡,高度越高。標準(原版)的EU4地圖並沒有覆蓋整個的範圍;最高值僅僅為低230's(沙粽色)。減少高落差的出現可以讓你的地圖看起來更優秀。

heightmap.bmp 文件應該是灰度模式,並且被保存為8位位圖圖像文件(.BMP)。 因此在使用GIMP 2.8進行編輯後需要以「不寫入顏色空間信息」模式進行保存。

Europa Universalis IV\map\heightmap.bmp
Europa Universalis IV\map\heightmap.bmp

法線地圖

world_normal.bmp 決定地圖的3D隆起。這需要正確地將陰影添加到高度圖中。 「World_normal_map.bmp」定義了遊戲渲染凸起和陰影的方式。

法線地圖能用 NVIDIA Texture Tools for Adobe Photoshop  從 heightmap.bmp 創建,或者通過使用 濾鏡 > 3D > Generate Normal Map 在Photoshop CC里創建。[1]

Europa Universalis IV\map\world_normal.bmp
Europa Universalis IV\map\world_normal.bmp

顏色地圖

顏色地圖:colormap_autumn.dds,colormap_spring.dds,colormap_summer.dds 和 colormap_winter.dds 被應用於地形材質的頂層,在它們各自的季節。 大多數情況下的圖像編輯軟體都需要安裝插件才能打開和編輯使用「.DDS」格式的顏色地圖文件。dds格式是一種有損格式,所以反覆編輯會損失更多細節。比較好的辦法是把遊戲基礎文件保存為.psd格式,每次迭代改動都在其中進行,而不是修改上一次輸出的dds圖像。

colormap_x.dds 文件應該是RGB模式,並且保存為.DDS格式,使用8.8.8.8 ARGB 32 bpp規格(RGBA8在Gimp 2.8中),No MIP maps選項。

Europa Universalis IV\map\terrain\colormap_autumn.dds
Europa Universalis IV\map\terrain\colormap_autumn.dds

水體地圖

colormap_water.dds 控制應用於水體的色澤。 「colormap_water.dds」文件是遊戲中分布的水的顏色地圖。陸地的顏色是(20 200 200),同時水的顏色範圍為(8 31 66)至(5 20 36),顏色的深淺即為水域的深淺。

colormap_water.dds 文件應該是RGB模式,並且保存為.DDS格式,使用8.8.8.8 ARGB 32 bpp規格(RGBA8在Gimp 2.8中),No MIP maps選項。

Europa Universalis IV\map\terrain\colormap_water.dds
Europa Universalis IV\map\terrain\colormap_water.dds

default.map

default.map 是一個重要的文本文件,定義了地圖的遊戲功能的多個方面。

基本版本看起來像這樣:

width = 5632
height = 2048
max_provinces = 4348

sea_starts = { }
only_used_for_random = { }
lakes = { }
force_coastal = { }

definitions = "definition.csv"
provinces = "provinces.bmp"
positions = "positions.txt"
terrain = "terrain.bmp"
rivers = "rivers.bmp"
terrain_definition = "terrain.txt"
heightmap = "heightmap.bmp"
tree_definition = "trees.bmp"
continent = "continent.txt"
adjacencies = "adjacencies.csv"
climate = "climate.txt"
region = "region.txt"
superregion = "superregion.txt"
area = "area.txt"
provincegroup = "provincegroup.txt"
ambient_object = "ambient_object.txt"
seasons = "seasons.txt"
trade_winds = "trade_winds.txt"

tree = { 3 4 7 10 }

寬度和高度控制著地圖的解析度,遊戲讀取這些值,然後與圖像文件匹配。 以下文件規定了地圖的解析度:

  • heightmap.bmp
  • provinces.bmp
  • rivers.bmp
  • terrain.bmp

以下文件也定義了解析度的一部分:

  • world_normal.bmp
  • colormap_autumn.dds
  • colormap_spring.dds
  • colormap_summer.dds
  • colormap_winter.dds
  • colormap_water.dds

可以更改地圖解析度,但是高度和寬度必須是128的倍數。

max_provinces 省份最大值是遊戲系統允許的省份最大值。這個數字應該等於實際的最大值+ 1,超過這個值是可以的(只不過您會收到大量的error.log錯誤),但是如果max_provinces(省份最大值)低於實際最大值,則會導致遊戲在加載期間崩潰。

sea_starts = { } 控制海洋區的劃分。您如果想定義一個海洋區,必須在{ }里添加該地塊省份的id。

only_used_for_random = { }控制在開啟Random New World(隨機新大陸)功能中的隨機省份的劃分。想要開啟Random New World(隨機新大陸)功能,您需要在這裡定義將近1000個未使用的省份id。但是如果你不使用Random New World(隨機新大陸)功能,你可以忽略這一點,這對普通遊戲不會造成任何影響。

lakes = { } 控制湖泊區的劃分。這些基本上是阻礙了距離計算(即取心距離)的無效海區,您必須在{ }里規定一個省份的id,將該省份定義為一個湖。

force_coastal = { } 沿海地區可視為無用定義。根據推測,這個定義可以將{ }中的省份規定為沿海省份。

tree = { } 樹木定義用於在自動地形劃分時,將tree.bmp中的某些索引顏色關聯為樹木。

其他定義只是指對應地圖「特徵」所對應的的相關文件,比如definitions =「definition.csv」。

這個定義控制遊戲地圖上運河貼圖的位置。坐標是運河貼圖的左上角像素,名稱用於搜索運河。

canal_definition = {
name = "panama_canal"
x = 1490
y = 948
}

例如:name = "panama_canal"連結到了名稱後面附加了_river.bmp的panama_canal_river.bmp,貼圖連結到環境對象中的ambient_object.txt。

鄰接關係

鄰接關係的文件在 Europa Universalis IV/map/adjacencies.csv裡面。作為逗號分隔的文件,你可以使用Excel或其他類似程序或文本編輯器打開它。默認編碼為ANSI。

該文件控制哪些省份可以連接到其它不相鄰的省份。例如,一個島嶼通常不與任何其他陸地省份相鄰,因為中間隔著海洋省份。鄰接文件告訴遊戲將這個島嶼同某個陸地省份連接起來,允許陸地單位在兩者之間行走。

格式如下:

From;To;Type;Through;start_x;start_y;stop_x;stop_y;Comment
<province id>;<province id>;<type>;<province id>;<map coordinate>;<map coordinate>;<map coordinate>;<map coordinate>;<comment>

鄰接關係有三種類型:

  • 海洋:sea
  • 湖泊:lake
  • 運河:canal

每種類型都會有用於顯示鄰接關係的圖形。你可以將類型留空以不顯示圖形。

若有任何敵方單位位於Through所定義的省份,且From省份和To省份不都由友方控制,則你的單位無法在該鄰接關係上通行。這通常用於在海峽兩端的鄰接中允許海軍封鎖。

地圖坐標用於調整顯示相鄰關係的圖形的起點和終點。作為參考,坐標X0 Y0位於地圖的左下角。如果不需要調整,則使用-1代替實際坐標。

假設您想將Skåne省(id:6)和Sjaelland省(id:12)連接在一起,而海洋省份Öresund(編號:1258)介於兩者之間。要執行此操作,可以按如下方式定義鄰接:

6;12;sea;1258;3008;1633;3000;1630;Skåne-Sjaelland

地區

每個省份都必須屬於一個地區(Area)。如果你在遊戲中選中一個不屬於任何地區的省份,遊戲將會崩潰。

一個地區可以包含任意數量的省份,但是Paradox傾向於在每個地區中包含3到5個省份。包含省份的數量對地區的發展水平有著很大影響。對於海域地區來說,這個因素比較寬鬆,因為省份過多或過少對遊戲性的影響較小。

地區的格式如下:

area_name = {
<province ids>
}

地區的顏色(在地區地圖模式中可見)是隨機的,不過你也可以手動定義地區的顏色:

area_name = {
color = { <r>, <g>,  }
<province ids>
}

顏色定義使用默認的RGB值,範圍從0到255(不是十進制RGB)。

區域

所有地區(Area)必須與一個區域(Region)相關聯。每個區域可以占用任意數量的地區。

重要的是,海域(即包含海域的區域)通過艦隊的探測任務規定了遊戲中的可探測區域。

區域的格式如下:

region_name = {
areas = {
<areas>
}
}

為了使隨機新世界正常運行,您需要在region.txt的頂部包括以下內容, 因為遊戲會用隨機生成的地區填充它。

random_new_world_region = { }

次大陸

次大陸(Superregion)被用於定義「大陸」尺寸的區域(Region)。每個區域只能屬於一個次大陸,且海洋區域不能被分配到任何次大陸。

次大陸的格式如下:

superregion_name = {
<regions>
}

為了使隨機新世界正常運行,您需要在 superregion.txt的頂部包括以下內容,因為遊戲會用隨機生成的區域填充它。

new_world_superregion = { }

大陸

找到 continent.txt,大陸(Continent)被用來將大範圍的省份聚集到一起 ,正如我們日常所說的大陸一樣。大陸擁有特殊的、次大陸所沒有的遊戲效果。

所有省份必須屬於一個大陸,否則你可能會經歷遊戲崩潰。

為了使隨機新世界正常運行,您需要在continent.txt的頂部包括以下內容,因為遊戲會用隨機生成的省份填充它。

new_world = { }

省份組

Found in provincegroup.txt, province groups are similar to areas, although they have no inherent function. Rather, they allow the grouping of provinces, and then the province group name can be used as a scope in effects and triggers.

環境物體

ambient_object.txt 是用於定義地圖上的3D環境物體的文件。其中包括影射框架,所以如果你想刪除它們,請不要簡單的清空這個文件。

環境物體的格式如下:

# Used once for each graphical asset
type = {
type = <string>         # Refers to the graphical asset in ambient_object.gfx
use_animation= <yes/no> # Used set set if an object is animated or not
scale = <float>         # Sets the scale of the asset. 1.0 is default size.
time_duration=300.000   # Always set to 300 for animated objects, may be redundant

always_visible = <yes>              # Used to force visibility
visible_in_all_map_modes = <yes>    # Used to show is non-terrain mapmodes

 # Each instances is a separate object
object = {
name = <string>                 # Name does not have to be unique
hidden_on_start = <yes/no>      # Whether the object is hidden (can be revealed with show_ambient_object)
position = {
<x>     # Horizontal coordinate
<z>     # Height coordinate - 0.0 is base
<y>     # Vertical coordinate
}
rotation = {
<x>     # Horizontal rotation
<z>     # Height rotation - this is used for most rotations
<y>     # Vertical rotation
}
}

}

You can use the Nudge tool to place new instances and move objects, but if you want to add a new type, you must add it to the file first, then use the Nudge tool.

The ambient objects for the canals are found here. To link them to the canal definition in default.map, you need to make sure they share the same name (i.e. panama_canal).

位置

文件positions.txt用於定義單位、城市等模型在省份中的位置。你必須為每個省份都定義這些位置,否則你的士兵會消失在虛空中,嚴重影響遊戲體驗。

位置定義的格式如下所示:

<province id> =
    {
position= - 指示省份上可以具有的各种图形元素的位置。
    {
2777.000 1287.000 - x和y坐标,定义城市模型
2783.000 1287.000 - x和y坐标,定义单位模型
2777.000 1287.000 - x和y坐标,定义省份名称
2764.000 1288.000 - x和y坐标,定义省份港口模型(仅当该省份与某个海洋省份接壤时,模型才会出现,但是即使该坐标实际上不与任何海洋省份接触,模型也不会消失)
2777.000 1287.000 - x和y坐标,定义省份贸易节点模型(如果该省份不是00_tradenodes.txt中所定义的贸易节点位置,这种模型不会出现)
2783.000 1285.000 - x和y坐标,定义战斗单位模型
2777.000 1287.000 - x和y坐标,定义贸易风图标(如果该省份没有在tradewinds.txt中定义贸易风,此定义无意义)
}
rotation= - 指示每个元素的旋转。这里的值是弧度(rad)。2π(6.283)为360度-1/2π(1.571)-90度
    {
0.000 - 城市方向
0.000 - 静止单位方向
0.000 - 省份名称方向(对海洋省份完全无效,对陆地省份则仅在省份名称坐标位于海洋省份且方向不为0时有效)
0.785 - 港口方向(0.785即π/4,代表模型顺时针转45度)
0.000 - 贸易节点模型方向
0.000 - 战斗单位模型方向
0.000 - 贸易风图标方向(实际上无效,因为贸易风的方向是在tradewinds.txt中定义的)
}
height= - 指示每个元素的高度。这里的值大约等于heightmap.bmp所用灰度的1步。因此-1.00导致模型比基准面低一步(96),而1.00导致模型比基准面高一步。
    {
0.000 - 城市高度(不幸的是,该值只会影响中心城市的模型,而高发展度产生的其他模型都不会受到影响)
0.000 - 单位高度
1.000 - 省份名称高度(改变省份名称显示的大小。对海洋省份完全无效,对陆地省份则仅在省份名称坐标位于海洋省份且方向不为0时有效)
0.000 - 港口高度
0.000 - 贸易节点模型高度
0.000 - 战斗单位模型高度
0.000 - 贸易风图标高度
}
}

最好使用微調工具來編輯位置。通過在Europa Universalis IV的啟動選項中添加-nudge來激活工具,然後在遊戲中單擊初始菜單中的Nudge按鈕,使用工具,然後保存。你可以通過滑鼠右鍵,快捷地把模型移動到你想要的位置。

改動後的 positions.txt 能在 //Paradox Interactive\Europa Universalis IV\map\positions.txt 找到。複製這個到你mod中的原來的版本上。

然後你需要在 //Paradox Interactive\Europa Universalis IV\map\ 刪除 positions.txt,否則它將覆蓋原版/mod版本。

Nudge工具鍵盤快捷方式:

  • 'next' 綁定到 '1'
  • 'prev' 綁定到 '2'
  • Rotation +0.5° 綁定到 'q'
  • Rotation -0.5° 綁定到 'e'
  • Rotation +45° 綁定到 'r'
  • Rotation -45° 綁定到 'f'
  • Move +0.5 units on the z-axis 綁定到 'w'
  • Move -0.5 units on the z-axis 綁定到 's'
  • Move -0.5 units on the x-axis 綁定到 'a'
  • Move +0.5 units on the x-axis 綁定到 'd'
  • 'Mapmode' 綁定到 't'

地形

terrain.txt 有許多功能。它定義了地形的類別是什麼(如:草原,森林等)並用可以在terrain.bmp 找到的indexed colors聯繫這些類別。 It does the latter for the trees.bmp as well.

There is a category for every terrain type in game, as well as various special-case categories, such as pti and ocean. You can add and remove categories as you wish, although you must make sure all references else where to removed terrains are cleaned up, otherwise you may run into crashes.

The format for a category is as follows:

name = {
color = { <rgb> }           # 定义用来展示地形在“简易地形”地图模式下的 RGB 颜色(可选)

sound_type = <type>         # 定义用于地形的环境声音。可以在sound/all_sounds.asset找到。

is_water = <yes>            # 定义这个地形是否可用于海域。
inland_sea = <yes>          # 定义这个地形是否可用于内海。

type = <type>               # Defines the gameplay type (i.e. plains, which is used for the Nomad shock bonus)
 # Types: pti, plains, forest, hills, mountains, jungle, marsh, desert

 # Used to explicitly make provinces this terrain category. Overrides automatic algorithm.
terrain_override = {
<province ids>
}

 # 地形特有的修正。
movement_cost = <float>                     # Multiplier to movement time into/out of province with terrain
defence = <int>                             # Addition to defence roll in combat in this terrain
nation_designer_cost_multiplier = <float>   # Extra cost multiplier when picked in the Nation Designer

 # 省份修正在这里也可用。
<province modifiers>
}

Each indexed color in the terrain.bmp can be associated with a terrain category. This is used in the automatic terrain algorithm, saving you from having to use terrain_override.

The format is as follows:

terrain = {
<name>  = {
type = <terrain category>
color = {
<index>
}
}
}

For trees, rather than terrain categories, it is the terrain names defined in terrain = { }. Making the format:

tree = {
<name>  = {
terrain = <terrain>
color = {
<indexes>
}
}
}

地形採樣

The terrain textures used for specific terrains are found in atlas0.dds and atlas_normal0.dds.

The association between the texture and terrain is inferred from the order of the indexed colors within terrain.bmp. For example, Grasslands associates itself with color index 0, meaning it will use the first tile in the texture atlas. Hills will use the second tile, etc.

The atlas0.dds and atlas_normal0.dds must be saved in DXT5 with Mipmaps enabled.

It is possible to increase the size of the texture atlas. In pdxmap.shader in Europa Universalis IV/gfx/FX/, edit the NUM_TILES variable to match your new number of rows.

It is possible to increase the size of the texture tiles within the texture atlas. In pdxmap.shader in Europa Universalis IV/gfx/FX/, edit the TEXELS_PER_TILE variable to your new size.

氣候

climate.txt 被用來定義省份屬於哪種特殊氣候類型:

  • tropical
  • arid
  • arctic

These climates apply a modifier 00_static_modifiers.txt to the province, and are handled differently by the AI.

climate.txt 在這裡被用來決定省份會經歷哪種類型的冬季。這裡有三種類型的冬季:

  • mild_winter
  • normal_winter
  • severe_winter

如果省份沒有被定義在這裡,它們將不會經歷冬季。

The climate.txt 還被用來定義哪些省份是不可通行的(即荒涼之地)。

信風

The trade_winds.txt file is used to set the prevailing winds over certain provinces. This reduces or increases the speed of ships, affecting the speed of exploration.

The format is as follows:

<province id> = <rotation>

The rotation is represented by an integer, with 0 pointing right, +10 moving counter-clockwise, -10 moving clockwise.

季節

seasons.txt 被用來定義省份在遊戲中經歷四季交替時的顏色變化。這裡有四種季節:冬季,春季,夏季和秋季。

格式如下:

<season> = {
start_date = <date>      # 00.<month>.<day>, in numeric form, i.e. 00.12.01
end_date = <date>

 # Applies to the northern hemisphere
hsv_north = { <hsv> }    
colorbalance_north = { <hsv> }

 # Applies to the equator
hsv_center = { <hsv> }    
colorbalance_center = { <hsv> }

 # Applies to the southern hemisphere
hsv_south = { <hsv> }    
colorbalance_south = { <hsv> }
}

顏色類型使用HSV顏色(即色相(Hue)、飽和度(Saturation)、亮度(Value))。

seasons.txt 還控制樹木模型在一年中的外觀。

高原湖泊

高度圖的特性使得遊戲中的水平面在任何地方都設定為同一數值。但是,在高海拔地區確實存在著高原湖泊。為了生成水平面以上的湖泊,你需要使用lakes/00_lakes.txt文件。

該文件使得你能以三角形帶(triangle strip )的形式生成湖面的材質。

簡單來說,這個方法是這樣的:三角形帶標出了高原湖的大致區域,然後高度值標出了該區域內的新水平面。注意,你不是直接用三角形帶來畫湖!湖泊的邊緣由高度圖來決定。

格式如下:

lake = {
triangle_strip = { 
       <x> <y>     # 三角形带的顶点,依需要可以有多个
}
height = <int>  # 材质的高度(水平面为0)
}

參考資料

  1. 安裝了Nvidia插件的Photoshop CS,則是:濾鏡 > NVIDIA Tools > NormalMapFilter...