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

How to Reduce create unit lag?

Status
Not open for further replies.
Level 10
Joined
Jul 22, 2007
Messages
261
  • Spawn 1
    • Events
      • Time - Every 12.50 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 5 Zombie Mob for Player 12 (Brown) at (Position of Corpse Pile 0002 <gen>) facing Default building facing degrees
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in (Units within 600.00 of (Position of Corpse Pile 0002 <gen>)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red))) of type Survivor)))
this is mine and its still lags with like 3 of them
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
What do you mean by lag... If you mean the game hangs for a second, then that is caused by making too many units at the same point and WC3 failing to displace them correctly.

Secondly that trigger will lag. . . late game atleast due to horriable leaks.

In my green circle TD I create units atmost 8 at a time, and always at locations where there should be no existing units.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
1.
  • Unit - Create 5 Zombie Mob for Player 12 (Brown) at (Position of Corpse Pile 0002 <gen>) facing Default building facing degrees
  • Unit Group - Pick every unit in (Units within 600.00 of (Position of Corpse Pile 0002 <gen>)) and do (Actions)
  • Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red))) of type Survivor)))
All those lines leak objects like locations and groups. If you want to reduce lag fix them.

2. Collision size only will help if the problem you suffer is physical wc3 LAG whereby the framerate drops to 0 momentarily. If it is pathing lag it should do near nothing next to make them more easilly pathable.

3. This will explain the lag if it is actual WC3 hanging, like I said, do not create 5 units at the same point, rather create 1 unit at that point constantly or create the 5 units at nearby but different points.

4. Do not spam, this is a serious place. Go to Something Else if you want a cookie.

5. There are 2 ways. The first way requires you to input the order string of spell (or base spell for custom ones) which works for most spells but some item only spells like the wand of illusion ability can not be used this way. Method 2 requires you to input the raw order ID, only aquirable via a selfmade debug function which displays it for the spell you want cast and doing this works on every order possiable. For both methods you have to make sure you run them with the correct order type inorder for them to work properly. Order types are targeting a point, targeting a widget (unit, item or destructable) and targeting no one (like thunder clap).
 
Level 8
Joined
Apr 6, 2009
Messages
254
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-memory-leaks-5889/

Here you can learn about leaks. Its about that you dont use variables at all, and dont destroy the location.

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/

Here you can learn about Variables.

And i think the lag is 99.99% of the massive leaks. Read the toturials. Hope they help.

EDIT:
4. Do not spam, this is a serious place. Go to Something Else if you want a cookie.
Just lolled :D:DD
 
Level 2
Joined
Sep 19, 2008
Messages
24
this is very similar with my problems, i guess the WC3 engine is worse enough to place created units in same X,Y position

does giving exact position (X,Y) for each created unit will reduce this lag?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
AI automatically casts custom spells as long as they normally cast the spell they were based on. Eg a stormbolt custom spell will be cast on enemy units, however a death pact custom spell will not. Trigger enhancing the spells does not affect their cast behaviour at all.
 
Status
Not open for further replies.
Top