MultiplayerContent/de

From The Battle for Wesnoth Wiki
< MultiplayerContent
Revision as of 18:50, 20 February 2022 by RufDerMacht (talk | contribs) (trans)


Auf dieser Seite wird erläutert, welche WML-Syntax innerhalb einer .cfg-Datei erforderlich ist, damit ein einzelnes Szenario oder eine Kampagne im Multiplayer-Modus (MPM) funktioniert. Da nur diese Unterschiede angesprochen werden, ist es sinnvoll, zunächst die vorherigen Artikel des Leitfadens für Kreative (Verlinkungen oben auf dieser Seite) zu lesen.


Szenarios im Multiplayer-Modus

Im MPM kann man ein einzelnes Szenario spielen, ohne dafür eine Kampagne einzurichten (dies ist im Einzelspielermodus nicht möglich). Dazu sind folgende Anpassungen nötig:

  • In der Datei _main.cfg: #ifdef MULTIPLAYER als Ladebedingung einfügen.
  • In der Szenario-Konfigurationsdatei: ein [multiplayer]-Tag anstelle eines [scenario]-Tags auf oberster Code-Ebene verwenden.

Kampagnen im Multiplayer-Modus

Anmerkung: Multiplayer-Kampagnen in Battle for Wesnoth werden erst ab Version 1.11.6 des Spiels unterstützt.

Wesnoth hat grundlegende Unterstützung für Kampagnen im MPM, man kann es entweder mit Freunden oder sogar mit einer KI spielen. Es gibt allerdings nach wie vor ein paar Dinge, die nicht so arbeiten wie man es erwarten könnte, da sich einige Funktionen noch in der Entwicklung befinden.

Man kann und sollte seine Arbeit zunächst im Hotseat-Modus testen, aber einige Dinge werden sich unter realen Netzwerkbedingungen vermutlich dennoch anders verhalten (und hauptsächlich Szenario- und Nebenparameter beeinflussen). Das sollte man immer im Hinterkopf behalten und eine Multiplayer-Kampagne immer auch im Netzwerk testen.

Das [campaign]-Tag

In Multiplayer-Kampagnen wird das [campaign]-Tag verwendet, das ein und dieselbe Kampagne sowohl im MPM als auch im Einzelspielermodus spielbar macht. Das Spiel überprüft im MPM lediglich zusätzlich einige optionaler Tags. Diese Tags können unter CampaignWML nachgeschlagen werden.
Außerdem muss in Multiplayer-Kampagnen das type-Attribut ausdrücklich auf mp oder hybrid gesetzt werden, da eine Kampagne andernfalls gar nicht erst im MPM sichtbar ist.

Die Szenario-Datei

Ein Szenario innerhalb einer Multiplayer-Kampagne ist beinahe identisch zu einem Szenario in einer Einzelspieler-Kampagne. Es müssen nur folgende Änderungen vogenommen werden:

  • Ein Szenario, das nicht dafür vorgesehen ist, direkt gestartet zu werden, sollte innerhalb des [scenario]-Tags den key allow_new_game=no enthalten. Das verhindert die Anzeige des Szenarios auf der Multiplayer-Konfigurationsseite als "entry point".
  • 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 as an "entry point" in the multiplayer configuration screen. (Version 1.13.? and later only) This is no longer true, allow_new_game=no is now the default
  • For scenarios that don't use allow_new_game=no, one could make use of new_game_title to have a custom title. This is useful if the campaign is supposed to have multiple entry points such as chapters.
  • Each human-controlled side needs to have a controller=human key defined in its [side] tag to work in network mode.
  • Each human-controlled side also needs to have a save_id defined inside its [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. (Version 1.13.? and later only) This is no longer true, save_id defaults to id, just like in sp
  • If you want to carry over information for ai sides, they need to have a save_id defined and persistent=yes in their [side] tags. (The same is true for singleplayer campaigns)
  • (Version 1.13.? and later only) You can use previous_save_id to tell the engine which player shodul control which side. For example if you have a multiplayer campaign and in scenario1 you have two sides with ids Kalenz and Landar, and in scenario2 you have sides with ids Konrad and Delfador you can use previous_save_id=Kalenz and previous_save_id=Landar in scenario2 to make sure that the player that previously controlled Kalenz now controls Konrad and the player that previously controlled Landar now controlls Delfador.

Other Notes

  • To ensure that your scenario settings won't get overwritten by the settings from the multiplayer configure dialog, you can set force_use_map_settings=true. However, if your campaign is not intended to be played strictly with default settings, you can 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],[remove_shroud], and [lift_fog]. You might also want to use experience_modifier=100 in the [scenario] tag.

Synchronization

When creating multiplayer content, you should be cautious of code that might change on one client but not the other players'. Not doing so can result in an Out of Sync error. Most [event]s are synced across all clients, but a few still have issues. A full list of safe events can be found on the EventWML page.

See Also