Use this component to modify the provided maps interactively from Unity Editor (it doesn’t work in play mode). To open the Map Editor, click on the “Open Editor” button at the bottom of the World Map inspector.
On the Inspector you will see the following custom editor:
Description:
- Show Layers: choose whether to visualize countries or countries + provinces.hich layer to modify.
- Country File: choose which file to edit:
- Low-definition geodata file (110m:1 scale)
- High-definition geodata file (30m:1 scale)
- City File: choose which file to edit. Please note that changes in one file don’t propagate to the other:
- Principal city catalogue
- Principal + medium sized cities catalogue
- Country: the currently selected country. You can change its name or “sell” it to another country clicking on transfer.
- Create Background/Pool Country: if not already created, a button on top of the provinces dropdown allows you to create a new special country with name “Pool”. You can use this country as a default background country that can hold sea provinces and reassign the provinces later to any other country at will (check demo scene 106 under General Examples folder).
- Province/State: the currently selected province/state if provinces are visible (see Show Layers above). As with countries, you can change the province’s name ore ven transfer it ot another country.
- City: the currently selected city.
Main toolbar
- Select: allows you to select any country, province or city in the Scene view. Just click over the map in Scene View. You can select multiple provinces holding Control key.
- Reshape: once you have either a country, province or city selected, you can apply modifications. These modifications are located under the Reshape mode (see below).
- Create: enable the creation of cities, provinces or countries.
- Map Generation: shows the map generator tool options.
- Revert: will discard changes and reload data from current files (in Resources/Geodata folder).
-
Save: will save changes to files in Resources/Geodata foler.
If you click the gear icon on the inspector title bar, you will see 2 additional options:
-
Restore Backup: the first time you save changes to disk, a backup of the original geodata files will be performed. The backed up files are located in Backup folder inside the main asset folder. You may manually replace the contents of the Resources/Geodata folder by the Backup contents manually as well. This option do that for you.
-
Create Low Definition Geodata File: this option is only available when the high-definition geodata file is active. It will automatically create a simplistic and reduced version (in terms of points) and replace the low-definition geodata file. This is useful only if you use the high-definition geodata file. If you only use the low-definition geodata file, then you may just change this map alone.
Reshaping options
When you select a country, the Reshape main option will show the following tools:
-
Point tool: will allow you to move one point at a time. Note that the corresponding point of the neighbour will also be moved along (if it exits). This way the frontier between two regions is easily modified in one step, avoiding gaps between adjacent regions.
-
Circle tool: similar to the point tool but affects all points inside a circle. The width of the circle can be changed in the inspector. Note that points nearer to the center of the circle will move faster than the farther ones unless you check the “Constant Move” option below.
-
SplitV: will split vertically the country or region. The splitted region will form a new country/province with name “New X” (X = original country name)
-
SplitH: same but horizontally.
-
Magnet: this useful works by clicking repeatedly over a group of points that belong to different regions. It will try to make them to join fixing the frontier. Note that there must be a sufficient number of free points so they can be fused. You can toggle on the option “Agressive Mode” which will move all points in the circle to the nearest points of other region and also will remove duplicates.
-
Smooth: will create new points around the border of the selected region.
-
Erase: will remove the points inside the selection circle.
-
Delete: will delete selected region or if there’re no more regiosn in the current country or province, this will remove the entity completely (it disappear from the country /province array).
Create options
In “Create mode” you can add new cities, provinces or countries to the map:
Note that a country is comprissed of one or more regions. Many countries have only one region, but those with islands or colonies have more than one. So you can add new regions to the selected country or create a new country. When you create a new country, the editor automatically creates the first / main region.
Also note that the main region of a country is the biggest one in terms of euclidean area.
Provinces have also regions and can have more than one.
You can also create new regions by splitting existing countries and provinces in two drawing a separation line between two border points. To perform the split start drawing a line near a border and continue cliking adding points and extending the line towards the opposite border (notice keyboard shortcuts printed in the Scene View window).
Map Generator
The Map Generator tool is designed to automate the process of creating an entire world map with a few clicks:
Use the “Seed” slider to quickly generate a different combination of values.
Press “Generate & Save Map” to create the world map files and update the representation. Choose “Draft” as generation quality while testing parameters as this option increases the speed of map generation.
Please note that when you click “Generate & Save Map”, the tool will generate all geodata files and textures and put those files into the folder specified in the information text above the “Generation Quality” dropbox.
You can choose different sub-folders by using the “Output Folder” field hence you can use a different map for each scene in your game.
Once you click “Generate & Save Map” the new map will appear in the screen. Random names will also be generated: