HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Which Would Be More Efficient

09-30-2007, 02:39 AM#1
PandaMine
Im creating a custom attack system, and I just had a thought to rewrite the whole thing in terms of effeciency. Before I do I want to ask which would be more efficient

1. Currently the system works by creating a timer for each unit that moves the projectile created by the attack

2. What I am planning to do is to have one timer + a group containing all the projectile units and move it like that. The only concern I have with this method is you might go over the op limit, the first method works for up to 200 projectiles going at once although at that point you start noticing a bit of lag
09-30-2007, 03:03 AM#2
moyack
now with vJASS it's easier to manage with one timer a lot of stuff without any lag, and personally, it works fantastic.
09-30-2007, 03:09 AM#3
PandaMine
Yeah im using structs + HSAS (which is as fast and as efficient as you can get). My only concern with using a single timer and the group is the OP limit
09-30-2007, 03:36 AM#4
Vexorian
As long as you are not serious about using a group (as the handle type called group), then either of them is equally efficient or the one timer one is much more efficient.

If you got so much operations that you would get the op limit then your system would lag terribly using either of the options.
09-30-2007, 04:01 AM#5
PandaMine
Ok thanks
09-30-2007, 04:58 AM#6
rain9441
Correct me if I'm wrong but if struct methods use TriggerEvaluate when called doesn't each method have its own 300k opcode limit? It'd be pretty hard to reach such a limit.
09-30-2007, 05:55 AM#7
PandaMine
Actually it is more the ExecuteFunc reaching the op limit if there are too many units in the group
09-30-2007, 11:52 AM#8
cohadar
Quote:
Originally Posted by moyack
now with vJASS it's easier to manage with one timer a lot of stuff without any lag, and personally, it works fantastic.

vJASS has nothing to do with using global array + timer.

I remember doing that for a pudge hook spell even before I heard of vJASS.
09-30-2007, 01:19 PM#9
Vexorian
globals weren't this cheap before preprocessors.

Quote:
Correct me if I'm wrong but if struct methods use TriggerEvaluate when called doesn't each method have its own 300k opcode limit? It'd be pretty hard to reach such a limit.

TriggerEvaluate doesn't create a new thread, and struct methods don't use TriggerEvaluate unless it is necessary, which shouldn't if you keep them inside a library...
09-30-2007, 01:22 PM#10
cohadar
Quote:
Originally Posted by Vexorian
globals weren't this cheap before preprocessors.

Oh yes they were, because I (and I presume everybody else who was doing it) was doing global arrays idexed by player numbers so basically it was not MUI, but you did not need allocation/deallocation
09-30-2007, 01:24 PM#11
Vexorian
They weren't any cheap.

I despised globals out of having to use the variable editor to mess with them, which is a time wasting process and then the udg_ prefix...
09-30-2007, 01:27 PM#12
cohadar
true true.
If I had to use only one feature from NewGen and cast out others I would always choose globals/endglobals

Geez all those naming conventions I made up just to organize that shitty variable editor...
09-30-2007, 01:30 PM#13
Vexorian
Then again I pity any coder that would actually say he doesn't need preprocessors, I can't visualize coding Jass without global freedom anymore.
10-01-2007, 01:36 AM#14
PandaMine
Yeah it took so god damn long to make systems in the old days, especially when updating and having to make triggers for the users to copy over the globals
10-01-2007, 01:58 AM#15
moyack
Agree.