Memory Questions

BarzahdX

Active Member
Reaction score
18
I've been meaning to ask these for awhile.

1: Does an ability in the Object Editor take up equal space as one trigger?

2: Does the memory taken up by a trigger vary with the size of the trigger?

3: If you have 4 triggers for 4 levels, will that take equal space to 1 trigger with 4 if/then/elses?

4: Does JASS save room in comparison to GUI or Object Editor?

5: Is having as few as possible triggers and units and abilities in the Object Editor worth it, for the sake of saving memory?

6: If a trigger is "Initially Off" will it not take up memory until turned on?

7: Will it save space if I make a trigger to turn on all spells for each hero once they are picked, or will it be like saving space from turning them off, and taking up space from adding the other triggers?
___________________________________________

I don't expect all of these to be answered, but I'm looking forward to the responses on 7, 6, 1, and 2. Thank you in advance, and please ask if you don't understand.
 

SFilip

Gone but not forgotten
Reaction score
634
I'll assume that by "memory" you mean "map size", but even if you meant RAM, the answers are the same as triggers and objects by themselves always use a fixed amount of both.

1. You can't really compare those. The size which a custom ability takes depends on how many fields you customize. The trigger size can be, in theory, infinite, depending on how much you put in it.
2. Of course it does.
3. Yes, more or less.
4. Yes, if well optimized, in most cases only a little bit. If you use Vexorian's optimizer, this difference may not even exist.
5. Nope. The things that really affect your map's size are imports. Nothing more, nothing less. But you should also use Vexorian's optimizer to make the rest of it (especially the code) smaller and faster.
6. No, a disabled trigger takes just as much as an enabled one. Actually, a disabled one takes a couple bytes more because the editor adds the line which disables it.
7. It won't save space. Actually, you would make your map bigger as you would make a trigger that does the enabling.

All in all, triggers and object data are not something you need to worry about when it comes to size. At best you'll save a couple of KB and even that is pointless if you use Vexorian's optimizer. Memory leaks are the real thing you need to worry about when it comes to triggers.

Edit: Damn, Ace was faster. :(
 

BarzahdX

Active Member
Reaction score
18
Speed is nothing if your post was more fulfilling! Thank you both for the answers.. SFilip, awesome--that was exactly what I needed, so having 1 trigger doing the work of 4 is merely convenience? That's awesome. /bow
 
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