URL:
  <http://gna.org/bugs/?11503>

                 Summary: A way to isolate big MP content into its own
preprocessor domain
                 Project: Battle for Wesnoth
            Submitted by: zookeeper
            Submitted on: Tuesday 15/04/08 at 17:10
                Category: Feature Request
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: WML
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: trunk
        Operating System: all

    _______________________________________________________

Details:

The define= key, as it's used in [campaign] tags, should be made available in
[multiplayer] and [era] tags as well. The point is to allow MP content
creators to prevent the lengthy sections of their content (typically this
would be all the [event]s of a long MP scenario) from being loaded until a
game is started that actually uses that scenario or era, which would in turn
help to lower the loading times when entering MP mode.

The game would recognize scenarios using the define= key, and do a WML
reparse when that scenario is started. In a similar manner in which campaigns
work: the files containing the [campaign] tags are always included at game
start, and when a campaign is started, the game sets the symbol of that
campaign and does a WML reparse, which then includes the custom units,
scenarios and such that exist inside the #ifdef CAMPAIGN_SYMBOL and are thus
not loaded otherwise.

This is how it would work approximately in the case of a MP scenario:

1. The author sets define=MY_UMC for his [multiplayer] scenario, and wraps
everything that doesn't need to be included before the scenario starts inside
an #ifdef MY_UMC.
2. When MP mode is entered, the game loads everything inside an #ifdef
MULTIPLAYER just like it does now. It'd thus also load the parts of the
author's MP scenario which are outside his #ifdef - thus the author needs to
make sure everything needed for displaying the scenario in the scenario list
(gold/fog/side settings, etc) and in the game lobby is outside the #ifdef.
3. When a game using that scenario is actually started (when the host presses
"start game", the host needs to check if that scenario has its own define=. If
it doesn't, things work as currently. If it does, then the host sets the given
symbol and reparses all WML, so that the isolated parts inside #ifdef MY_UMC
get included into the scenario.
4. If the remote clients have the scenario themselves, then they can do the
above reparse locally just like the host does. If the host needs to transmit
the scenario to the clients who don't have it, then the host does that after
the reparse. Note that this means that those clients need to receive the
scenario a second time when the game starts - AFAIK the scenario data is
currently transmitted already when joining the game, so this second "full
version" of the scenario data needs to replace the one that was transmitted
when joining.

Of course, if one can think of a better and easier to implement mechanism to
isolate MP content then that's fine too.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?11503>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to