|
From: | David White |
Subject: | [Wesnoth-dev] KISS Solution to user campaign stability problems |
Date: | Fri, 10 Jun 2005 20:16:53 -0500 |
User-agent: | Mozilla Thunderbird 0.8 (Windows/20040913) |
I have thus come up with a solution that I'm currently testing, that I think works nicely, and simply. It reduces the generality of the engine slightly, but I think it gives us the stability we need for a 1.0 release.
The solution is to remove the {~data/campaigns} reference in the game.cfg file. Instead, the game now reads data/game.cfg and then reads each file in the pattern ~data/campaigns/*.cfg, and appends them to the config object. If a user campaign has any errors, it will not be loaded, and an error message will be displayed stating that the campaign didn't load properly. A failed user campaign load will not affect caching, and thus the message about a campaign not loading will only be displayed again the next time the user changes their data.
The top-level [units] tags are merged together into one [units] tag immediately after reading all the files. Also, since the user campaigns are now read after the core unit definitions, user campaigns cannot redefine core units. There are plenty of alternatives for user campaigns that want to make units that appear identical to core units yet somehow act differently.
Any comments on this change are welcome. I plan to check it in shortly if my testing goes well.
David
[Prev in Thread] | Current Thread | [Next in Thread] |