• 🏆 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!

why does this leak

Status
Not open for further replies.
Level 12
Joined
Mar 21, 2008
Messages
358
why does this leak (or so i think it leaks)? when the spell is casted a couple of times my fps drops down to like 5...

  • lacerate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lacerate (Sword)
    • Actions
      • Set temp_loc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Set temp_loc2[(Player number of (Owner of (Triggering unit)))] = (temp_loc[(Player number of (Owner of (Triggering unit)))] offset by 150.00 towards (Facing of (Triggering unit)) degrees)
      • Set temp_unitgroup[(Player number of (Owner of (Triggering unit)))] = (Units within 130.00 of temp_loc2[(Player number of (Owner of (Triggering unit)))])
      • Unit Group - Pick every unit in temp_unitgroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 100.00 damage of attack type Normal and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_temp_loc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call RemoveLocation(udg_temp_loc2[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call DestroyGroup(udg_temp_unitgroup[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
edit:
ok, so apparently the trigger wasnt lagging the game. i disabled the trigger and cast the spell, and my fps began to drop anyway...
 
Last edited:
Level 6
Joined
May 7, 2009
Messages
228
By the way, almost all GUI triggers leak, and there is nothing you can do about that other then learning JASS. However, it isn't enough to cause problems unless you have a really long game or you use tons and tons of triggers constantly.

If it's lagging so quickly, it is probably something else, not a memory leak.
 
Level 8
Joined
Aug 4, 2008
Messages
279
Storyyeller, u are wrong, we CAN remove leaks in GUI, but not 100%, we can remove 70% of leaks in GUI and 90% in JASS.
As Azeroc said, every instant spell, doesnt need variables array,
I dunno why this is lagging to you, theres nothing wrong with it.
 
Level 6
Joined
May 7, 2009
Messages
228
Ok, I should have been more specific.

Almost all GUI triggers made by the average person leak. If you are careful, you can avoid many leaks, but there are still some things it is impossible to do in GUI without leaking.
 
Level 8
Joined
Aug 4, 2006
Messages
357
why does your trigger slow your fps?
i think the problem may be the unit group. i am not completely sure how blizzard finds all the units in a certain range of a point, but i am pretty sure they have to loop through all the units on the map and compare each of their positions with the position of the point. if you have a ton of units on your map, the line
  • Set temp_unitgroup[(Player number of (Owner of (Triggering unit)))] = (Units within 130.00 of temp_loc2[(Player number of (Owner of (Triggering unit)))])
may be what is causing the lag.
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
Well remove the arrays plz, it is instant so it is 100% MUI.

Also your spell does not leak at all, however maybe the special effects for this ability are very big.

Also about GUI, if you remove leaks it will be 99% leakless and JASS 99% leakless, but GUI problem it isn't efficient it uses codes that has to be converted again ingame, thus making it very slow, JASS uses the natives directly this is what makes JASS more efficient...

JASS efficiency = 90/100
GUI efficiency = 45/100
vJASS = 100/100

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

But still GUI is very efficient, also you don't need that 35 point to make it as efficient as JASS.

JASS is only used in BIG games, RPG, Campaign to make them more faster, so the loading time and the effects more faster, considering there are tons of units JASS would be helpfull.

GUI can be used in EVERY KIND OF GAME --- DOTA, GOTA. EOTA, SMOTA, Ages of Myth but that would probaly coz lag in ages of myth lol.

Anyway to conclude the diffrence in efficiency you cannot see it until there are many units and a very very big map, then you will see it.

Still GUI MUI RULES !!!
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
RMX: You are kinda wrong there,, vJASS is no more efficient than normal JASS, it just organizes your code, and gives you an easier way to code. The code will not become more efficient because it is vJASS,,
 
Level 6
Joined
May 7, 2009
Messages
228
JASS is only used in BIG games, RPG, Campaign to make them more faster, so the loading time and the effects more faster, considering there are tons of units JASS would be helpfull.

JASS is used by any map maker who values their sanity whenever complex effects are required.
 
Level 6
Joined
Oct 4, 2008
Messages
263
vJASS cant do anything that JASS cant. it can make it easier to do those things, but vJASS is just an extension to JASS. what happens is that jasshelper takes your vJASS and transforms it into JASS. it might do those new things in an efficient way, but no more efficient than would normally be possible.

also, even if it did something new, it would still not be more efficient, only more flexible.
 
Status
Not open for further replies.
Top