地图修改

本页面讲述的内容长期有效
(重定向自Map modding

地图依靠多张不同的图像文件(.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

地形地图

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

森林地图

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

河流地图

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\rivers.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

法线地图

world_normal.bmp 决定地图的3D隆起。这需要正确地将阴影添加到高度图中。 “World_normal_map.bmp”定义了游戏渲染凸起和阴影的方式。

法线地图能用 NVIDIA Texture Tools for Adobe Photoshopheightmap.bmp 创建,或者通过使用 滤镜 > 3D > Generate Normal Map 在Photoshop CC里创建。[1]

Europa Universalis IV\map\world_normal.bmp

颜色地图

颜色地图:colormap_autumn.ddscolormap_spring.ddscolormap_summer.ddscolormap_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

水体地图

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

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.bmppanama_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>

邻接关系<type>有三种类型:

  • 海洋: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>, <b> }
    <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...