Difference between revisions of "SoC Ideas Multiplayer Improvements 2011"

From The Battle for Wesnoth Wiki
(Under the hood)
m (heading cleanup)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{SoC2011Idea}}
 
{{SoC2011Idea}}
 
+
==Description==
 
+
<h3>Reengineer Wesnoth's multiplayer engine</h3>
=Description=
 
<h2>Reengineer Wesnoth's multiplayer engine</h2>
 
  
 
More info at [[SoC_Ideas_Multiplayer_Improvements_2011]]
 
More info at [[SoC_Ideas_Multiplayer_Improvements_2011]]
 
  
 
Wesnoth includes a lot of multiplayer content, like 'standard' scenarios, custom scenarios and multiplayer campaigns. However, when creating a multiplayer game, the player's options are highly limited - for example, it is not possible to select the difficulty level before starting the scenario, and it is not possible to allow the scenario to set what 'variables' can be customized by players before game is started (there's only global 'use map settings' flag and some control over sides). We want to reengineer the architecture of Wesnoth's multiplayer engine to allow it to support those things.
 
Wesnoth includes a lot of multiplayer content, like 'standard' scenarios, custom scenarios and multiplayer campaigns. However, when creating a multiplayer game, the player's options are highly limited - for example, it is not possible to select the difficulty level before starting the scenario, and it is not possible to allow the scenario to set what 'variables' can be customized by players before game is started (there's only global 'use map settings' flag and some control over sides). We want to reengineer the architecture of Wesnoth's multiplayer engine to allow it to support those things.
Line 15: Line 12:
 
  |suppresserrors=true
 
  |suppresserrors=true
 
  |noresultsheader=''There are no submitted student proposals for this idea''
 
  |noresultsheader=''There are no submitted student proposals for this idea''
  |category=Summer of Code 2011 Student Page&SoC Ideas Multiplayer Improvements
+
  |category=Summer of Code 2011 Student Page&SoC Ideas Multiplayer Improvements 2011
 
  |notcategory=SoC 2011 Not Submitted To Google
 
  |notcategory=SoC 2011 Not Submitted To Google
 
  |include=#Description
 
  |include=#Description
Line 22: Line 19:
 
}}
 
}}
  
