Difference between revisions of "Kenabil's Map Viewer"

From Wurm Unlimited
Jump to navigation Jump to search
m (→‎Map Types: Fixed a spelling mistake.)
Line 19: Line 19:
 
: On top of the flat terrain image is drawn topographic lines, and each line represents 100 slopes above or below water level.
 
: On top of the flat terrain image is drawn topographic lines, and each line represents 100 slopes above or below water level.
 
; Isometric
 
; Isometric
: The isonetric view is rendered as a 3D projection, giving the feeling of looking at a 3D map.
+
: The isometric view is rendered as a 3D projection, giving the feeling of looking at a 3D map.
  
 
=== The Pointer and Coordinates ===
 
=== The Pointer and Coordinates ===

Revision as of 11:33, 31 August 2020

About the Map Viewer

This is a tool which will make it possible to render the Wurm server map to a web page. The generated files needs to be uploaded to a web page server. If you run a dedicated server, you can setup automatic updating of the map, see below.

The map viewer software is open source, and the project is located on GitHub and is found here:

https://github.com/awakening-wurm/MapViewer/releases

Features

Zooming

Zooming is done with the mouse wheel, and will then zoom into or out of the tile the mouse is pointing at. Alternatively, zooming can be done in the left hand panel by clicking on the + and - buttons. Zoom ranges between 25% and 800%.

Map Types

The map viewer renders the map to three formats:

Flat terrain
This view will show each tile as a square.
Topographic
On top of the flat terrain image is drawn topographic lines, and each line represents 100 slopes above or below water level.
Isometric
The isometric view is rendered as a 3D projection, giving the feeling of looking at a 3D map.

The Pointer and Coordinates

Clicking on the map will place a pointer, in the shape of a red arrow. This also updates the URL with the coordinates of the pointer, so you can send the pointer to friends and let them know about the location. The tile coordinates are also shown in the left hand panel, and when you move your mouse you can also see which tile the mouse is hovering over and the distance in tiles between the mouse and the pointer in both horizontal and vertical directions, as well as a straight line between the points. This is useful for example when planning roads.

Layers

There are a number of layers that can be added on top of the map, and which can be switched on and off with a set of checkboxes:

Deeds
Shows or hides that are visible deeds, i.e. deeds whee the mayor haven't opted to hide the deed (typically PvP deeds).
Guard Towers
Displays all existing guard towers on the server with a small guard tower icon.
Highways
All planted highway nodes are drawn as yellow lines, and waystones are marked as orange dots. When catseyes are placed in a straight line or zig-zag, only the end-point nodes are registered, to minimize amount of data being sent to the browser.
Bridges
Draws highways on bridges in a different colour.
Tunnels
Shows highways in tunnels in a different colour.

Info

When the mouse is hovering over a special area, the info box will show information of interest. For example, by hovering over a deed it will show who is the mayor, when the deed was created, it's size etc.

Search

The search field will look for matching deeds as you type. By clicking on a deed in the list you will be directed to the deed.

How to use the map viewer

Download the zip-file for the release you which to use. Extract the files, there should be a file named mapviewer.jar and a file named mapviewer.properties. You need to edit the properties-file and adjust it with the settings you wish to use for your server. It's possible to configure for more than one server.

To run the renderer, you need to open a terminal, also called command prompt, and type: java -jar mapviewer.jar

If you configure to run more than one server, you should name each server and then use the command: java -jar mapviewer.jar [name of you server]

You can use the logging settings in the properties-file, then change the command like this: java -Djava.util.logging.config.file=mapviewer.properties -jar mapviewer.jar [name of your server]

Properties

For all of these properties, you can add a suffix starting with a dash, then add the name of your server, e.g. server-name-MyAwesomeServer = My Awesome Server, and when you render the map you should use the command java -jar mapviewer.jar MyAwesomeServer, which will let the program know that you want to use properties with the MyAwesomeServer-suffix instead of the default values. The program will always use default values if one with your server name suffix is missing. If you use only one server and only want to render one map, then only use the properties as they are listed.

Name of server
server-name = [name]
This will be the name written as the name of the server, and is also used in the title of the web page.
Web page URL
web-page-url = [url]
URL to your main web page, which will be linked to when clicking on the server name in the panel. Defaults to "/".
Steam Server ID
server-id = [id]
The server ID, used when loading server data. If omitted, loads the first server.
Directory to the server data (static or relative path)
map-directory = [path]
Should be the the root directory where the map-files are located. Defaults to server-name, so will then look for a directory in the map viewer directory with the server name.
Original map directory, used for hiding terraforming on hidden deeds
original-map-directory = [path]
Should be the the root directory where the map-files of the original map are located. This is used for deeds that are hidden, which is a feature that requires the Awakening Server Mod installed on the server, where mayors can opt to hide their deeds. Defaults to server-name + "_original". This also requires that use-player-settings is set to true.
Directory where the generated files will be written
output-directory = [path]
Defaults to "./mapviewer".
Output format of the index file
output-format = [html|php]
Whether the generated index-file will be HTML or PHP format.
Show deeds on the map
show-deeds = [true|false]
Show deed borders on the isometric map
show-deed-borders-in-3d-mode = [true|false]
Show deed borders on the terrain and topographical maps
show-deed-borders-in-flat-mode = [true|false]
Use player settings
use-player-settings = [true|false]
This requires that the server has the Awakening Server Mod installed. Defaults to false.

Setup Automatic Updating

This requires that you run a dedicated server. First step then is to install the map viewer on the server. Next you need to setup a scheduled task which calls the map viewer program, in Linux that can be done either using crontab or systemctl. This guide will not explain how to do that. The scheduled task should first make a backup of the Wurm data, both map files and sqlite-db-files, then in the properties-file point to that backup. Also, in the properties file, make sure to point output-directory to where the web page is located.

Styling the Map

You can style the map anyway you like by editing main.css. Remember though that the index-file will be generated each time the map is rendered, as will the script config.js and the map-image png-files; all other files can be edited or replaced and won't be over-written. If you wish to add functionality, you can do this by editing the map.js script. Guard tower icons can be replaced, but if the size is changed or the base point, which is at the base of the small door on the tower, they won't be positioned correctly on the map.