Menu

Maps

Jakob Battelino Prelog

Where's Wossname? supports custom maps and is built in such a fashion, that adding new maps should be as easy as possible. They are defined by at least one XML file, the definition.xml file, placed in a res/maps/ subdirectory.
The game automatically searches for these definition files and creates playable maps from them.
Playable game maps have to follow these rules in order for the game to discover them.

  • A definition.xml file has to be placed in a subdirectory of res/maps/ directory.
  • Definition XML file has to be a valid definition file.
  • Map image has to exist in the res/maps/maps/ directory.

The last condition is, strictly speaking, not necessary, but if the referred map image is not found, players will be playing on a blank background.



Map Definition File

Map definition file definition.xml is the crucial file for any map. It holds declarations of map's name, difficulty, map image reference and coordinates of all locations.
It has to be placed in a subdirectory of res/maps/ directory. The name of this subdirectory is the name displayed in the selection box in game's Host menu.

Valid map definition file is defined by the following DTD code:

<!DOCTYPE map [
<!ELEMENT map (location*)>
    <!ATTLIST map name CDATA #REQUIRED>
    <!ATTLIST map difficulty (easy|medium|hard|unknown) "unknown">
    <!ATTLIST map image CDATA #REQUIRED>
    <!ELEMENT location EMPTY>
        <!ATTLIST location name CDATA #REQUIRED>
        <!ATTLIST location x CDATA #REQUIRED>
        <!ATTLIST location y CDATA #REQUIRED>
        <!ATTLIST location country CDATA #REQUIRED>
]>

An example of a valid definition file is definition.xml taken from the res/maps/wonders/ directory.
It defines the Wonders of the World playable map, corresponding to wonders entry in the map selection box in the game menu.

<?xml version="1.0"?>
<!DOCTYPE map [
<!ELEMENT map (location*)>
    <!ATTLIST map name CDATA #REQUIRED>
    <!ATTLIST map difficulty (easy|medium|hard|unknown) "unknown">
    <!ATTLIST map image CDATA #REQUIRED>
    <!ELEMENT location EMPTY>
        <!ATTLIST location name CDATA #REQUIRED>
        <!ATTLIST location x CDATA #REQUIRED>
        <!ATTLIST location y CDATA #REQUIRED>
        <!ATTLIST location country CDATA #REQUIRED>
]>

<map name="Wonders of the World" difficulty="hard" image="relief8k.jpg">
    <location name="Great Pyramid of Giza" x="4804" y="1364" country="Egypt"/>
    <location name="Hanging Gardens of Babylon" x="5107" y="1307" country="Iraq"/>
    <location name="Statue of Zeus at Olympia" x="4588" y="1190" country="Greece"/>
    <location name="Temple of Artemis at Ephesus" x="4718" y="1183" country="Turkey"/>
    <location name="Mausoleum at Halicarnassus" x="4720" y="1204" country="Turkey"/>
    <location name="Colossus of Rhodes" x="4738" y="1217" country="Greece"/>
    <location name="Lighthouse of Alexandria" x="4776" y="1336" country="Egypt"/>
    <location name="Ishtar Gate" x="5107" y="1306" country="Iraq"/>
    <location name="Stonehenge" x="4054" y="881" country="United Kingdom"/>
    <location name="Colosseum" x="4380" y="1093" country="Italy"/>
    <location name="Catacombs of Kom el Shoqafa" x="4776" y="1337" country="Egypt"/>
    <location name="Porcelain Tower of Nanjing" x="6798" y="1317" country="China"/>
    <location name="Hagia Sophia" x="4755" y="1113" country="Turkey"/>
    <location name="Leaning Tower of Pisa" x="4332" y="1051" country="Italy"/>
    <location name="Taj Mahal" x="5871" y="1428" country="India"/>
    <location name="Cairo Citadel" x="4808" y="1363" country="Egypt"/>
    <location name="Ely Cathedral" x="4102" y="853" country="United Kingdom"/>
    <location name="Cluny Abbey" x="4202" y="989" country="France"/>
    <location name="Acropolis of Athens" x="4636" y="1182" country="Greece"/>
    <location name="Alhambra" x="4013" y="1200" country="Spain"/>
    <location name="Angkor Wat" x="6459" y="1742" country="Cambodia"/>
    <location name="Eiffel Tower" x="4148" y="934" country="France"/>
    <location name="Kiyomizu-dera" x="7186" y="1250" country="Japan"/>
    <location name="Moai Statues" x="1607" y="2664" country="Chile"/>
    <location name="Neuschwanstein" x="4340" y="964" country="Germany"/>
    <location name="Red Square" x="4952" y="777" country="Russian Federation"/>
    <location name="Statue of Liberty" x="2411" y="1120" country="United States of America"/>
    <location name="Sydney Opera House" x="7536" y="2818" country="Australia"/>
    <location name="Sankore Madrasah" x="4028" y="1665" country="Mali"/>
    <location name="Chichen Itza" x="2081" y="1576" country="Mexico"/>
    <location name="Christo Redentor" x="3113" y="2569" country="Brazil"/>
    <location name="Machu Picchu" x="2446" y="2347" country="Peru"/>
    <location name="Petra" x="4902" y="1356" country="Jordan"/>
