• 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.

Are triggers any faster when converted?

Status
Not open for further replies.
Level 6
Joined
Jan 12, 2011
Messages
110
I want to ask pretty simple question but very important to me.
Are normal GUI triggers, when I convert them into custom text, faster, than when in GUI?

Why am I asking is, that my GUI triggers kind of lag the game, when they execute (mostly custom GUI abilities)... That's why I have to figure out, how to stop this lags...

Thanks for your answers.

PS: If this is on the forum, I'm very sorry, but I haven't found it... Maybe wrong keywords. :)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I don't think they are faster, GUI is JASS but it has graphical interface(that's what GUI stands for actually), GUI unit - kill unit is actually at the same at speed and everything as call killunit(whichunit)(plain jass meh) because when you trigger using GUI you actually write it in JASS but the difference is you don't have to type it, the system types it for you.
Hope it helps
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Using natives instead of BJs helps, yea. But only converting does not make any difference since that is exactly what the worldeditor does when you save the map (warcraft cant read GUI).

But if you have heavy lags then you have a conceptual problem which wont be fixed by just replacing some BJs with Natives. Look for huge loops and periodic timers, also dont use abilities with 100+ levels and try to reduce doodad/unit count on the map.
 
Level 6
Joined
Jan 12, 2011
Messages
110
But if you have heavy lags then you have a conceptual problem which wont be fixed by just replacing some BJs with Natives. Look for huge loops and periodic timers, also dont use abilities with 100+ levels and try to reduce doodad/unit count on the map.

I'm using abilities up to lvl 20 only. About the units, there are about 40 units on the map at the moment, and about 8k doodads. Maybe too much doodads problem?

in addition;
leaks leads to lag - maybe your map contains a ton of leaks?
computer ram/cpu - maybe your computer has low on these?
not preloading unit/abilities when created - lags at first

Well, I don't think it's the problem. I'm removing locations (saved into vars), UGs, etc. via custom commands. I wouldn't look for the problem here.


Does this only occur on the first cast of the spell ?
After the first cast, if you re-cast it again, it will not lag, right ?

Honestly, I can't say for sure... When I'm testing the map alone, the lag appears only for the first time, but when I tested the map with my friend (LAN), it lagged everytime the spell was cast. But the spell works normally for any player, just lags a bit.
Does this mean, that it's badly triggered?


And also, I've got another problem (related to main post)... I'm using ability (different to first mentioned one), that adds ability to all allied units around it (kind of a buff), and then they use it immediately, then the ability is removed (but the buff still remains, which is the purpose)... Well, the problem is, the lag occurs here too. Any ideas, how to make this work without lag?...
If needed, I'll post the trigger I use for this.

PS: And since I've got 8GB of RAM, and 4-core CPU at 3.2GHz, I wouldn't search for the problem here too.
 
Last edited:
Level 14
Joined
Jun 27, 2008
Messages
1,325
Leaks are not the problem. They can cause lags, but it takes sime time till you used up enough handleids that you can notice it. For instance a map with 1 million leaking locations is still playable and if you are anywhere close to leak-free there is no way you reach that in less then a minute.

8k Doodads are absolutely no problem, at least not if you dont have a stone-age graphics card.

If its one specific spell that lags, why dont you just post the code? Then we maybe find something...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I believe if you have a spell that have 5 levels and above, you should preload it.
Okay, here's how to preload spells;
  • Preloading Spells
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempLoc = (Center of (Playable map area))
      • Unit - Create 1 Footman for Player 1 (Red) at TempLoc facing Default building facing degrees
      • -------- ADD ALL ABILITIIES THAT HAVE 5 LEVELS AND ABOVE --------
      • Unit - Add Ability A to (Last created unit)
      • Unit - Add Ability B to (Last created unit)
      • Unit - Add Ability C to (Last created unit)
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 6
Joined
Jan 12, 2011
Messages
110
I believe if you have a spell that have 5 levels and above, you should preload it.
Okay, here's how to preload spells;
  • Preloading Spells
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempLoc = (Center of (Playable map area))
      • Unit - Create 1 Footman for Player 1 (Red) at TempLoc facing Default building facing degrees
      • -------- ADD ALL ABILITIIES THAT HAVE 5 LEVELS AND ABOVE --------
      • Unit - Add Ability A to (Last created unit)
      • Unit - Add Ability B to (Last created unit)
      • Unit - Add Ability C to (Last created unit)
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation(udg_TempLoc)


Thanks a lot, this should come in handy.
Do I need him to use the abilities, or this is just well-enough?
 
Status
Not open for further replies.
Top