• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Preload Abilities

Status
Not open for further replies.
Level 6
Joined
Feb 5, 2012
Messages
1,685
So i am confuse what do you preload from the abilities?..


Dummy's used?.. like SFX Dummies?..

Variables?.. (How do i preload a variable in your ability! what the heck)
Like how do you preload TempPoint?.. or do i need to preload variables?..

What type of variables do you need to preload..

Also about the FPS again..

I played my map when everyone cast a spell it drops up to 10 fps. But after it, it will rise up to 30 fps or even 40 fps. So do you think my map leaks or its just Special Effects lag?.. cause if it leaks it will cause a Fatal Error but instead it goes back to normal, I am right?..
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
You preload abilities that you will add to a unit (for example a +armor ability). Because there is always an inevitable lag upon first time an ability is added to a unit, we preload it to avoid it ruining the map's gameplay.

The framerate drop in your map may be caused by the spell being coded ineffectively or too many effects are used or the loop interval is too small etc. That is why it only lags when that flawed code is executed.

Leaks won't cause a fatal error unless the computer is too weak that it can't handle that much memory leaks (which is unlikely these days).
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
So if my spell is not MUI or MPI but all the leaks are cleaned is that INEFFECIENT CODING?..

Efficient coding is more than just being leakfree. Efficient coding is about choosing what is the best approach for an issue. For example, GUI is inefficient comparing to JASS so coding in GUI is itself being inefficient. Or like a certain guy here always mention, repeated function calls (Thou shalt store anything you used twice or more into a variable) are inefficient. Indexing non-dynamically is also inefficient, etc.

But don't mind it too much though. It is your map after all :)
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
@Doomlord
i guess u were quoting me ? lol

Well yes indeed I do ^^

Just a thing.

I see you post this a lot. I might not be completely true. I'd rather say "thrice or more" if a clear limit would have to be set.

For example in jass, you would have to declare a local variable and then possibly null it, so the speed difference decreases.

In GUI that could result in using more variables than needed to give one example.
 
Status
Not open for further replies.
Top