• 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.

How much do custom spells take up?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

On average, how much space do custom spells take up (those which are based on in built spells in the game).

E.g. say I made a hero ability with n levels for each of the vanilla warcraft 3 abilities (frost nova, heal, mass teleport, etc.).

How much space would that add to the map? Or is it better just to modify the vanilla ones rather than make new abilities?
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
This may be a cheap way to find out but it's the easiest.

You can try testing it by having a blank map then making/importing a spell into it. Save a blank version of the map and also save a version of the map with a custom spell then compare the size of both.

Anyway, I don't think the size of custom abilities is something to worry about since it won't affect the size of the map much. The only thing about having so many custom objects is that it prolongs the loading time of the map.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
When copying a standard ability, except for modifications, it just stores the new id, the id of the base object and number of modifications. That's 2*char[4]+1*int=2*4+4=12 bytes. Then there's still mpq compression.

The modifications you have on inbuilt abilities would take just as much as on custom abilities.

Slks are more flexible in size since they are in clean text, less sequential, different number lengths and do not force you to state certain attributes. But overwriting them will require a huge static overhead if you want to keep the inbuilt objects.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
I'm a bit worried because I'm already at 5 MB with models alone, and haven't even done all the terrain or triggers. The code itself takes up .5 MB (without being compressed) and it's only about 20-30% done.

What exactly are slk files? These would actually save space versus using the object editor?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
I'm a bit worried because I'm already at 5 MB with models alone, and haven't even done all the terrain or triggers. The code itself takes up .5 MB (without being compressed) and it's only about 20-30% done.

What exactly are slk files? These would actually save space versus using the object editor?

The (optimized) war3map.j of my current project has a compression ratio of 23%, therefore amounts only to ~1mb. The optimization reduced it to ~40%, but that heavily depends on how much overly generated stuff you have and what language you use.

For models you can apply MDX Squisher, which nullifies unimportant attributes of models, so the mpq package is more effective compressing them.

As I said, slk files are not as static in format as object editor files, so I fail to compare them. It depends on the contents. The Widgetizer can transform your map's object editor data to slk if you want to test it. Then again, you need to know which of the inbuilt objects you want to keep in order to kick the others. Slk files are data tables and the native format wc3 uses for all the object editor data and more. Luckily, wc3 reloads most of them on map init/you can overwrite them. The big advantage is that it does not consume further init time ingame, no first use lag. On the other hand, wc3 is very slow reading object editor modifications. In the past I used to tidily nullify all the unnecessary fields of objects in the object editor but as written above, doing so takes a lot of space and boosts the init duration of those objects greatly.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
MDX squisher didn't decrease the size of any of the models I'm using. Literally didn't lower it by a single byte...

I think I'll stick with scripting the abilities for now in LUA.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
MDX squisher didn't decrease the size of any of the models I'm using. Literally didn't lower it by a single byte...

I think I'll stick with scripting the abilities for now in LUA.

1) It makes the MDX compress more when in a mpq, you wont notice any difference in the windows file system

2) you cant. You have two options...

a) object editor
b) scripted (jass)
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
1) It makes the MDX compress more when in a mpq, you wont notice any difference in the windows file system

2) you cant. You have two options...

a) object editor
b) scripted (jass)

I'm quite sure you can script abilities with LUA, you just can't make triggered abilities. I am just talking about generating the objects with LUA script.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I'm quite sure you can script abilities with LUA, you just can't make triggered abilities. I am just talking about generating the objects with LUA script.

Bad practice. Making them in the object editor is a lot faster, unless they are above 10 levels which you should not do. (Ever wonder why abyss rpg takes 10 minutes to load and spikes on new hero?
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
Bad practice. Making them in the object editor is a lot faster, unless they are above 10 levels which you should not do. (Ever wonder why abyss rpg takes 10 minutes to load and spikes on new hero?

Bad practice?

Well first of all it's not faster (for me). Keep in mind I'm not running some Alienware or normal desktop. Using the object editor is very laggy (for me).

Also, the lua script is only run once. Then you delete it. And it creates exactly what copying a custom spell would have done. Just blazingly faster.

Also, it makes every object portable. Don't need to deal with importing objects. And then I can also use regular expressions or find to make very quick modifications.

What advantages does the vanilla object editor offer :p
 
Status
Not open for further replies.
Top