</map>

The XML is divided into three parts:

  • DTD declaration of XML elements and attributes.
  • General map attributes.
  • Location declarations.

The DTD part is there solely for XML validation purposes. It is the same for all map definition files and must be in every map definition file. It has also been covered at the beginning of this section.

General Map Attributes

<map name="Wonders of the World" difficulty="hard" image="relief8k.jpg">

The two required attributes for the map element are:

  • name - a descriptive name for the map and
  • image - name of the map image file.

Attribute difficulty can also be declared, but is not required.
In the above example, the map would be named Wonders of the World, displayed it's difficulty as HARD and use image res/maps/maps/relief8k.jpg as the map image.

Location Declarations

<location name="Colosseum" x="4380" y="1093" country="Italy"/>

Each location has four required attributes:

  • name - name of the location.
  • x - horizontal coordinate of the location on the map's image.
  • y - vertical coordinate of the location on the map's image.
  • country - name of the country the location belongs to.

In the above example, the location named Colosseum will be displayed on over the pixel on coordinates 4380, 1093 and had the flag of Italy associated with it.


Map Image File

Map image file is the image that will be displayed in the game as the background on which one clicks when guessing locations.
Map image file has to be placed into the res/maps/maps/ directory, otherwise the game will not found it.
Supported image formats are jpg, png or gif.
There are no image size restrictions, but images with higher resolution are preferred, to accommodate players with higher screen resolutions.


Country Definition File

In addition to map definition file, it is also possible to declare new countries. This is done with the map's country definition file countries.xml. This file is placed int he same directory as map definition file, but is not a required file. In case the game does not discover the countries.xml file in the custom map's directory, it uses default country definition file, located in res/maps/ directory.

Country definition file serves as a mapping reference between country names and their flags. Custom country definition files serve as a tool, to remove any map location restrictions, that would have been set by the limited set of country declarations in the default countries.xml file.

An example of a valid country definition file:

<?xml version="1.0"?>
<!DOCTYPE countries [
<!ELEMENT countries (country*)>
    <!ELEMENT country EMPTY>
        <!ATTLIST country name CDATA #REQUIRED>
        <!ATTLIST country image CDATA #REQUIRED>
]>

<countries>
    <country name="Afghanistan" image="af.png"/>
    <country name="Aland Islands" image="ax.png"/>
</countries>

As with the map definition file, the XML file is divided into different sections:

  • DTD declaration of XML elements and attributes.
  • Country declarations.

The DTD part is there solely for XML validation purposes. It is the same for all country definition files and must be in every country definition file.

Country Declarations

<country name="Aland Islands" image="ax.png"/>

Each country has two attributes:

  • name - name of the country and
  • image country's flag image.

Content of attribute name is displayed in the game as the location's country. In order for the location to be associated with a country, it's country attribute has to be exactly the same as the name attribute of the country.
Attribute image is the short name of the country's flag image file. All flag image files must be located in the res/maps/flags/ directory. Missing flags will not be displayed. Flag files are restricted to jpg, png and gif formats.

In the above example, country's name will be displayed as Aland Islands and image res/maps/flags/ax.png will be displayed as it's flag.


Map Maker

Since version v0.3b, game distributions include an experimental map maker application, that automates the XML code generation and file placement.
Instructions on it's use can be found on MapMaker's home page.


Monday.com Logo