Difference between revisions of "MultiplayerContent"

From The Battle for Wesnoth Wiki
(Add redirect and development notice)
(Updated for 1.11.6)
Line 1: Line 1:
'''Attention:''' This page is under development!
 
 
 
This guide is intended for version '''1.11.6 and higher'''. A page about multiplayer campaigns in older versions can be found [[MultiplayerCampaigns_1.10|here]].
 
This guide is intended for version '''1.11.6 and higher'''. A page about multiplayer campaigns in older versions can be found [[MultiplayerCampaigns_1.10|here]].
  
= Building multiplayer campaigns =
+
= Building Multiplayer Campaigns =
  
Both the stable and development versions of wesnoth have basic support for campaigns that can be played in multiplayer mode, with your friends, or even with an AI.  There will still be some things that don't work as expected as multiplayer campaigns are an area for exploration. While you can and should test your work in hotseat mode, there are a number of things that might behave differently under real network conditions (mostly affecting scenario and side parameters). Keep this in mind and make sure to test your campaign over the net, too.
+
The development version of Wesnoth has basic support for campaigns that can be played in multiplayer mode, with your friends, or even with an AI.  There will still be some things that don't work as expected because some functionality for multiplayer campaigns is still being developed. While you can and should test your work in hotseat mode, there are a number of things that might behave differently under real network conditions (mostly affecting scenario and side parameters). Keep this in mind and make sure to test your campaign over the net, too.
 
This page only documents the differences between writing multiplayer campaigns and single player campaigns, so you might want to read up on [[BuildingCampaigns]] and [[BuildingMultiplayer]] first.
 
This page only documents the differences between writing multiplayer campaigns and single player campaigns, so you might want to read up on [[BuildingCampaigns]] and [[BuildingMultiplayer]] first.
  
== The campaign file ==
+
== The Campaign File ==
 
 
Multiplayer campaigns do not use the [campaign] tag. As a result of this, multiplayer campaigns only support one difficulty level, though you could support more with enough WML, if you're feeling ambitious. The "campaign file" should look something like this:
 
 
 
#ifdef MULTIPLAYER
 
{~add-ons/My_Campaign/scenarios}
 
 
#Only needed if you have custom units
 
[+units]
 
    {~add-ons/My_Campaign/units}
 
[/units]
 
#endif
 
  
Anything that you would normally put in the campaign tag now goes into the first scenario, if it's supported there. The order of scenarios is determined by next_scenario tags, just like in single player.
+
As of version 1.11.6, multiplayer campaigns do use [campaign] tag, thus allowing the same campaign to work both in singleplayer and multiplayer. The only difference is that game also checks for a couple optional tags when campaign is used in multiplayer. They could be found in [[CampaignWML]] page. Additionally, '''type''' attribute should be explicitly set to '''mp''' or '''hybrid''' or otherwise a campaign would not be visible in multiplayer.
  
== Scenarios ==
+
== The Scenario file ==
  
A scenario in a multiplayer campaign is almost identical to a scenario in a single player campaign. You only need to change the following:
+
A scenario in a multiplayer campaign is almost identical to a scenario in a singleplayer campaign. You only need to change the following:
  
