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

Model cause lag

Status
Not open for further replies.
Level 9
Joined
Dec 17, 2007
Messages
431
Hey, I have made lots of spells now, but this one really anoyes me. It's called firewall and look's awesome in-game.. BUT, it lags like hell, my fps starts on 60. When casted once, it drops to 50, second time casted, it drops to 40 and so on, untill it's at 5 fps and unplayable.. I could understand it if all these dummy unit's was in-game and in-view and alive at the same time.. But, the lag does not dissapear, not when the dummy's expiration timer is done, or if it's out of view. The lag just stay there :S Please help, what did I do wrong?

Here is the GUI:

  • FireWall
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
      • Unit - A unit owned by Player 2 (Blue) Begins casting an ability
      • Unit - A unit owned by Player 3 (Teal) Begins casting an ability
      • Unit - A unit owned by Player 4 (Purple) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Firewall (Shaman)
      • (Casting unit) Equal to Hero[(Player number of (Owner of (Casting unit)))]
    • Actions
      • -------- Set Variables --------
      • Set FireWall_Location = (Target point of ability being cast)
      • Set FireWall_Lenght = (Distance between (Position of (Casting unit)) and FireWall_Location)
      • Set FireWall_Angle = -30.00
      • -------- Create Units --------
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy (FireWall) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by FireWall_Lenght towards (FireWall_Angle + (Angle from (Position of (Casting unit)) to FireWall_Location)) degrees) facing (Position of (Triggering unit))
          • Unit - Set the custom value of (Last created unit) to (Level of Firewall (Shaman) for (Casting unit))
          • Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
          • Set FireWall_Angle = (FireWall_Angle + 7.50)
      • -------- Remove Leaks --------
      • Custom script: call RemoveLocation (udg_FireWall_Location)
 
Level 9
Joined
Dec 17, 2007
Messages
431
Yeah, I know.. I also fixed it already, but I doubt a single leak called one time can reduce fps with 15%

This is my new code:
  • FireWall
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
      • Unit - A unit owned by Player 2 (Blue) Begins casting an ability
      • Unit - A unit owned by Player 3 (Teal) Begins casting an ability
      • Unit - A unit owned by Player 4 (Purple) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Firewall (Shaman)
      • (Casting unit) Equal to Hero[(Player number of (Owner of (Casting unit)))]
    • Actions
      • -------- Set Variables --------
      • Set FireWall_Location_CastPnt = (Target point of ability being cast)
      • Set FireWall_Location_Caster = (Position of (Casting unit))
      • Set FireWall_Lenght = (Distance between FireWall_Location_Caster and FireWall_Location_CastPnt)
      • Set FireWall_Angle = -30.00
      • -------- Create Units --------
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy (FireWall) for (Owner of (Casting unit)) at (FireWall_Location_Caster offset by FireWall_Lenght towards (FireWall_Angle + (Angle from FireWall_Location_Caster to FireWall_Location_CastPnt)) degrees) facing (Position of (Casting unit))
          • Unit - Set the custom value of (Last created unit) to (Level of Firewall (Shaman) for (Casting unit))
          • Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
          • Set FireWall_Angle = (FireWall_Angle + 7.50)
      • -------- Remove Leaks --------
      • Custom script: call RemoveLocation (udg_FireWall_Location_CastPnt)
      • Custom script: call RemoveLocation (udg_FireWall_Location_Caster)
 
Level 9
Joined
Dec 17, 2007
Messages
431
This is really wierd, I modified everything for the unit(Dummy), model, movement type, EVERYTHING. And this still cause the exact same amout of lag :S

What can this be? There are no leaks left? The dummy is build of a footman, would it help any if I used some other unit insteed?

PLEASE, this is important. You can get the map if you like to see yourself, just ask.
 
Level 6
Joined
May 1, 2009
Messages
215
Hmm

Well firstly I just want to know what the point of this condition is:

(Casting unit) Equal to Hero[(Player number of (Owner of (Casting unit)))]

Is it just checking the casting unit is a hero? I don't really understand... it seems really redundant since only the players specified in the events can trigger this...

It may not be the spell that's lagging (since my skills a triggering tell me it's fine) but another trigger running along side?

Personally, by the way, I would change your events to "A Unit Casts a Spell" then do some multiple "OR" conditions listing the players that can cast this ability. I can't say if that would effect anything, but I never have more than 1 event for a trigger if I can help it.
 
Status
Not open for further replies.
Top