DrawnMapFormat.wiki
author Wuzzy
Sun, 18 Nov 2018 14:06:54 +0000
changeset 1621 41a7f751b77b
parent 1222 111d15f81dbd
child 1681 b41bffc4636e
permissions -rw-r--r--
DrawnMapFormat: Warning about outdatec file spec

#summary Short description of the file format of hand-drawn maps

= Hand-drawn maps =
== Introduction ==
Hand-drawn maps are maps which are created by the player using the in-game map editor.

== File format (outdated) ==
*NOTE*: This section is outdated.

Hand-drawn maps are saved with a file name suffix of “.hwmap”. The saving location is freely chosen by the user; Hedgewars does not use any predefined location to save hand-drawn maps.

Drawn map is described by a list of points, which define polylines to draw and format of each polyline.

Point is defined as
|| Big-endian int16 || Big-endian int16 || Byte ||
|| *X* coordinate || *Y* coordinate || *flags* ||

where *flags* are:
|| 8th bit || 7th bit || 6th-1st bits ||
|| if set, this is a first point of polyline || if set, polyline is erasing || *width* (thickness) of line ||

… where *width* defines `(width * 10) + 6` pixels width line to draw.

Second and further points of polyline have 8th bit of *flags* unset, the content of others are ignored for those.

A single-point polyline defines a circle.

== Sharing hand-drawn maps ==
Hand-drawn maps will be automatically transferred when playing online.

But if you wish you can still share you creations in the [https://www.hedgewars.org/node/2849 Hand-Drawn Maps Submission Thread].