=Additional Information=
+
== Required knowledge ==
== Difficulty levels in MP ==
+
* Solid C++ skills, especially the ability to read existing code.
Wesnoth includes a lot of text data config files which need to be 'parsed' before game starts. Difficulty needs to be known at the time we parse those config files. Currently, we parse those files before entering the multiplayer lobby. As a consequence, we cannot select difficulty in multiplayer game (data's already parsed at the point when the game is created). Note that parsing takes a lot of time, so, if we do it while already connected to MP server, we need to add workarounds to ensure it doesn't think the client is dead.
 
  
== Game creation screen ==
+
==Additional Information==
 +
=== Difficulty levels in MP ===
 +
Wesnoth includes a lot of text data config files which need to be 'parsed' before game starts. Difficulty needs to be known at the time we parse those config files. Currently, we parse those files before entering the multiplayer lobby. As a consequence, we cannot select difficulty in multiplayer game (the data's already parsed at the point when the game is created). Note that parsing takes a lot of time, so, if we do it while already connected to MP server, we need to add workarounds to ensure it doesn't think the client disconnected.
 +
 
 +
=== Game creation screen ===
 
We want the multiplayer game creation screen to be different and better. We think that we need different screens for normal MP scenarios, 'custom' MP scenarios and for MP campaigns.
 
We want the multiplayer game creation screen to be different and better. We think that we need different screens for normal MP scenarios, 'custom' MP scenarios and for MP campaigns.
  
== Unification of multiplayer and singleplayer in the engine==
+
=== Unification of multiplayer and singleplayer in the engine===
 
A really long-term goal would be to reduce the complexity of the codebase by merging SP and MP (making SP a special case of MP and allow seamless transition between both). There is a number of steps which could be taken to gradually move closer to this goal.
 
A really long-term goal would be to reduce the complexity of the codebase by merging SP and MP (making SP a special case of MP and allow seamless transition between both). There is a number of steps which could be taken to gradually move closer to this goal.
  
== Under the hood ==
+
==== Details ====
 +
This task was always considered very hard in the past throughout the developer community, experiences with the
 +
transformation of the "Legend of Wesmere" taken into account that may actually not be true.
 +
 
 +
Replacing every [scenario] with a [multiplayer] tag and including it's files together with every other content that is guarded by the MULTIPLAYER pre-processor symbol makes the scenarios of the campaign in question available in the create game dialogue of the mp lobby.
 +
 
 +
=== Under the hood ===
 
Wesnoth uses a pre-processor to organise its file hierarchy and to make use of macros.
 
Wesnoth uses a pre-processor to organise its file hierarchy and to make use of macros.
 
This system is used to load only a certain subset of all available WML code depending on the current needs.
 
This system is used to load only a certain subset of all available WML code depending on the current needs.
Line 40: Line 46:
  
 
But the engine does only read the _main.cfg when the whole directory was included by a pre-processor directive.
 
But the engine does only read the _main.cfg when the whole directory was included by a pre-processor directive.
If you allow me to show you some wml code you will discover that the rest of the campaign is guarded by a pre-processor symbol:
+
If you allow me to show you some wml code you will discover that the rest of the campaign is guarded by a pre-processor symbol.
  
 +
From the _main.cfg of "Heir To The Throne":
 
  .
 
  .
 
  .
 
  .
Line 51: Line 58:
 
     .
 
     .
 
     define=CAMPAIGN_HEIR_TO_THE_THRONE
 
     define=CAMPAIGN_HEIR_TO_THE_THRONE
 +
    extra_defines=SOMETHING, ANYTHING # inserted as example
 
     .
 
     .
 
     .
 
     .
Line 72: Line 80:
 
  .
 
  .
 
  .
 
  .
 +
If the player selects the campaign he will be asked for the difficulty level of the campaign.
 +
After that the whole wmltree while be re-parsed, this time with the additional defines:
 +
CAMPAIGN_HEIR_TO_THE_THRONE
 +
one of EASY NORMAL HARD
 +
SOMETHING
 +
ANYTHING
  
=Whom to ask about this=
+
==Whom to ask about this==
 
Ask Crab_ and/or fendrin on #wesnoth-dev
 
Ask Crab_ and/or fendrin on #wesnoth-dev
  
=Possible pre-gsoc tasks=
+
==Possible pre-gsoc tasks==
  
 
* Talk with devs, users, and MP devs about UI design of MP creation screens and show some prototypes of game creation screens for MP campaigns, and custom MP scenarios
 
* Talk with devs, users, and MP devs about UI design of MP creation screens and show some prototypes of game creation screens for MP campaigns, and custom MP scenarios
Line 88: Line 102:
 
* implement a lobby command to make the player who issued that command host and start a game with specified parameters, bypassing side selection screen.
 
* implement a lobby command to make the player who issued that command host and start a game with specified parameters, bypassing side selection screen.
  
* Make yourself familiar with the multiplayer port of the "Legend of Wesmere" campaign. Try to understand why and how the difficult setting is handled in it's case.
+
* Make yourself familiar with the multiplayer port of the "Legend of Wesmere" campaign. Try to understand why and how the difficulty setting is handled in its case.
 +
 
 +
* Implement a simple GUI2 frontend for the :droid in-game console command.

Latest revision as of 20:17, 5 May 2023


This page is related to Summer of Code 2011
See the list of Summer of Code 2011 Ideas



This is a Summer of Code 2011 Idea


Description

Reengineer Wesnoth's multiplayer engine

More info at SoC_Ideas_Multiplayer_Improvements_2011

Wesnoth includes a lot of multiplayer content, like 'standard' scenarios, custom scenarios and multiplayer campaigns. However, when creating a multiplayer game, the player's options are highly limited - for example, it is not possible to select the difficulty level before starting the scenario, and it is not possible to allow the scenario to set what 'variables' can be customized by players before game is started (there's only global 'use map settings' flag and some control over sides). We want to reengineer the architecture of Wesnoth's multiplayer engine to allow it to support those things.

There are 3 submitted student proposals for this idea

Daniel Tadeuszow - Practical Multiplayer

vjoe - Multiplayer Reengineering

The aim of this project is to unify the single and multiplayer modes with the intend of making the game engine more modular, more efficient and easier to extend.
See Vjoe Multiplayer Reengineering for more information.

Zaroth - Multiplayer Improvements

Since the idea with Simple content manager may turn out to be redundant, I turned my attention to SoC_Ideas_Multiplayer_Improvements_2011. This is a bunch of smaller projects with the common theme of improving multiplayer rather than one big project.

Description of my vision of these improvements can be found here: Zaroth Multiplayer Improvements
See Zaroth for more information.

Required knowledge

  • Solid C++ skills, especially the ability to read existing code.

Additional Information

Difficulty levels in MP

Wesnoth includes a lot of text data config files which need to be 'parsed' before game starts. Difficulty needs to be known at the time we parse those config files. Currently, we parse those files before entering the multiplayer lobby. As a consequence, we cannot select difficulty in multiplayer game (the data's already parsed at the point when the game is created). Note that parsing takes a lot of time, so, if we do it while already connected to MP server, we need to add workarounds to ensure it doesn't think the client disconnected.

Game creation screen

We want the multiplayer game creation screen to be different and better. We think that we need different screens for normal MP scenarios, 'custom' MP scenarios and for MP campaigns.

Unification of multiplayer and singleplayer in the engine

A really long-term goal would be to reduce the complexity of the codebase by merging SP and MP (making SP a special case of MP and allow seamless transition between both). There is a number of steps which could be taken to gradually move closer to this goal.

Details

This task was always considered very hard in the past throughout the developer community, experiences with the transformation of the "Legend of Wesmere" taken into account that may actually not be true.

Replacing every [scenario] with a [multiplayer] tag and including it's files together with every other content that is guarded by the MULTIPLAYER pre-processor symbol makes the scenarios of the campaign in question available in the create game dialogue of the mp lobby.

Under the hood

Wesnoth uses a pre-processor to organise its file hierarchy and to make use of macros. This system is used to load only a certain subset of all available WML code depending on the current needs.

A freshly started Wesnoth instance does neither know about the inners of single player campaigns nor multiplayer content. The player is able to choose between the mainline campaigns before the wml tree gets re-parsed because the [campaign] tag hosted in the campaign's _main.cfg contains all needed information and it's parsed from game start.

But the engine does only read the _main.cfg when the whole directory was included by a pre-processor directive. If you allow me to show you some wml code you will discover that the rest of the campaign is guarded by a pre-processor symbol.

From the _main.cfg of "Heir To The Throne":

.
.
.
[campaign]
   id=Heir_To_The_Throne
   .
   .
   .
   define=CAMPAIGN_HEIR_TO_THE_THRONE
   extra_defines=SOMETHING, ANYTHING # inserted as example
   .
   .
   .
[/campaign]
.
.
.
#ifdef CAMPAIGN_HEIR_TO_THE_THRONE
[binary_path]
    path=data/campaigns/Heir_To_The_Throne
[/binary_path]
[+units]
    {campaigns/Heir_To_The_Throne/units}
[/units]

{campaigns/Heir_To_The_Throne/utils}
{campaigns/Heir_To_The_Throne/scenarios}
#endif
.
.
.

If the player selects the campaign he will be asked for the difficulty level of the campaign. After that the whole wmltree while be re-parsed, this time with the additional defines:

CAMPAIGN_HEIR_TO_THE_THRONE
one of EASY NORMAL HARD
SOMETHING
ANYTHING

Whom to ask about this

Ask Crab_ and/or fendrin on #wesnoth-dev

Possible pre-gsoc tasks

  • Talk with devs, users, and MP devs about UI design of MP creation screens and show some prototypes of game creation screens for MP campaigns, and custom MP scenarios
  • Hack in a way to select difficulty before MP scenario start (doesn't need to be done cleanly, can be a prototype hack)
  • Add a new attribute to game creation screen, to allow each player to select a number from 1 to 100 and make it available to WML code as a variable after scenario starts. Bonus points if you allow host to see the variable in the game creation screen and allow him to change it and lock it down for any particular player.
  • write or download a small MP campaign and report on any MP campaign support bugs that you find.
  • implement a lobby command to make the player who issued that command host and start a game with specified parameters, bypassing side selection screen.
  • Make yourself familiar with the multiplayer port of the "Legend of Wesmere" campaign. Try to understand why and how the difficulty setting is handled in its case.
  • Implement a simple GUI2 frontend for the :droid in-game console command.
This page was last edited on 5 May 2023, at 20:17.