From The Battle for Wesnoth Wiki
Revision as of 00:17, 26 April 2010 by Kaao (talk | contribs) (Windows)

Game and User Directories

Wherever you install the game, there will be a game data directory that contains, of course, the game's data. This directory should have the following subdirectories: data, music, sounds, and images. There are several others, but these are the important ones. In this wiki, the terms "game data", wesnoth/data, or ./data refers to the wesnoth/data directory. You normally do not need to modify these files, but you can if you want to modify a unit or something.

The user data directory allows you to add custom content without modifying the game's own files. Each OS puts its user data directory in a different place. In this wiki, "user data", userdata/subdirectory, or (occasionally) ~wesnoth/ refer to this directory.

Where is my game data directory?


Usually C:\Program Files\Wesnoth\data but it will be different if you installed the game in a different location: look for the data folder in the folder where you installed the game.

Mac OS X

Downloaded from sourceforge: control-click on the application icon. Select "Show Package Contents." Select "Contents" then "Resources.

If you did not download from sourceforge what do you do?

Command line build: /usr/local/share/wesnoth


From apt-get (Debian and Ubuntu) or emerge (Gentoo): /usr/share/games/wesnoth
SUSE 10.0 (pre-installed): /usr/share/wesnoth
Fedora 5 (Installed from yum repository RPM): /usr/share/wesnoth
Mandriva 2006.0: /usr/share/games/wesnoth
Slackware 12 (Installed from .tgz package at LinuxPackages.net): /usr/local/share/wesnoth
If you don't find it, or if you use another distribution, try find / -iname '*wesnoth*'. (as yourself, not as superuser)

Where is my user data directory?


C:\Program Files\Wesnoth\userdata

or C:\Users\USERNAME\AppData\Local\VirtualStore\Program Files\Wesnoth\userdata on Vista, which has virtual folders. The AppData folder is hidden. Or if you don`t remember where you installed it right click on the game`s shortcut open properties and click on the `Find target` button,then search for the `data` folder.

Starting from Wesnoth 1.8 it can be in MyDocuments\My Games\Wesnoth1.8 on Windows XP or Documents\My Games\Wesnoth1.8 on Vista.

Mac OS X

Downloaded from sourceforge: ~/Library/Preferences/Wesnoth
For Wesnoth 1.7.x : ~/Library/Application Support/Wesnoth_1.x/
Command line build: ~/.wesnoth (same as Linux; see below for details)


For newer wesnoth versions it can also be ~/.wesnoth<version>. I.e. ~/.wesnoth1.6
If unsure you can check stdout of wesnoth (run from a terminal) on startup where the used directory is mentioned.

Game data

The major directories you need to know about are wesnoth/data, wesnoth/data/core/units, wesnoth/data/campaigns, wesnoth/data/multiplayer, wesnoth/images and wesnoth/data/core/images

Become familiar with what is in ./data/campaigns and ./data/multiplayer/scenarios. These have the officially distributed campaigns and multiplayer maps. If you ever want to examine or edit one of the scenario configuration files, this is where you would go. For example, a common question is how a new player can give himself more turns or gold in scenario X. This is where you would go to do that.

Two very important directories are ./data/core/units/ and ./images. You have the ability to drop new units or images in these directories and have the game recognize them. When specifying an image for something, you do so relative to ./images.

User Data

The user data directory can do a lot of things. The game looks here for several things:

  • userdata/data/campaigns - campaign configuration files and subdirectories
  • userdata/editor/maps - multiplayer standalone maps (map data only)

The userdata/data/campaigns directory is particularly useful. A single configuration file here can selectively point to an entire subdirectory tree of units, images, sounds, scenarios, and macros. This allows you to wall off parts. Content included in the userdata units or images directories will be available globally whether you want it or not.

For example, assume you have a campaign called MyCampaign. This is what the userdata/data/campaigns directory might look like:

  • userdata/data/campaigns/MyCampaign/ - your campaign's directory
  • userdata/data/campaigns/MyCampaign/_main.cfg - a text file containing your instructions for the game about how to load the campaign
    • userdata/data/campaigns/MyCampaign/scenarios
    • userdata/data/campaigns/MyCampaign/units
    • userdata/data/campaigns/MyCampaign/images
    • userdata/data/campaigns/MyCampaign/music
    • userdata/data/campaigns/MyCampaign/sounds
    • userdata/data/campaigns/MyCampaign/utils

Template:DevFeature Note that in 1.7.0 and later versions, add-ons replaces campaigns for these paths.

See Also