HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"modified unit" versus "custom unit"

03-30-2007, 09:52 PM#1
WraithGlade
Hey, this is a minor thing, that's occured to me often, that I was wondering. It ultimatly doesn't matter much if I don't find out the answer, but I still want to know.

Here's my question: 2 maps, identical in every single way, except that 1 of them defines a custom unit by modifying one of the orignal game's unit entrys, the other defines that same custom unit by using the 'add custom unit' feature (and where every single field of the custom unit is signifcantly modified, compared to the originating unit). So which 1 takes less space (if that's even applicable)?
03-30-2007, 10:01 PM#2
Tide-Arc Ephemera
lol I'm probably just guessing blindly here, but the one with less stuff in it is smaller. If you want a tiny map size, look for an Optimizer, that of Vexorian.
03-30-2007, 10:14 PM#3
Earth-Fury
The differance would be trivial at best.
03-30-2007, 10:17 PM#4
TaintedReality
Try testing it yourself, it shouldn't take long to do. I doubt anyone actually knows from experience, although it seems that adding a whole new unit would take up more space since that takes up another line in each file of the mpq rather than modifying an existing line. But, as Earth-Fury said it would be a trivial difference.
03-31-2007, 12:27 AM#5
WraithGlade
Agreed. I'll make 2 identical maps with 2 identical units and check how big the files are. I'll post the results once I get around to doing the test.

Assuming one method is indeed smaller than the other, I feel inclined to say that even very small differences can add up.

For an analogy, let's say that on some rural street somewhere there's only a 1 in 20,000 chance of getting hit by a car if you run across blindfolded. So then some person who lives in the area thinks "that's tiny!", so they do it, every day... for 7 years. So there's what, about 360 days in a year. Which would mean they did it 2520 times. Which makes the chance that they got hit during that time 1 in 10 (yet they continue to think of it as 1/20,000).

Course its not that simple either, one has to account for the amount of work put in and benefit produced, and so forth. And perhaps I chose a harsh or unrealistic analogy, but you get my point.

Just my thoughts, is all

Anyways, thanks for the advice, peps.
03-31-2007, 05:22 AM#6
Dil999
My guess: about 1 kb.
03-31-2007, 09:13 AM#7
Rao Dao Zao
Isn't the difference more in loading times? I'm sure I heard rumour that modified units load faster than new units.
03-31-2007, 11:03 AM#8
The)TideHunter(
Modifying a original unit would save some space and alot of loading time.
When you modify a original unit, you are just setting numbers/etc in the file its all stored in.
When you create a new unit, you are making alot more new ones, so its gonna get bigger.
03-31-2007, 05:01 PM#9
Earth-Fury
Of course, im not sure how many of the benifits are kept if you widgitize your map.
http://wc3campaigns.net/showthread.php?t=79231
03-31-2007, 06:12 PM#10
Alevice
My guess is that the difference would lie in less than 1kb, given how every change is stored in meta files, and if it applies some sort of inheritance (ie, the unchanged data in the new custom unit is refered from the base unit, rather than recreated), ther differences are even smaller.

lets assume that meta files are xml. This is how it could look:

PHP Code:
<!--for a modified unit-->
<
unit id="hfoot">
<
base-life value="500">
</
unit>

<!--for 
new unit-->
<
unit id="u000" base="hfoot">
<
base-life value="500">
</
unit

I wouldn't be surprised if blizzard utilized a similar method (but different format) to that.
03-31-2007, 09:51 PM#11
WraithGlade
I tested it by merely saving 2 identical maps, then adding an exact replica of a normal footman to one of them as a custom unit. And it turns out that custom units do indeed take up more space than the modified equivalents, even if it's entrys are completly unmodified compared to the original

in specific:
custom Footman (unmodified) consumed 143 bytes more space than the map without

It's a relativly small difference, but it proves the point.

I am struck with how very simple this question of mine actually was, and im somewhat suprised that I went far enought to post it. As TideHunter said, your adding new entrys for the custom unit's fields, so its going to take more space, simple as that.
04-02-2007, 02:24 PM#12
PsychoPif
I'd be curious to know how much of a loading time it adds too. I might test it out tonite and post the result