• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Will this Cause the system run slower?? (need profesional advise)

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
Compare the two solution:

Solution 1
  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability 1
    • Actions
      • Unit - doing something
  • Trigger 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability 2
    • Actions
      • Unit - doing something
Solution 2
  • Trigger 1
  • Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ability 1
        • Then - Actions
          • Unit - Do Something
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ability 2
        • Then - Actions
          • Unit - Do Something
        • Else - Actions


Will Second solution Cause the system run slower or make lag noise or what negative???
 
Level 8
Joined
Feb 20, 2007
Messages
338
Depends on what the trigger has the unit do.

There is this many page sticky: http://www.hiveworkshop.com/forums/f269/things-leak-35124/

Things that leak covers a lot of ground.

Things that make your computer lag is number of objects (doodads, destructibles, units, blah) on the map, or things that leak, or just having too many things happening all at once say 50 triggers firing at the same time.

Periodic events that check every second are ok if you have only one or two, if you have several then the computer starts to slow down especially if you are actually doing things like creating units, moving units, blah every second.

Objects: the simple flower model, in itself it is a simple clean model, one or two in the camera field has no impact on the speed of the computer, spam the area with a field of flowers and try the game, suddenly its running slower. the greater the camera distance, or the more objects you have in the camera the slower the computer will go - mind its 'drawing' all of those objects graphically the more polygons in a model the more computing speed it needs. WCIII is composed of low poly, medium resolution models to save graphics rendering power of your average computer system.

As for your triggers in and of themselves they will take about the same amount of processor speed/power to be completed. However it is usually best done with If/then/Else functions simply to keep your menu bar neat and tidy and make it easy for you, the designer/editor to keep track of things.
 
Level 5
Joined
Jan 25, 2006
Messages
103
Both are fine, i find games to have lag only when massive amounts of data are used, for example creating many units at dozens of locations who have beyond 100.000 HP.
Or when using periodic events for adding massive amounts units, events, etc...
Otherwise WC3 engine for an old one is pretty robust and PC's these days pack massive power to deal with any amount of memory leaking.
 
Both are fine, i find games to have lag only when massive amounts of data are used, for example creating many units at dozens of locations who have beyond 100.000 HP.
Or when using periodic events for adding massive amounts units, events, etc...
Otherwise WC3 engine for an old one is pretty robust and PC's these days pack massive power to deal with any amount of memory leaking.
Oh, you are very much mistaken. A few leaked locations in a trigger that runs every 0.01 seconds will cause your computer to grind to a halt after just a few minutes...
 
Level 11
Joined
Oct 20, 2007
Messages
342
haha, ty for advise
and don't out of topic xD
i m talking about combine many trigger with same event into a trigger
and not about memory leak or what the action does....

thx anyway ~~
i conclude it as both work find but 2nd solution is not so approbate by everyone
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
A quick improvement:
  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ability 1
        • Then - Actions
          • Unit - Do Something
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Ability 2
            • Then - Actions
              • Unit - Do Something
            • Else - Actions
Otherwise even if it the first spell that was casted, the trigger would check if it is the second one.

Anyway, it doesn't matter, both ways would be equally complex having to linearly serch for the proper code. But it kinda depends of the actuall CPU, as modern day CPUs cache the code before executing it, for better performance. And the "if" statement causes it to miss a part of that code, forcing it to dump some of the cached code, and then cache other code and execute it. Because of that it would be more efficient to use the first method, but it is totally dependant on the kind of cpu and amount of code in each "If".
 
Level 2
Joined
Jan 10, 2009
Messages
30
The only thing that can lagg your map or w/e, is for example:

Unit - create 10000 footmen for (Player 1 (Red)) at Random point in Playable map

Mostly, only things placed ON the map will lagg...
 
Status
Not open for further replies.
Top