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)
- Country: the currently selected country. You can change its name or “sell” it to another country clicking on transfer.
- 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!
- 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.
- Revert: will discard changes and reload data from current files (in Resources/Geodata folder).
-
Save: will save changes to files in Resources/Geodata folder.
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.
-
Equalize Provinces: this option allows you to merge provinces in each country so the resulting number is in the given range. Useful for generating simplified provinces map.
-
Fix Orphan Cities: this option will search any city without province or country assigned and fix it. It will assign the country that surrounds the city (or the nearest one). It will also take the province surrounding the city and assign to it. Once you execute this option, remember to save!
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 split 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 “Aggressive 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 regions 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 comprised 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.
Editing Tips
This section contains useful tips for a correct usage of the Map Editor. Please read carefully before contacting us with any issue.
-
Before start making changes, determine if you need the high-definition frontiers file or not. Current release of the asset is quite optimized so unless you have specific low-end platform requirements we’d recommend you to use the high definition mode.
Of course if you don’t need such detail in your project, then you can just work with the low-definition file. Note that the high-def and low-def files are different. That means that changes to one file will not affect the other. This may duplicate your job, so it’s important to decide if you want to modify both maps or only the low-def map.
-
We strongly recommend using the editor with a globe scale of at least 1000. You may switch between normal scale (1,1,1) and “editing scale” (1000,1000,1000) pressing the “Toggle Zoom” button in the editor inspector.
-
When you decide to modify the high-definition file, you will want to use the command “Create Low Definition Geodata File” from the gear command, and review the low-def map afterwards.
-
If you make any mistake using the Point/Circle tool, you can Undo (Control/Command + Z or Undo command from the Edit menu). Please note that undo is not supported for complex operations, like creating a new country, deleting or transferring regions. So save often!
-
You can use the Revert button and this will reload the geodata files from disk (changes in memory will be lost) – so if you saved before performing a complex operation and it went “bad” you must click “Revert” (which in fact acts as an Undo except for you have to save first!).
-
If you modified the geodata files in Resources/Geodata and want to recover original files, you can use the Restore Backup command from the gear icon, or manually replace the Resources/Geodata files with those in the Backup folder. As a last resort you may replace current files with the originals in the asset .unitypackage.
-
Starting V4, there’re two new buttons in the Editor inspector:
-
-
Redraw: this will delete any children from the globe and redraws every object/layer. This is a reset button for the scene but won’t discard any change to the frontiers.
-
Sanitize: this option can be useful if for any reason the frontiers of a country goes wrong. This option will check for self-crossing segments in the polygon and will remove them. It can’t fix every problem, but most of the time you don’t see a country correctly filled in color is due to a self-crossing polygon.
-