New structure in handling of map_data.sii

Let's fix or connect things
Post Reply
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

New structure in handling of map_data.sii

Post by BenganJ » November 5th, 2019, 4:21 pm


======= Information on how we ought to use the ========
=================== MAP_DATA.SII ===================
================ file in our mods here ================


The map_data.sii file contains a lot of settings controlling how the
World Map view and Job Market views will look and be handled. This is
how it looks default in the game.

SCS's map_data.sii:

Code: Select all

SiiNunit
{
map_data ; .map.data {

	road_color:			0xFF707070 	//Advisor map undiscovered route
	road_discovered_color:		0xFF4cc6ff	//Advisor map discovered route
	job_road_color:			0x50353535	//Job market map undiscoveder route
	job_road_discovered_color:	0xFF2b3436	//Job market map discovered route
	world_road_color:		0xFF707070	//Main map undiscovered route
	world_road_discovered_color:	0xFF4cc6ff 	//Main map discovered route

	prefab_color:				0xFF737373	//Undiscovered prefab driveable areas
	prefab_obstacle_color:			0xFF333333	//Undiscovered prefab buildings
	prefab_grass_color:			0xFF737373	//Undiscovered prefab grass areas
	prefab_discovered_color:		0xFF98CAEB	//Discovered prefab driveable areas
	prefab_obstacle_discovered_color:	0xFF3ba2e0	//Discovered prefab buildings
	prefab_grass_discovered_color:		0xFF95CAA9	//Discovered prefab grass

	outline_color:			0xFF000000	//Route outline
	navigation_color:		0xFF0C0CCF	//Navigation path color
	navigation_highlight_color:	0xFF0C42DF	//Navigation path color, highligted segment
	navigation_fade_color:		0xFF07077C	//Navigation path color, faded segment
	navigation_arrow_color: 	0xFF06FB11	//Navigation crossroad arrows color


	zoom_uplift[0]: 50.0		// close zoom for 3d map
	zoom_uplift[1]: 220.0		// far zoom for 3d map
	zoom_uplift[2]: 900.0		// close zoom for minimap
	zoom_uplift[3]: 4000.0		// far zoom for minimap
	zoom_uplift[4]: 1000.0		// city detail zoom for world map
	zoom_uplift[5]: 5000.0		// closest zoom for world map
	zoom_uplift[6]: 18500.0		// middle zoom for world map
	zoom_uplift[7]: 45000.0    	// whole world map zoom

	player_size[0]: 15.0
	player_size[1]: 35.0
	player_size[2]: 120.0
	player_size[3]: 500.0
	player_size[4]: 90.0
	player_size[5]: 350.0
	player_size[6]: 900.0
	player_size[7]: 2200.0

	road_size_factor[0]: 1.0
	road_size_factor[1]: 1.0
	road_size_factor[2]: 1.5
	road_size_factor[3]: 3.0
	road_size_factor[4]: 1.0
	road_size_factor[5]: 1.5
	road_size_factor[6]: 4.5
	road_size_factor[7]: 8.0
	
	full_detail[0]: true
	full_detail[1]: true
	full_detail[2]: true
	full_detail[3]: true
	full_detail[4]: true
	full_detail[5]: true
	full_detail[6]: false
	full_detail[7]: false

	icon_size[0]: (13.0, 13.0)
	icon_size[1]: (10.0, 10.0)
	icon_size[2]: (7.0, 7.0)
	icon_size[3]: (7.0, 7.0)
	icon_size[4]: (17.0, 17.0)
	icon_size[5]: (13.0, 13.0)
	icon_size[6]: (11.0, 11.0)
	icon_size[7]: (13.0, 13.0)

	company_icon_size[0]: (32.0, 8.0)
	company_icon_size[1]: (20.0, 5.0)
	company_icon_size[2]: (0.0, 0.0)
	company_icon_size[3]: (0.0, 0.0)
	company_icon_size[4]: (60.0, 15.0)
	company_icon_size[5]: (40.0, 10.0)
	company_icon_size[6]: (16.0, 4.0)
	company_icon_size[7]: (16.0, 4.0)

	camera_limits_min[0]: (-1000000.0, -1000000.0)	# left, up
	camera_limits_min[1]: (-1000000.0, -1000000.0)
	camera_limits_min[2]: (-1000000.0, -1000000.0)
	camera_limits_min[3]: (-1000000.0, -1000000.0)
	camera_limits_min[4]: (-57000.0, -63000.0)
	camera_limits_min[5]: (-55000.0, -62000.0)
	camera_limits_min[6]: (-46000.0, -56000.0)
	camera_limits_min[7]: (-30000.0, -45000.0)
	
	camera_limits_max[0]: (1000000.0, 1000000.0) # right, down
	camera_limits_max[1]: (1000000.0, 1000000.0)
	camera_limits_max[2]: (1000000.0, 1000000.0)
	camera_limits_max[3]: (1000000.0, 1000000.0)
	camera_limits_max[4]: (64000.0, 77000.0)
	camera_limits_max[5]: (62000.0, 76000.0)
	camera_limits_max[6]: (54000.0, 70000.0)
	camera_limits_max[7]: (38000.0, 60000.0)

	map_items_flags[0]: 0x81FFF
	map_items_flags[1]: 0x81FFF
	map_items_flags[2]: 0x81F7F	// no parkings
	map_items_flags[3]: 0x81F7F	// no parkings
	map_items_flags[4]: 0x81FAF	// target, cities, roads, gas stations, dealers, recruitments, garages, companies, parkings, services, trailer
	map_items_flags[5]: 0x81F27	// target, cities, roads, gas stations, dealers, recruitments, garages, companies, trailer
	map_items_flags[6]: 0x81407	// target, cities, roads, gas stations, trailer
	map_items_flags[7]: 0x81402	// target, cities, trailer

	map_3d_camera_pitch: 40.0      // camera pitch in 3d map

	ui_map_center:	(-13500.0, -4950.0)	// in editor coordinates
	ui_map_size:	(5308.2, 5200.0)	// map texture in real km

	ui_map_camera_min: (-30000.0, -45000.0)
	ui_map_camera_max: (38000.0, 60000.0)

	ui_map_always_draw_city: true

	# navigation params
	navigation_city_penalty: 3.0
	navigation_slow_road_penalty: 5.0
}

}
From now on I will use a totally new way of using this data in my mods, making
it more flexible and less prune to interference between other mods. This is how
that information will be structured in my mods.

My map_data.sii structure:

Code: Select all

map_data/ ;folder with the following content.
 --> _OF/ ;folder containing map_data.sii file in the old format, with all data. For comparison to other map_data.sii files.
 ------> map_data.sii.orig
 --> map_color_config.sui"
 --> zoom_uplift_config.sui"
 --> player_size_config.sui"
 --> road_size_factor_config.sui"
 --> full_detail_config.sui"
 --> icon_size_config.sui"
 --> company_icon_size_config.sui"
 --> camera_limits_config.sui"
 --> map_items_flags_config.sui"
 --> map_3d_camera_pitch_config.sui"
 --> ui_map_register_config.sui"
 --> ui_map_camera_config.sui"
 --> ui_map_always_draw_city_config.sui"
 --> navigation_params_config.sui"
map_data.sii ;the original file, but modified as specified below.
NOTE: That structure is located in /def folder as usual!

The modified map_data.sii file will be a file with constant content, a standard file like this:

Code: Select all

SiiNunit
{
map_data ; .map.data {

@include "/def/map_data/map_color_config.sui"
@include "/def/map_data/zoom_uplift_config.sui"
@include "/def/map_data/player_size_config.sui"
@include "/def/map_data/road_size_factor_config.sui"
@include "/def/map_data/full_detail_config.sui"
@include "/def/map_data/icon_size_config.sui"
@include "/def/map_data/company_icon_size_config.sui"
@include "/def/map_data/camera_limits_config.sui"
@include "/def/map_data/map_items_flags_config.sui"
@include "/def/map_data/map_3d_camera_pitch_config.sui"
@include "/def/map_data/ui_map_register_config.sui"
@include "/def/map_data/ui_map_camera_config.sui"
@include "/def/map_data/ui_map_always_draw_city_config.sui"
@include "/def/map_data/navigation_params_config.sui"

}

}
With that specified, a person making a mod, to for example change the colors of the roads in World Map view
can just put the file /def/map_data/map_color_config.sui in his mod and change the various colors in it to
suit his taste. Cool huh? Likewise with the other categories of settings, thereby making just the needed
changes and the minimal impact on the data.

Here I will try to maintain a list of mods, including maps, that use this concept.
  • [ETS2] Ultimate Satellite background mod //A satellite background, in Google style, for the World Map view and Job Market views.
  • [ETS2] Ultimate SCS style background mod //A plain background, in SCS style, for the World Map view and Job Market views.
  • [ETS2] Ultimate Thin border line SCS style background mod //A thin border line background, in SCS style, for the World Map view and Job Market views.
  • [ATS] Universal Satellite background mod //A satellite background, in Google style, for the World Map view and Job Market views.
  • [ATS] Universal SCS Thin style background mod //A thin border line background, in SCS style, for the World Map view and Job Market views.
  • [ETS2&ATS] Sinagrit Baba's Navigation mods //He has prepared Color Customization mods, that can be used to adjust the style of the above BGs.

Please, feel free to comment on this new handling of the map_data.sii file!
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
ExtremorPL
Modder
Posts: 205
Joined: April 11th, 2019, 7:16 pm

Re: New structure in handling of map_data.sii

Post by ExtremorPL » November 5th, 2019, 10:11 pm

Looks like some very nice idea mate! :D
Retired modder.
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: New structure in handling of map_data.sii

Post by BenganJ » November 5th, 2019, 10:15 pm

@ExtremorPL

As you are a map maker of an addon, are you going to include
a map_data.sii file in your final product? Just curious, as my
view is that an addon should NOT mess with the data in that
file! Unless the map needs a greater area to pan the in-game
map view, but then this scheme is good because it's not needed
to change any other parameters than the camera limits. On the
other hand, if people are using my BG's they will get panning
areas enough, I think! :lol: :lol: :lol:

Main maps should have that file included though in the case
of people running them without any zoom mod or they could
demand that people use one, but to be sure .....! :D
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
ExtremorPL
Modder
Posts: 205
Joined: April 11th, 2019, 7:16 pm

Re: New structure in handling of map_data.sii

Post by ExtremorPL » November 6th, 2019, 6:47 pm

Idk mate, Road to Asia is still far from release.
Retired modder.
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: New structure in handling of map_data.sii

Post by BenganJ » November 6th, 2019, 6:50 pm

@ExtremorPL

Nooooooooooooooooooooo, you're kidding, aren't you guys mapping 24/7???? Just kidding! :lol: :lol: :lol:
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
Sbaba
Posts: 1
Joined: November 2nd, 2019, 2:05 am

Re: New structure in handling of map_data.sii

Post by Sbaba » November 8th, 2019, 6:17 pm

Thanks for this great job! With this system, some problems will be solved easily. :)
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: New structure in handling of map_data.sii

Post by BenganJ » November 8th, 2019, 6:21 pm

@Sbaba

Well, next I'm going to convert all my other mods using the map_data.sii file, so keep an eye
on the World Background topic here! :D

viewtopic.php?p=422#p422
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
Post Reply