bugBattle for Wesnoth - Bugs: bug #21198, Wesnoth loads data/core/unit and...

Show feedback again

bug #21198: Wesnoth loads data/core/unit and such WML twice for multiplayer

Submitted by:  David Mikos <coffee>
Submitted on:  Tue 15 Oct 2013 05:31:56 AM UTC  
Category: Feature RequestSeverity: 2 - Minor
Priority: 3 - LowItem Group: Multiplayer
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: 1.11.6+dev (412720c)Operating System: any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sat 27 Jun 2015 06:45:21 PM UTC, comment #5:

A possibe way to fix this would be to remember the last 'define set' and reload it the next time when wesnoth is started. This means that when the game was closed from a multiplayer screen then the next time wesnoth is started the game config will be loaded with MULTIPLAYER defined and no additional reload on opening multiplayer will happen.

Wed 23 Oct 2013 12:31:30 AM UTC, comment #4:

There may be some merit to the idea that the game might be able to skip the initial data load if it is going to skip the main menu. At least, it makes sense at a high level; I don't know if there are technical details that would complicate things.

J Tyne <jamit>
Project Member
Mon 21 Oct 2013 12:03:05 PM UTC, comment #3:

You again seem to have ignored the MULTIPLAYER define that is being set on reloading the WML. Which means, at least in theory, completely different WML is loaded. In practice there are of course similarities and it would be good to introduce a better mechanic for multiplayer add-ons in general...

Gunter Labes <soliton>
Project Member
Mon 21 Oct 2013 03:54:34 AM UTC, comment #2:

From what I've been able to gather it works like so (just considering units, but the principal is the same for terrain and other things):
- title screen loads data/core/unit... files
- on click of campaign or multiplayer all data is disgregarded
- each campaign separately or a new multiplayer instance checks data/core/unit... files + the data/campaign/... or multiplayer specific era files.
- game is quit and game logic brings one back to the title screen.
- the unit files remain loaded as before (see help list of units)
- a different campaign or multiplayer instance is loaded and previous unit files are disgregarded and again each campaign separately or a new multiplayer instance checks data/core/unit... files + the data/campaign/... or multiplayer specific era files.

Just to be clear on the 'disgregarded' part -- it looks like the data is one first load combined together, but the cache for each campaign or multiplayer contains both the default and unique unit files put together. So each subsequent load may be wasting time loading the same information that is already loaded by the time the title screen loads.

Seeing as you want the unique data for each campaign to be lost when starting another campaign, it would be hard to optimize in general. However, it could be optimized specifically for the "-m", "-c", or "--scenario" command line switches to load without the title screen part -- saving one pass of the core units from cache.

David Mikos <coffee>
Project Member
Wed 16 Oct 2013 06:08:04 AM UTC, comment #1:

Have you verified that the same information is in the file from loading multiplayer? If so, that is probably a bug. There should be differences in the Legend of Wesmere campaign, and in all (or at least most) of the scenarios where you can issue commands to an allied AI.

But as for the supposed duplication, no I do not believe you should make that optimization. Even though mainline makes limited use of the MULTIPLAYER macro, add-ons are free to do so. Since someone could go out of their way to define different unit stats for single- and multi- player, I don't see why the game should ignore those differences just to optimize multiplayer testing.

J Tyne <jamit>
Project Member
Tue 15 Oct 2013 05:31:56 AM UTC, original submission:

By renaming or moving temporarily all addons and clearing the cache you should see the follinwg behavior:
- loading wesnoth to title screen creates a cache with all the default units included (~210kb file) as well as other things
- then loading the multiplayer screen creates a new file with the same information plus all the information for the included multiplayer eras and scenarios (~300kb)

This second file could potentially be optimized to not include the data that has already been loaded by the time of the title screen. This would cut down slightly on loading time for mutiplayer and testing with "-m" option from the command line.

David Mikos <coffee>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by soliton (Posted a comment)
  • -unavailable- added by jamit (Posted a comment)
  • -unavailable- added by coffee (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 21 Oct 2013 12:03:05 PM UTCsolitonCategoryBug=>Feature Request
      Operating SystemUbuntu 13.04x64=>any
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup