Tutorial Resizing

F

Fl4meS

Guest
<-- Map Resizing Tutorial -->

Resizing?
Yes, in this tutorial I will explain the following things from the editor
which TAKE extra space and can be easly fixed to save plenty of space.

What does this do?
If you are correctly doing what I just showed then your map will be possibly
300-600 kb's smaller, and alot faster with loading.

Why don't we just use a program?
We can use vexorian's optimizer also after optimizing our map, which can
totaly even remove more space ( 1+- mb).

Lets get started!
The first chapter will be the triggers.

-- Triggers --

Now, what is taking space when we use triggers?
First of all : the variables. Each variable created will take a new part of space
in your map, so this will also increase your size and loading time.

Each variable will increase the map its size very slightly, using variables with
arrays will take ofcourse more space.

How can I reduce so much variables taking space?

There are different options here:
- Use only ONE variable which each has the maximum arrays.
For each trigger, use a different array number.
- Use custom scripts with local variables (I will add another tutorial if some don't understand this).
-The third option is to use JASS. JASS doesn't require any(!mostly) variables (when using it
correctly) and increases your map its speed slightly. Since JASS is just a script, it also
doesn't need much space.
Allright, now lets go to the triggers themselves!

Each trigger created will take up space, depenting on how many events/conditions/actions you are using.
An example would be a trigger with 4 actions, those will take lesser space and loading time then
a trigger with 20 actions. Also, try to put useless triggers together since each NEW trigger created will take
extra space and loading time. An example here is using one trigger to setup
the map (set boolean1 = true ,like that), and another trigger to setup the waygates.
Just add the actions in one same trigger, that makes much sense : saving space and reducing the loading time.

------------------------------------------------------------------

-- Objects --

The next part I will discuss : The object editor.
Here are the most mistakes made. I would like to start by the units,
but actualy it doesn't matter where to start since the explanation comes down
on the same.

A thing, that GREATLY reduces the loading time and size is to NOT create custom units!

What should we do then?

Simply edit a standard unit that isn't used in your map.
I'm sure that there are plenty of units which are unused.

I think it doesn't make sense after all...

If you don't believe me, simply create four custom units, save the map and check
the size. Remove them and then check the size. I lost 400kb by removing custom
units.

But now to go on, we come out by the items, destructibles, doodads, abilities, buffs/effects and
upgrades : this is just the same information as above, from the units. Simply edit things you
won't use in your map, and voila! Your map size will be lesser then with custom objects!

-- The map --

Here are some hints to also save space and increasing your loading speed.

-Do not pre-place units, but use a trigger that does it.
-Some doodads like tree's can also be created on the map with a trigger.
I suggest placing some tree's, and then let the trigger automaticly add some.
-Also don't add items manualy, but let a trigger do it. Its very easy, and the
effect stays the same.

> A last hint for placing these objects : use points.
Go stand with your cursor on a location, where the object needs to be created.
Check LEFT down of your world editor : it displays Point: (-3501,4), (2614,6), (0.00).
The ones I displayed are just an examples. But just write down those points or keep
them in minds and then use the [Conversion - Convert Coordinates to Point] option to
create your unit!


<Complete your map by using Vexorian's Optimizer>
-> surely even faster now if you already used it!

Thanks for reading this tutorial,
Sorry for my bad english.
Comments are welcome!
Questions are welcome!

~- Fl4meS
 

Exide

I am amazingly focused right now!
Reaction score
448
Nice. :)
 

Lanboy

TH.net Regular
Reaction score
22
i think your titles need some resizing :p

hehe jk good thread. +rep.

and wow yeah. i knew about using triggers to place units, but not using point coordinates to do it. i made a custom region for each unit before o.0
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
Overall Good Tutorial. Although I question how much you've thought about *the other side* of what you are saying...

It's a good tutorial on filesize. Clear, concise, easy to read. Good formatting! Your English is Great! No need to apologize. I didn't notice any spelling mistakes either but then I'm not the greatest at spelling. :) Can I include this in the PDF tutorial I'm creating?

Now. The issues I had with this tutorial are as follows:
<-- Map Resizing Tutorial -->

Resizing?
Yes, in this tutorial I will explain the following things from the editor
which TAKE extra space and can be easly fixed to save plenty of space.

What does this do?
If you are correctly doing what I just showed then your map will be possibly
300-600 kb's smaller, and alot faster with loading.

Why don't we just use a program?
We can use vexorian's optimizer also after optimizing our map, which can
totaly even remove more space ( 1+- mb).
#1 Good point to mention. Well done. "...after your map is finished." might be a good thing to include. If you use Vex's optimizer before finishing the map you won't be able to work on it any more. It will also fix many "resizing" issues with custom units too...so what you mention down below regarding custom units might need some attention from you.

Lets get started!
The first chapter will be the triggers.

-- Triggers --

Now, what is taking space when we use triggers?
First of all : the variables. Each variable created will take a new part of space
in your map, so this will also increase your size and loading time.

Each variable will increase the map its size very slightly, using variables with arrays will take ofcourse more space.
#2 The difference is so minimal it's not worth mentioning. It's kind of like the difference between 1024 and 1056 bits.

How can I reduce so much variables taking space?

There are different options here:
- Use only ONE variable which each has the maximum arrays.
For each trigger, use a different array number.
#3 If you use a variable array of [12] it's just the same as adding 12 different variables. Effectively. See point #2

- Use custom scripts with local variables (I will add another tutorial if some don't understand this).
-The third option is to use JASS. JASS doesn't require any(!mostly) variables (when using it correctly) and increases your map its speed slightly. Since JASS is just a script, it also doesn't need much space.
Allright, now lets go to the triggers themselves!
#4 Not quite true. (Yes, I notice your little "!mostly" in there - but your info isn't quite accurate.) Most Jass scripts use locals which are variables. Every map I know of uses variables in one form or another. Making many variables doesn't actually increase the filesize very much. You're talking about strings which, for what they do, you might as well INCLUDE them in your map.

Each trigger created will take up space, depenting on how many events/conditions/actions you are using.
An example would be a trigger with 4 actions, those will take lesser space and loading time then a trigger with 20 actions.
...about .2 nanoseconds... add lots of those together you get = .1 second.

Also, try to put useless triggers together since each NEW trigger created will takeextra space and loading time. An example here is using one trigger to setup the map (set boolean1 = true ,like that), and another trigger to setup the waygates.
Just add the actions in one same trigger, that makes much sense : saving space and reducing the loading time.
#5 Ehhhh.... that's ok if you're concerned about the difference between "how many calories Colby cheese has, compared to how many calories Edam cheese has..." See Point #2. Most humans can't really tell the difference between .03 seconds and .05 at loading screens. And I think most people wouldn't actually care that much. When it's loaded, it's loaded. Of course, if it takes 3 minutes to load....that is pushing patience limits these days.

-- Objects --

The next part I will discuss : The object editor.
Here are the most mistakes made. I would like to start by the units,
but actualy it doesn't matter where to start since the explanation comes down
on the same.

A thing, that GREATLY reduces the loading time and size is to NOT create custom units!

What should we do then?

Simply edit a standard unit that isn't used in your map.
I'm sure that there are plenty of units which are unused.

I think it doesn't make sense after all...

If you don't believe me, simply create four custom units, save the map and check the size. Remove them and then check the size. I lost 400kb by removing custom units.
#6 How many custom units did you remove to save that amount of space? It's funny you say that. I'd swear by custom units/spells/etc. It's the only way (that I know of) to make sure that the units/spells/etc you want are the units/spells/etc you get, without having weird side effects. (i.e. a .01 stun on a spell that shouldn't have a stun.)

But now to go on, we come out by the items, destructibles, doodads, abilities, buffs/effects and upgrades : this is just the same information as above, from the units. Simply edit things you won't use in your map, and voila! Your map size will be lesser then with custom objects!
#7...which will happen when you use Vex's Optimizer anyway. I have 26 Custom spells in one of my maps with almost every field modified and I'm planning on having at least another 30 in there when I'm finished. I have at current count about 40 custom units. I have about 100 different triggers. And I have imported models and textures as well. My map filesize at the moment is at 156kb (un-vex-optimized). So...Use Custom things if you want to or need to.

#8 The other point I'd like to make regading custom things is that, sometimes...custom _____ are the only way.


-- The map --

Here are some hints to also save space and increasing your loading speed.

-Do not pre-place units, but use a trigger that does it.
-Some doodads like tree's can also be created on the map with a trigger.
I suggest placing some tree's, and then let the trigger automaticly add some.
#9 And what? Create 100's or 1000's of randomly generated point locations - which you cannot remove? My friend...You just told people to make memory leaks.

-Also don't add items manualy, but let a trigger do it. Its very easy, and the
effect stays the same.

> A last hint for placing these objects : use points.
Go stand with your cursor on a location, where the object needs to be created.
Check LEFT down of your world editor : it displays Point: (-3501,4), (2614,6), (0.00).
The ones I displayed are just an examples. But just write down those points or keep
them in minds and then use the [Conversion - Convert Coordinates to Point] option to create your unit!
#10 This creates a point location. Unless you remove that point location, it will leak. Removing it requires variables. See point #2.


<Complete your map by using Vexorian's Optimizer>
-> surely even faster now if you already used it!
Excellent! (See Point #1 though) Like I said - Overall it's a good tutorial for what it's about. The reason I'm being so brutal with it is because you have "Tutorial" in your title. I'm saying all this so your tutorial can be better. Basically what I'm saying in a nutshell is this: All these things you have mentioned are fairly reasonable. But the things that take the MOST amount of space is imported:

  • Songs
  • Textures
  • Models

Everything else can be taken care of by Vexorian's Optimizer - and you as a map maker don't really need to worry about how much filesize your triggers and custom units are taking. I give you 8/10 for this tutorial.
 

Chocobo

White-Flower
Reaction score
409
Just about variables : an array takes more size (in virtual memory) than a normal variable.
What do you mean by maximal variable?

What increase mostly the loading time? The abilities. Not units.

How much units you need to remove to clean 400 kb? Almost 500.

At end, you say : Use point
But that leaks.

Vexorian Optimizer is for .j file and .ai files. Removes also useless things, but won't save so much space (up to 1000 kb with +150000 lines of script).


Currently, no one noticed a visible difference between time taken of a native against a Blizzard JASS (BJ) swapper. Almost un-noticable (for 0.001 us? (0.001 ms or 0.000001s?)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Good tutorial (+Rep :D)
helped me learn a thing or two :) anyway good job
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top