• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

How do size reducing tools work ?

Status
Not open for further replies.
Level 6
Joined
May 7, 2009
Messages
228
Short Version:
Optimizers work by removing junk from the map. So, the reduction in size depends on how much junk there is in a map. So your second question isn't a meaningful question.
On the one hand, you could have a 80mb map, but if 77mb of that is junk, then it will still be under 4mb after optimization.
On the other hand, you could have a 4.2mb map, but if 4.1mb of that is non-junk, then no optimizer in the world will be able to get the map size under 4mb.

By the way, the World Editor always inserts lots of junk into your maps. If it sees a map that doesn't have those junk files in it, it will get confused and be unable to open the map.
So really, map protection is just a side effect of making the map smaller!
 
Level 6
Joined
May 7, 2009
Messages
228
It only inlined functions under special circumstances

Look at any WE map that has been optimized, and it will still have dozens of one line functions that could easily be inlined.
Although they try, the optimizers really aren't that smart about actual code optimization. The best they can do is to remove comments, whitespace, rename everything to shorter names, change newlines to single characters, etc.
But it won't actually optimize the design of your code.
If you put in a hundred useless functions
UselessFunction1
UselessFunction2
UselessFunction3
...

Then after optimization, it will look more like
aa
ab
ac
...

but the functions will all still be there, just renamed.

You still have to use your brain.
I remember one map I looked at where I easily removed over a thousand lines of code just by using loops and arrays. This was in a map that had already been optimized.
 
Level 11
Joined
Jul 28, 2007
Messages
920
Ok, well, i though that they do that, remove unused stuff, but is that smart ? Will map work better this way or non-optimized way ? Y second version is quite unclear. What I wanned to ask is; Would it be possible to reduce like 6 or 7 mb map to 4mb ? Lets take is a normal map with all in it. Reduces usually reduce how many ? 10-30% ?
 
Level 6
Joined
May 7, 2009
Messages
228
Ok, well, i though that they do that, remove unused stuff, but is that smart ? Will map work better this way or non-optimized way ? Y second version is quite unclear. What I wanned to ask is; Would it be possible to reduce like 6 or 7 mb map to 4mb ? Lets take is a normal map with all in it. Reduces usually reduce how many ? 10-30% ?

You are nearly always better off with a optimized map, rather then an unoptimized one.


As for the second question, the answer hasn't changed. It depends completely on the map. Some can be reduced by 99%, some can't be reduced at all.
For example, my map is usually reduced by about 1% with Vex's Optimizer, but that is because it is already pretty close to optimal and there isn't much left to squeeze out.
Now a WE generated map like you most likely are using will have a much larger size reduction. Maybe you could get it under 4mb, although there's no way for me to tell without actually seeing the map.

Basically, the only way to tell how much your map size can be reduced is to try optimizing it and see.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,264
They delete stuff from the map that only WE or users use (WC3 can work without). They also can optimize map scripts to use smaller variable names thus be smaller. They also can compress stuff more efficently some times reducing size even more.

Generally it is mostly deleting WE/user only data as a large map can have multiple 100KB of that stuff.
 
Level 6
Joined
May 7, 2009
Messages
228
By the way, if you have a lot of custom models in your map, you should try Guesst's MDX Squisher. It is a great tool that can help you get even larger size reductions then using an Optimizer by itself.
 
Status
Not open for further replies.
Top