Menu

MapMaker

Jakob Battelino Prelog

Map Maker is an application designed for creating playable maps for Where's Wossname.
The application is currently in it's early development phase and doesn't offer anything outside basic functionality.

MapMaker's binaries are packed into the same jar file as Where's Wossname? and can be run using shell script files located in the mapmaker/ directory.



Instructions

Four basic steps are needed to create a playable map:

  • Load map image.
  • Calibrate map image.
  • Add locations.
  • Export the map.

Loading Map Image

Map image can be loaded by selecting File>Load Image... option from the menu bar.
Supported image formats are jpg, png and gif.

Calibrating the Map Image

World maps use their own special coordinate system - the geographic coordinate system. In this system, position from east to west is called longitude and position from south to north latitude. Images, on the other hand, use the screen's pixel cartesian coordinate system, also known as x, y pixel position.
Map Maker can calculate transformations from geographical coordinate system to the other, but since images come in all sizes, the application first needs to calibrate itself.

To calibrate the application, select Map>Calibrate... option. This will open the calibration sorcerer window. The sorcerer will prompt You for 10 different cities. Each time, click as close as You can, to the location of the city on the imported image. Once the sorcerer finishes, the application will be calibrated.

Currently, there is no option to set custom calibration locations, which limits the use of automatic coordinate transformation to Earth maps only.
Although application has to be calibrated, before one can start adding locations to the map, it doesn't have to be calibrated accurately. If calibration locations are not applicable to the currently loaded map image, You can just click randomly to create an inaccurate calibration. Once the calibration is made (accurate or inaccurate), locations can be added to the map.

Adding Locations

Add Location Sorcerer is started by selecting Map>Add Locations.... This will open a dialog window with four text fields:

  • Name - name of the location. This field is required. It must not be empty in order for the location to be added.
  • Country - location's country. This field is required. It must not be empty in order for the location to be added.
  • Geo. Coordinates - location's coordinates in geographic coordinate system. This field is optional. If the calibration has been successful, typing coordinates here will make the application suggest the x, y position of the location, based on the transformation calculated from calibration. The latitude and longitude coordinates have to be separated by comma ( , ): latitude,longitude. This format corresponds to the one that can be selected from Google Maps. Simply pasting coordinates from Google Maps will make the application create a location suggestion.
  • Image Coordinates - x, y coordinates of the location on the map image. This field is required. Actual x, y coordinates of the location on the map image. This field also tracks mouse clicks on the map image. In order to position the location on the image, simply click on the pixel corresponding to the location.

Once all the required parameters of the location are set, You can add the location by clicking on the Next button. If the entered information has been valid, the text field will be cleared and the location will be shown on the map image. A location is added only when Next button is pressed. Clicking on Finish button will discard any information currently in the text fields.

Once all locations are added, click Finish to close the window.

Exporting the map

Once the image is loaded and locations are added, a playable map can be exported. This is done through the Export Map Sorcerer, reachable by selecting File>Export....

In this window all the remaining required map attributes are set:

  • Map Name - descriptive name of the map.
  • Map Directory - name of the directory of the map. It is also the short name of the map. Once the map is exported, a directory by this name will be created in the res/maps/ directory and map's definition file will be placed there.
  • Difficulty - map's difficulty.
  • Source Image - source image has already been set. This text field only shows the source file location for informational purposes.

After the remaining information has been entered, the map can be exported by clicking on Export button. Clicking Cancel will of course close the Export Map Sorcerer.
At map export, the following will happen:

  • Directory res/maps/mapdir/ will be created.
  • Map definition file definition.xml will be created and put into res/maps/mapdir/ directory. For more information on map definition file, read wiki about custom maps.
  • Source image is copied to res/maps/maps/ directory, if an image with the same name doesn't already exist there.

Once the map is exported it should be recognized as a valid map the next time Where's Wossname? is run.