Thread: Timed Effects
View Single Post
Old 01-22-2009, 11:45 PM   #14
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Anitarf
Perhaps for you, but on weaker hardware or in a more challenging map it could lead to problems. I agree that the difference isn't big; but if you apply that logic to every spell and system then you eventually get a considerable difference once you compose them all together into a single map.

The single-timer version doesn't require other libraries, which could be considered a bonus in the case of any system other than TimerUtils. In the case of such a used library, however, it's pretty inconsequential.

If you insist on including a one-timer version then you may do so, but it should be secondary to the TimerUtils one (put it lower in the post, maybe use hiddenjass tags and explain beforehand it's intended for people who for some bizzare reason don't use TimerUtils) and the timer definitely shouldn't be running when there are no effects being timed.

Also, I second Dusk on the naming conventions. If you insist on this function format (function taking an already existing effect) at least name it accordingly, something like DestroyEffectDelayed or something.

The first post should also note in the introduction that many effects (the ones with a single animation) can be destroyed immediately after they are created. People who don't know that and stumble on this resource might otherwise think they should use it on all their effects.
Hey, don't worry, I'm not being stubborn about that single timer is better than other, I just want a small benchmark for curiosity and learning, it will be quite interesting seeing the efficiency of both flavors, and if the one with TimerUtils is best, I'll immediately update my map with that version.

About naming, don't worry either, AddTimedEffect sounds nice to me, and if you like it, I'll do it.
moyack is offline   Reply With Quote