* The [scenario] tag should be replaced with a [multiplayer] tag.
+
* Every scenario which should not be available to start directly, should have '''allow_new_game=no''' inside the [scenario] tag. This will prevent it from showing in entry points selection in multiplayer configuration screen.
* The '''next_scenario''' key points to the id of the next scenario.
+
* For scenarios that don't set '''allow_new_game=no''', one could make use of '''new_game_title''' to have a custom title. This is useful if campaign is supposed to have multiple entry points. E.g. chapters.
* Every scenario after the first should have '''allow_new_game=no''' inside the [multiplayer] tag. This will prevent it from showing up in the map selection menu.  
 
 
* Each human-controlled side needs to have a '''controller=human''' key defined in their [side] tag to work in network mode.
 
* Each human-controlled side needs to have a '''controller=human''' key defined in their [side] tag to work in network mode.
 
* Each human-controlled side also needs to have a '''save_id''' defined inside their [side] tag. Each side's save_id should be unique, and it should be the same in every scenario. Without this, your recall lists and leaders will not carry over from one scenario to the next.
 
* Each human-controlled side also needs to have a '''save_id''' defined inside their [side] tag. Each side's save_id should be unique, and it should be the same in every scenario. Without this, your recall lists and leaders will not carry over from one scenario to the next.
 
* If you want to carry over information for ai sides, they need to have a '''save_id''' defined and '''persistent=yes''' in their [side] tag.
 
* If you want to carry over information for ai sides, they need to have a '''save_id''' defined and '''persistent=yes''' in their [side] tag.
* Each human-controlled side has to have a leader '''type=''' definition in every scenario except the first one . It doesn't matter which type you choose cause the type set here gets replaced by the actual leader in the recall list.
 
* If you want player's leaders to be recalled, you should either recall all units which can recruit or assign id attribute for them (unique for each leader, the same in each scenario - e.g. "p1" for leader of player 1, "p2" for leader of player 2). See [[http://forum.wesnoth.org/viewtopic.php?p=405807#p405807]]
 
* If you have a file containing macros, it must be referenced by every scenario, since there is no proper campaign file to include it from.
 
 
== The first scenario ==
 
  
* To ensure that your scenario settings are not overwritten by the settings from the multiplayer dialog, check '''use map settings''' when creating the game.
+
== Other Notes ==
  
* If any setttings are still taken from the multiplayer dialog, it is possible to overwrite them in the prestart event. Useful tags include [set_recruit], [modify_side], [modify_turns] and [remove_shroud]. There is currently no way to remove fog. You might also want to use ''experience_modifier=100'' in the [multiplayer] tag.
+
* To ensure that your scenario settings would not get overwritten by the settings from the multiplayer configure dialog, set '''force_use_map_settings=true'''. However, if your campaign is not intended to be played strictly with default settings - set it to '''false'''.
  
* Deactivate the '''Quick replays''' setting (in the multiplayer lobby), or the [story] tags will not display for you.
+
* If any settings are still taken from the multiplayer configure dialog, it is possible to overwrite them in the prestart event. Useful tags include [set_recruit], [modify_side], [modify_turns] and [remove_shroud]. There is currently no way to remove fog. You might also want to use ''experience_modifier=100'' in the [scenario] tag.
  
 
== See Also ==
 
== See Also ==
  
* [http://www.wesnoth.org/forum/viewtopic.php?t=11349 Multiplayer Campaigns HOWTO forum post]
 
 
* [[BuildingScenarios]]
 
* [[BuildingScenarios]]
 
* [[BuildingMultiplayer]]
 
* [[BuildingMultiplayer]]
  
 
[[Category:Create]]
 
[[Category:Create]]

Revision as of 20:42, 25 September 2013

This guide is intended for version 1.11.6 and higher. A page about multiplayer campaigns in older versions can be found here.

Building Multiplayer Campaigns

The development version of Wesnoth has basic support for campaigns that can be played in multiplayer mode, with your friends, or even with an AI. There will still be some things that don't work as expected because some functionality for multiplayer campaigns is still being developed. While you can and should test your work in hotseat mode, there are a number of things that might behave differently under real network conditions (mostly affecting scenario and side parameters). Keep this in mind and make sure to test your campaign over the net, too. This page only documents the differences between writing multiplayer campaigns and single player campaigns, so you might want to read up on BuildingCampaigns and BuildingMultiplayer first.

The Campaign File

As of version 1.11.6, multiplayer campaigns do use [campaign] tag, thus allowing the same campaign to work both in singleplayer and multiplayer. The only difference is that game also checks for a couple optional tags when campaign is used in multiplayer. They could be found in CampaignWML page. Additionally, type attribute should be explicitly set to mp or hybrid or otherwise a campaign would not be visible in multiplayer.

The Scenario file

A scenario in a multiplayer campaign is almost identical to a scenario in a singleplayer campaign. You only need to change the following:

  • Every scenario which should not be available to start directly, should have allow_new_game=no inside the [scenario] tag. This will prevent it from showing in entry points selection in multiplayer configuration screen.
  • For scenarios that don't set allow_new_game=no, one could make use of new_game_title to have a custom title. This is useful if campaign is supposed to have multiple entry points. E.g. chapters.
  • Each human-controlled side needs to have a controller=human key defined in their [side] tag to work in network mode.
  • Each human-controlled side also needs to have a save_id defined inside their [side] tag. Each side's save_id should be unique, and it should be the same in every scenario. Without this, your recall lists and leaders will not carry over from one scenario to the next.
  • If you want to carry over information for ai sides, they need to have a save_id defined and persistent=yes in their [side] tag.

Other Notes

  • To ensure that your scenario settings would not get overwritten by the settings from the multiplayer configure dialog, set force_use_map_settings=true. However, if your campaign is not intended to be played strictly with default settings - set it to false.
  • If any settings are still taken from the multiplayer configure dialog, it is possible to overwrite them in the prestart event. Useful tags include [set_recruit], [modify_side], [modify_turns] and [remove_shroud]. There is currently no way to remove fog. You might also want to use experience_modifier=100 in the [scenario] tag.

See Also