Usual generators of size (or at least those that troubled me so far):
1. Walking Corpses and Soulless. This cannon fodder accumulates on the recall list (because it is useless to recall), and its unit code is very long because all variations are contained in every unit's code in save files. This is my actual problem, you know how will it look after 50 scenarios with plague-using units.
2. AMLA. If there is too many units with AMLA, it might become a problem. All the AMLA possiblities of all units are stored quite uselessly in save files (because unstore_unit reloads it anyway). If you have 20 units of the same type with AMLA, all the AMLA will be there 20 times. I have coded a workaround for this, but the way it works is oblivious to me.
3. Macros. Each macro is substituted in the save file, so if you have a long macro and it appears a lot of times in every scenario, it is useful in most cases to use some variables as arguments and use fire_event instead (WARNING: in rare cases, it can cause segmentation faults, so if it starts crashing, just try to code it differently).
4. Garbage. Always delete the variables you don't need anymore, especially variable arrays.
Also, you can actually open the file (look for a program that can open that type of archive, it is a relatively common type of archive), skim through its contents to see which parts of the code are taking so much space.
But, the save files don't slow down the loading too much. At some point, I had excessive problems with point 2, resulting in save files larger than 2 megabytes, and even 40 megabytes when uncompressed. But, it was still loading relatively quickly (back to the start of the turn usually took only like 2 seconds, that wasn't much more than usually). It was causing various short freezes and fps drops, also froze for like 2 seconds when it wanted to autosave, but it still didn't delay the end scenario message or proceeding into another scenario. At the moment, my campaign produces save files that are like 200 kilobytes large, and it does not cause any slowdowns. The only thing that takes a lot of time is the loading for the first time when your turn the game on, because there is so many scenarios (trying to load a single scenario shortens it significantly).
Therefore, I am quite sure that the cause of your problem is not the size of save files, but something else. While cycles are the most probable option. WML is not C, when you fire an event inside a while cycle and use the same name for the iterator, an infinite loop will arise. If you have an infinite loop there, it will break after 65k cycles (if the contents of the [do] tag is short, it may take like 5 seconds), so you might not realise that you've a bug there. Use [chat] or [message] to see how it is iterating.
Legend of the Invincibles
- single player campaign, trying to be an expansion to regular Wesnoth, where units can advance indefinitely, gear becomes an important factor and tons of new abilities increase the game's variety.