• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

1.3MB (45%) of the map is Ability Data

Status
Not open for further replies.
Level 13
Joined
Jul 15, 2007
Messages
763
Ever since WC3 1.29 patch came around i noticed that the unoptimized version of my map takes much longer to load. I decided to do a small investigation and found that a whopping 45% of my map's total size (2.9MB) is taken up by 1.3MB of ability data (all object data is 1.8MB). After some further investigation (i can elaborate if it helps) pointed to the spell data contributing most to the loading times of the map.

This caught me by surprise as i have avoided using abilities with absurd amounts of levels; about 60% of the abilities only have 1 level, most of the rest 2-4 levels, a handful with 5-10 levels and 2 with 50 levels. There are 915 custom abilities in the map.

How can one reduce spell data? What is actually costly in terms of spell data? Does anyone know? Is it tooltips, numbers, icon paths, bla bla bla?

I should note the optimized version loads MUCH faster!
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
How can one reduce spell data? What is actually costly in terms of spell data? Does anyone know? Is it tooltips, numbers, icon paths, bla bla bla?
Strings (text) are much more costly than numbers. Icon path is obviously a string as well.
Only modified data (pink) needs to be stored, so if you don't really need to change a field, you shouldn't do so.

915 is quite a lot and so is 50 levels. Maybe you can optimize your map, so you don't need to have so many abilities/levels.
For example instead of 50 abilities or levels to increase armor by 1 to 50, you can achieve the same, if you combine multiple levels in a similar way binary numbers are represented. With this method you will only need 6 abilities and you can cover all numbers from 1 to 63.

Also 1.29 gives quite a lot of new natives (set max hp for example) that can achieve things you previously needed abilities for.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Strings (text) are much more costly than numbers. Icon path is obviously a string as well.
Only modified data (pink) needs to be stored, so if you don't really need to change a field, you shouldn't do so.

Never really crossed my mind how expensive tool-tips could be.

I did a quick test with a level 100 Storm Bolt and it turns out they can be the biggest part of an ability by far (a level 100 storm bolt with maxed out tooltips is 150kb whilst without is 20KB).

An ability i have on the map is a 50 level version of the Item Armour Bonus and that only takes up 2kb (only the name, editor suffix and armour value fields are changed). Another ability i have is a 4 level ability based on Channel (complete with descriptive tooltips etc.) and that's 3kb, so actually, abilities with 50+ levels aren't always bad. If i do the mental maths the 1.3MB actually probably sounds about right. There is indeed some pruning i can do with the 1.29 changes but that will remove things like that 50 level armour bonus that already quite cheap.

What i also discovered is that if you have an ability with a lot of levels with fat tooltips, and convert it to an item ability or reduce its levels, those tooltips aren't cleared out even though they're not visible for editing, so they still take up space. So you could run around with a 1 level storm bolt that takes up 150kb. Lame.
 
Level 13
Joined
Oct 12, 2016
Messages
769
those tooltips aren't cleared out even though they're not visible for editing
Oh yes. Purple fields take up space even if you edit something, then reduce the levels of the ability.
You'll have to scour your object data and remove as many unnecessary purple fields as possible (lots of leg work, believe me I know.)
You'll also have to ask yourself: are those 100 ability levels necessary? Is it worth the extra loading time?
I've had to make formulas many times in development just to reduce the space used and loading/save times.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Still recovering from how annoyed it made me :p... i feel like it's a major flaw of the editor that's not very common knowledge. For bigger projects such as mine it's a potentially very harmful editor quirk. I know in the past i have shortened the levels of some abilities and neglected to clear out fields so I'll definitely be having map size taken up by "nothing" probably forever!
 
One also clones dozens of bullshit strings when cloning an ability with such hidden strings which can boost size alot.

If that is for your map "orc gladiators" I checked the wts file of 1.18g. It seems you created alot of clones of a spell called "Mark Target" with dozens of levels.
Object : String count​
  • A08V : 124
    • 15309: // Abilities: A08V (Mark Target), Name (Name)
  • A093 : 124
    • 16202: // Abilities: A093 (Mark Target), Name (Name)
  • A0AS : 123
    • 21271: // Abilities: A0AS (Boss 9 - Mark Target), Tip (Tooltip - Normal)
  • A0BW : 123
    • 23799: // Abilities: A0BW (Boss 15 - Blizzard), Name (Name)
  • A0BX : 123
    • 24543: // Abilities: A0BX (Boss 4 - Gravity Well), Tip (Tooltip - Normal)
  • A0BY : 123
    • 25275: // Abilities: A0BY (Boss 2 - Sleep), Tip (Tooltip - Normal)
  • A0BZ : 123
    • 26013: // Abilities: A0BZ (Boss 6 - Greater Binding), Tip (Tooltip - Normal)
  • A0C0 : 123
    • 26745: // Abilities: A0C0 (Boss 8 - Madness), Tip (Tooltip - Normal)
  • A0C1 : 123
    • 27501: // Abilities: A0C1 (Boss 11 - Overgrowth), Tip (Tooltip - Normal)
  • A0C2 : 123
    • 28227: // Abilities: A0C2 (Boss 16 - Flame Strike), Tip (Tooltip - Normal)
  • A0C3 : 123
    • 28995: // Abilities: A0C3 (Boss 1 - Spiderlings), Tip (Tooltip - Normal)
  • A04P : 123
    • 29859: // Abilities: A04P (Boss 6 - Anti-Magic Zone), Tip (Tooltip - Normal)
  • A0C8 : 123
    • 30675: // Abilities: A0C8 (Boss 5 - Slam), Tip (Tooltip - Normal)
  • A0C9 : 123
    • 31401: // Abilities: A0C9 (Boss 7 - Displacement), Tip (Tooltip - Normal)
  • A0CB : 123
    • 32223: // Abilities: A0CB (Boss 13 - Vendetta), Tip (Tooltip - Normal)
  • A0CD : 123
    • 32997: // Abilities: A0CD (Boss 14 - Healing Pulse Totem), Tip (Tooltip - Normal)
 
Level 13
Joined
Jul 15, 2007
Messages
763
Oh wow, thanks so much. I'm a bit busy at the moment but i did a quick check and saw that most of these abilities have 29 uncleared levels... one of them was 18KB and could be reduced to 2KB by clearing out unused fields... which is pretty big deal!

I have to be honest i completely forgot that these abilities had these hidden levels so thanks again.
 
Status
Not open for further replies.
Top