Difference between revisions of "BuildingMaps"

From The Battle for Wesnoth Wiki
(See Also)
m (Share your map: remove extra period)
 
(38 intermediate revisions by 15 users not shown)
Line 1: Line 1:
A map is just a bunch of terrain strings arranged in a rectangle (the rectangle is known as the "map data"). There are two ways to use this rectangle in a file: as a stand-alone map, or within a scenario. The easiest way to create maps is just to use the built-in editor, but if you want to actually understand how maps work, you should read a little about the map data format. This page explains that format, and then has some pointers about the editor, saving files, and how to play on a map once you've made it.
+
{{Translations}}
 +
{| style="float:right"
 +
|
 +
__NOTOC__
 +
|}
  
== Wesnoth map data format ==
 
  
Map data is used to represent maps in Wesnoth. The encoding for maps has a specific format:
+
{{Create}}
 +
 
 +
<div class="thumb tright"><div>
 +
[http://www.wesnoth.org/images/sshots/wesnoth-1.11.8-4.jpg http://www.wesnoth.org/images/sshots/wesnoth-1.11.8-4-175.jpg]
 +
<div class="thumbcaption">Map editor</div></div>
 +
</div>
 +
 
 +
A map is the most basic of user made content you can create. Complex scenarios can be developed on them, or they can be played on their own as simple battlefields with no extra work required.
  
* A map starts with a header with the following keys
+
Wesnoth features a fully featured map editor, accessible from the <b>Map Editor</b> option at the main menu. Inside you will find all the tools you need to create your own arenas to stage your adventures.  
** usage, this is map for a 'map' and 'mask' for an overlay mask
 
** border_size, the size of the border, should be 1 for map and 0 for mask. When the border_size is 1 the map border is part of the map data, this means the user can define the border instead of the game taking a guess.
 
* Between the header and the data should be 1 empty line
 
* A map data file consists of any number of lines, each with the same number of strings.
 
* Each string must be a string specified in a ''string'' key specifying a terrain (see [[TerrainLettersWML]]).
 
* Each string may be padded with spaces or tabs and must be separated with a comma, except for the last string on a line this one may not have a comma.
 
* When the file is interpreted, each string will be replaced by the terrain it refers to.
 
* Empty lines are allowed before, after and between lines of characters, between lines is not advised.
 
* Terrains may be prefixed with a number followed by one space, these indicate the starting position for side ''n''. ''n'' = 1, 2, 3, ... 9 (more might work but is untested and unsupported). This is a change from the previous system where a starting position was automatically a keep.
 
  
It's advised to use spaces for padding and pad each column to be the same width; the game does this when writing a map file.
+
Inside the individual map files themselves are simply terrain codes that the games translates into graphics when you play. Usually you will never have to edit these files manually, but it can come in handy to understand the format. For more on terrain codes and the map data format, see the [[TerrainCodesWML]] page.
 
Since text file tiles are squares while game tiles are hexes, some tiles must be shifted.
 
Tiles in even-numbered columns are shifted down 1/2 of a tile.
 
For example, to have a road of connected dirt ('Re') tiles, the map data would look like this:
 
  
usage=map
+
For further instructions on what to do once you have completed your map, see below.
border_size=1
 
 
Re, Re, Gg, Gg, Gg, Gg, Gg, Gg
 
Gg, Gg, Re, Re, Gg, Gg, Gg, Gg
 
Gg, Gg, Gg, Gg, Re, Re, Gg, Gg
 
Gg, Gg, Gg, Gg, Gg, Gg, Re, Re
 
  
 
== Creating a map ==
 
== Creating a map ==
  
This is not the Matrix.  You do not need to look at encoded maps.  Wesnoth has a fully functional map editor, accessible from within the game. The map editor should be fairly straightforward, although if you run into trouble, go ahead and ask for help on the [http://www.wesnoth.org/forum forum].
+
=== Note before you start ===
  
Making good, balanced, interesting maps is another task altogether. ESR has addressed it in his [http://catb.org/~esr/wesnoth/campaign-design-howto.html Campaign Design How-To]
+
As of Wesnoth 1.12, the Map Editor has become more fully featured, and includes options to define scenario-related items on your map, such as name, unit placement, graphical items, time of day schedules, etc. <b>In order to create a plain map file with no scenario data, use the <i>File → Save Map</i> option. Scenario-specific content will not be saved unless you select the <i>File → Save Scenario</i> option. </b>
  
If you're a programmer, note that while the source code and most binary distributions come with the official graphical map editor, you may have to give the build system a flag or argument to tell it to compile them as well as the main game.
+
More on scenario-specific content is discussed in [[BuildingScenarios]].
  
== So now what? ==
+
There is also a simple step-by-step guide [[How to make nice map in few minutes]].
  
You've created an awesome map with the [[WesnothMapEditor]] and you're ready to test it out. But how can you do this? It's actually quite simple.
+
=== General guide to map making ===
  
==== Stand-alone maps ====
+
When you first open the map editor, you are presented with a large blank canvas covered in Grass. Below is a general guide to turning this empty meadow into an interesting and challenging battlefield.
  
If you just want to play the map, maybe against the computer or with a friend, all you have to do is save it into your custom maps folder (the default location). Then, when you launch the game and host a multiplayer game, the map should appear at the top of the map choices dialog.
+
#<b>Decide on the intended use</b> <br> Maps intended to use in a campaign usually portray a location relative to the story being told, while maps intended for use in multiplayer usually have a more "arena-like" quality to them - they're often somewhat symmetrical, feature many types of terrains to benefit all units, and are often in not-rectangle shapes. <br><br>
 +
#<b>Choose your map size</b> <br> You can resize your map with the resize function. Choose one proportional to the gameplay you would like to see on it. A close-knit battle arena? Smaller is better. A large epic, battle with many sides? Go larger. Remember, though, to not make it too big, or you will bore your players. <br><br>
 +
#<b>Decide on a theme</b> <br> Wesnoth includes many different terrains for many different situations. Caves, dungeons, meadows, icy wastes, beautiful fall scenery, etc. Decide on a general theme for your map and be sure to work with the terrains that best fit your chosen theme. <br><br>
 +
# <b>Place large geographic features first</b> <br> If you were designing an outdoors map, now would be the time to draw large features such as mountain ranges, rivers, etc. On an indoors map, place the walls, design the passages and rooms, etc. It doesn't have to be perfect, just a general outline to work with. <br><br>
 +
# <b>Add castles, villages, and roads</b> <br> Every map needs castles and keeps to recruit on, and roads or flat terrain for units to move on (most units move best on Flat terrain such as roads, grass, or dirt). Add these now, making sure not to make your castles too big or close to one another. The placement of these determines the general flow of your scenario, so choose carefully. Also add villages. These will provide your team income and healing, so don't place them too close to each other (a general rule is about 6 hex radius (at minimum) around each village). Too many close together will result in imbalance from too much gold and health regeneration. <br><br>
 +
# <b>Finer details and revision</b> <br> Begin filling in the more open spaces of your map. Add forests, trees, hills, dirt, floors, the lot, while at the same time tweaking the general layout to fit your intended design. This is where the map really begins to reach completion. Also note to be sure to draw terrain features in a way that work with your plans for the scenario; for example, be sure to place bridges where you want your units to be able to cross a river. <br><br>
 +
# <b>Embellishments</b> <br> Your map is almost complete, but in order to look polished, throw in a few embellishments. Make the grass different colors. Put rocks and mud in the rivers. Strew trash around your buildings. Scatter flowers in the meadows. It's up to you, just don't overdo it.
  
For the curious: Saving a map file like this creates a stand-alone file that holds the map data. That file is by default saved in '''''userdata''/editor/maps/''', and maps in that location are added to the top of the multiplayer map selection list.
+
It can take a lot of practice. Making good, balanced, interesting maps is an art unto itself. ESR has more handy tips in his [http://catb.org/~esr/wesnoth/campaign-design-howto.html#_map_composition Campaign Design How-To] article. You can also ask for assistance on the [http://www.wesnoth.org/forum/viewforum.php?f=15 Multiplayer Development forum].
  
==== The map_data key ====
+
== Now what? ==
  
There's another way to use map data. The data for the map can be placed directly inside of a ''map_data'' tag in a '''[scenario]''' tag (see [[ScenarioWML]]). An example of map data encoded directly in a file might look like this:
+
You've created an awesome map with the map editor, but now what? It's actually quite simple.
        map_data="border_size=1
 
        usage=map
 
       
 
        Gg, Ke, Gg, Gg
 
        Gg, Ce, Ce, Gg"
 
  
Keep in mind that it's almost always more useful to have a separate map file that you reference in a scenario than putting the data directly into the scenario (not least because the editor works on such separate map files). To use a saved map file in a campaign, you have to include the map data like this:
+
=== Play your map ===
  
map_data="{@editor/''map_filename''}"
+
If you just want to play the map, maybe against the computer or with a friend, all you have to do is save it into the map editor's folder (the default location). Then, when you launch the game and host a multiplayer game, the map should appear <b>at the top</b> of the map choices screen.
  
Note that @editor here means that the map should be found in the '''''userdata''/editor/maps/''' directory. You need to specify something else if your map is in another location (for example, in a campaign, the maps should go into their own folder). The [[ScenarioWML]], [[BuildingCampaignsTheCampaignFile]] and [[PreprocessorRef]] pages all contain more detailed information about how this works.
+
When creating a game on the multiplayer server, your map will be described to other players as a "User Map" and any replays stored on the server will refer to the game as "User Map."
  
==== Share your map ====
+
For the curious: Saving a map file like this creates a stand-alone file that holds the map data. That file is by default saved in <b><i>userdata</i>/editor/maps/</b>, and maps in that location are added to the top of the multiplayer map selection list.
  
When you're ready to share your map with the world, post if to the forum or package it to be distributed on the in-game add-ons server. For instructions on how to distribute maps, see [[BuildingMapsDistribution]]
+
=== Use your map in a scenario ===
  
== Discussion: Scenario File vs Standalone ==
+
If you're interested in more complex gameplay, you can use your map in a scenario. More information on how to proceed is on the [[BuildingScenarios]] page.
  
Campaign writers can't write campaigns without scenarios, so campaigns will always use the ''map_data'' key, either with the raw data in quotes or a preprocessor symbol {} pointing to the standalone file.
+
=== Share your map ===
  
Multiplayer mapmakers, however, '''have a choice'''.  If you want to place an object or unit on the map, you must create a scenario file starting with the '''[multiplayer]''' tag and containing the ''map_data'' key therein. You lose the simplicity of the standalone map file, but you gain tremendous power. Not only can you add units and objects, you can set allies, experience modifiers, add a map description, and add custom events (among other things). The question, "How do I place an object on the map with the map editor" is such a common question that I am sorry this information is buried so deeply here. But, now that you know you can seek out an example of a multiplayer map scenario file to use as an example.  The game comes with many maps of each type.  Check out [[BuildingMultiplayer]] for more information.
+
When you're ready to share your map with the world, post it to the [http://www.wesnoth.org/forum/viewforum.php?f=15 Multiplayer Development forum] or package it to be distributed on the in-game add-ons server. For instructions on how to distribute maps, see [[Distributing_content|Distributing Content]].
  
 
== See Also ==
 
== See Also ==
  
* [[BuildingMapsDistribution]]
+
* [[TerrainCodesWML]]
* [[WesnothMapEditor]]
 
 
* [[ScenarioWML]]
 
* [[ScenarioWML]]
 
* [[ReferenceWML]]
 
* [[ReferenceWML]]
* [[BuildingScenariosShroudData]]
 
* [[TerrainCodesWML]]
 
 
{{Create}}
 

Latest revision as of 04:12, 21 June 2024



wesnoth-1.11.8-4-175.jpg

Map editor

A map is the most basic of user made content you can create. Complex scenarios can be developed on them, or they can be played on their own as simple battlefields with no extra work required.

Wesnoth features a fully featured map editor, accessible from the Map Editor option at the main menu. Inside you will find all the tools you need to create your own arenas to stage your adventures.

Inside the individual map files themselves are simply terrain codes that the games translates into graphics when you play. Usually you will never have to edit these files manually, but it can come in handy to understand the format. For more on terrain codes and the map data format, see the TerrainCodesWML page.

For further instructions on what to do once you have completed your map, see below.

Creating a map

Note before you start

As of Wesnoth 1.12, the Map Editor has become more fully featured, and includes options to define scenario-related items on your map, such as name, unit placement, graphical items, time of day schedules, etc. In order to create a plain map file with no scenario data, use the File → Save Map option. Scenario-specific content will not be saved unless you select the File → Save Scenario option.

More on scenario-specific content is discussed in BuildingScenarios.

There is also a simple step-by-step guide How to make nice map in few minutes.

General guide to map making

When you first open the map editor, you are presented with a large blank canvas covered in Grass. Below is a general guide to turning this empty meadow into an interesting and challenging battlefield.

  1. Decide on the intended use
    Maps intended to use in a campaign usually portray a location relative to the story being told, while maps intended for use in multiplayer usually have a more "arena-like" quality to them - they're often somewhat symmetrical, feature many types of terrains to benefit all units, and are often in not-rectangle shapes.

  2. Choose your map size
    You can resize your map with the resize function. Choose one proportional to the gameplay you would like to see on it. A close-knit battle arena? Smaller is better. A large epic, battle with many sides? Go larger. Remember, though, to not make it too big, or you will bore your players.

  3. Decide on a theme
    Wesnoth includes many different terrains for many different situations. Caves, dungeons, meadows, icy wastes, beautiful fall scenery, etc. Decide on a general theme for your map and be sure to work with the terrains that best fit your chosen theme.

  4. Place large geographic features first
    If you were designing an outdoors map, now would be the time to draw large features such as mountain ranges, rivers, etc. On an indoors map, place the walls, design the passages and rooms, etc. It doesn't have to be perfect, just a general outline to work with.

  5. Add castles, villages, and roads
    Every map needs castles and keeps to recruit on, and roads or flat terrain for units to move on (most units move best on Flat terrain such as roads, grass, or dirt). Add these now, making sure not to make your castles too big or close to one another. The placement of these determines the general flow of your scenario, so choose carefully. Also add villages. These will provide your team income and healing, so don't place them too close to each other (a general rule is about 6 hex radius (at minimum) around each village). Too many close together will result in imbalance from too much gold and health regeneration.

  6. Finer details and revision
    Begin filling in the more open spaces of your map. Add forests, trees, hills, dirt, floors, the lot, while at the same time tweaking the general layout to fit your intended design. This is where the map really begins to reach completion. Also note to be sure to draw terrain features in a way that work with your plans for the scenario; for example, be sure to place bridges where you want your units to be able to cross a river.

  7. Embellishments
    Your map is almost complete, but in order to look polished, throw in a few embellishments. Make the grass different colors. Put rocks and mud in the rivers. Strew trash around your buildings. Scatter flowers in the meadows. It's up to you, just don't overdo it.

It can take a lot of practice. Making good, balanced, interesting maps is an art unto itself. ESR has more handy tips in his Campaign Design How-To article. You can also ask for assistance on the Multiplayer Development forum.

Now what?

You've created an awesome map with the map editor, but now what? It's actually quite simple.

Play your map

If you just want to play the map, maybe against the computer or with a friend, all you have to do is save it into the map editor's folder (the default location). Then, when you launch the game and host a multiplayer game, the map should appear at the top of the map choices screen.

When creating a game on the multiplayer server, your map will be described to other players as a "User Map" and any replays stored on the server will refer to the game as "User Map."

For the curious: Saving a map file like this creates a stand-alone file that holds the map data. That file is by default saved in userdata/editor/maps/, and maps in that location are added to the top of the multiplayer map selection list.

Use your map in a scenario

If you're interested in more complex gameplay, you can use your map in a scenario. More information on how to proceed is on the BuildingScenarios page.

Share your map

When you're ready to share your map with the world, post it to the Multiplayer Development forum or package it to be distributed on the in-game add-ons server. For instructions on how to distribute maps, see Distributing Content.

See Also

This page was last edited on 21 June 2024, at 04:12.