Increase MP loading speed and clear help garbage from addons

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
FallenPhoenix
Posts: 42
Joined: September 30th, 2011, 5:20 pm
Location: Russia
Contact:

Increase MP loading speed and clear help garbage from addons

Post by FallenPhoenix »

Multiplayer section loads too slow, expecially on Windows and when many addons installed. Is it because most of the data parse after MULTIPLAYER macro definition turns on? If so, can we define some own macros to force engine process scenarios when it loads instead?

And also addons makes game help very dirty. Ideally i can imagine some additional switches or sections there, but is this a possible to make some better using WML? For exampe, make additional units only visible when it's scenario or era playing? I found hide_help key, but don't found a way to switch it during game events...

The best I came up with so far is to write a little utility, which helps to disable/enable addons, moving them between userdata/data/add-ons and userdata/data/disabled folders. May be, I translate it to English and upload here soon.
Independent translator. // Sorry for my English :)
Моя версия перевода [url=http://forum.wesnothlife.ru/index.php?topic=1141.0]тут[/url].
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Increase MP loading speed and clear help garbage from ad

Post by zookeeper »

There's been some suggestions about it before, but so far none of them has materialized.
User avatar
Coffee
Inactive Developer
Posts: 180
Joined: October 12th, 2010, 8:24 pm

Re: Increase MP loading speed and clear help garbage from ad

Post by Coffee »

I know I've posted a few suggestions and have some other things on my mind with Wesnoth right now, but why doesn't the game just read the define statements and where they are dependant on each other between addons (such as eras and scenarios) and not read any content at all until the scenario starts (as presumably already happens when a player joins a game where they don't have the addon themselves)? This would not require any changes to existing addon code and I would think would be easy to code.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Increase MP loading speed and clear help garbage from ad

Post by Sapient »

Probably it hasn't been done yet because the WML Preprocessor (which is the main code involved with loading the files) is one of the most complicated areas of the wesnoth codebase. A lot of the general abstract assumptions would have to be replaced with special case handling... special cases that would need to trickle down several layers of modularized code. You still need to read all the files to some extent, or have some other cache with the names of all the eras and maps available. Now there are also modifications that affect everything. Speaking of caches, what would become of the big MULTIPLAYER cache? Would you replace it with an growing number of caches representing every combination of add-ons, eras, etc? As you can see it is not a simple problem.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
FallenPhoenix
Posts: 42
Joined: September 30th, 2011, 5:20 pm
Location: Russia
Contact:

Re: Increase MP loading speed and clear help garbage from ad

Post by FallenPhoenix »

I'm not a C++ programmer (can understand game code, but not easy / not well), and don't know, how specifically cache works now, but first thought is make per-addon subcaches, and some command or directive to request load depencies. I.e. when some scenario loads, it ask engine try load some another too - just try at first, next it can be as is, using #ifhave.

Btw, it there a way to check loading time - something like "'Era of Magic' addon loaded per XXXX msec." into stdout. It can be useful for UMC optimisation.

And what about realising [hide_help] trigger as part of InterfaceActionsWML? I don't think, this is so hard...
Independent translator. // Sorry for my English :)
Моя версия перевода [url=http://forum.wesnothlife.ru/index.php?topic=1141.0]тут[/url].
Post Reply