HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Marrying Triggers; Effective?

12-31-2003, 03:34 AM#31
Stinky_Pooh
lol just to let u know TH15, i love ur map, and i do force close war3 before i leave the game...... it freaken crashes my 877mhz comp... if u get some1 to fix it it would be great lol, best aos i ever seen. Anyway i was wondering, do triggers with NO event take up extra checking space? if not my system is pretty good... i just make a trigger for each event i use more than once, and then call all possible triggers, with the conditions in the trigger called that has no event..... it works fine for me, just wondering if it is faster.
12-31-2003, 10:10 AM#32
RicFaith
Quote:
Originally posted by Stinky_Pooh
lol just to let u know TH15, i love ur map, and i do force close war3 before i leave the game...... it freaken crashes my 877mhz comp... if u get some1 to fix it it would be great lol, best aos i ever seen. Anyway i was wondering, do triggers with NO event take up extra checking space? if not my system is pretty good... i just make a trigger for each event i use more than once, and then call all possible triggers, with the conditions in the trigger called that has no event..... it works fine for me, just wondering if it is faster.


Yea I was wondering about that. If it were better that way then we just need to make a bunch of triggers with the different Events which will call all the different non-event triggers. If that's effective, then woohoo, I know what I'm doing next year :) literally :)

Cheers and Happy New Year~ It's abt 5 hrs to the new year over here...
12-31-2003, 04:29 PM#33
weaaddar
Triggers are just objects of memory that serve no real purpose if your not going to use events and conditions. The best answer is to copy the action function to the header of the map and just simply call it from there. Less trigger objects==less memory usage. Functions also should be minimalized so you'll want to make sure that repeat code (i.e. you always have an algorithim you use for all your spells to determine damage) should be given its own function.
As far as the guy asking about ifs
Code:
custom script: If (b) then
   ...
custom script: elseif (c) then
   ...
custom script: elseif (q) then
   ...
Use this method over anything else and use custom script on your conditional if statements because the way jass does this is pretty dumb. (it makes the boolean expression a function, but thats really wasteful)
12-31-2003, 06:45 PM#34
Stinky_Pooh
Quote:
Triggers are just objects of memory that serve no real purpose if your not going to use events and conditions.

ummm, i do have conditions, just no event, and i dont care about the memory, i care about the lag issues of haveing shitloads of events. and i nest the calls in if/elses, so after it finds the right one, it stops (using a bolean that switchs in the correct trigger)
12-31-2003, 07:08 PM#35
dataangel
Alright, I'm sick of all this pseudo-science when none of you can actually look at the war3 source.

Here is the ultimate counterexample to all this bullcrap: Battledome.

I haven't married any triggers at all, and it runs smooth. If your map is experiencing alot of lag, it's most likely because you have no idea how to do memory cleanup, i.e. DestroyGroup(), RemoveLocation(), etc. Groups, Locations, Special Effects, Floating Texts, ALL MUST BE DESTROYED UNLESS YOU WANT MEMORY LEAKS! If you do a unit group action, get a units location, do a polar projection, create special effect or a floating text, in a trigger that runs at least semi-often, then this is your problem.

I concede there are probably some random bugs out there in the war3 engine where certain specific combinations of events and crap can cause the game to lag. However, I'm also willing to bet the vast majority of you guys aren't cleaning up yer crap. Seeing as Battledome uses some of the most advanced triggers I know, has some of the wierdest and most obscure combinations of actions, conditions, and events, I should be experiencing these problems. But I'm not.

The one time recently I was told Battledome was generating obscene lag was because I forgot to delete a very frequently created group variable.
12-31-2003, 10:36 PM#36
Xinlitik
Well, I played Battledome recently and it lags like hell unless there are only 6-8 players. With 12, people will constantly lag till they finally drop. 10 a few will drop till it's 6-8.

P.S. That's with a Cable host.
12-31-2003, 11:35 PM#37
jmoritz
dataangel:
What you say is true: no noticable lag problems remain if people clean up. Problem is, the GUI uses hidden variables that it doesn't clean up. For most people, these pitfalls are not so easy to avoid.

weaaddar:
Yeah it entirely depends on the situation. Lately I've been doing more website work (loads of cash), and I tend to have all kinds of "unusual" situations, like IF blocks where you just can't decide if you want to nest them or not :)


BTW, What's this about points? Huh?
01-01-2004, 04:43 AM#38
Sen
I completely share dataangel's opinion on this matter, only I would have said it with more personal insults.

Read my post above for what I think about these optimizations that are really just obfuscating ****. And the reason you don't use these crap methods is NOT BECAUSE OTHER PEOPLE ARE GOING TO BE LOOKING AT YOUR CODE. It's so YOU CAN FINISH YOUR OWN DAMN MAP AND DEBUG IT.
01-01-2004, 04:44 AM#39
RicFaith
Quote:
Originally posted by dataangel
I haven't married any triggers at all, and it runs smooth. If your map is experiencing alot of lag, it's most likely because you have no idea how to do memory cleanup, i.e. DestroyGroup(), RemoveLocation(), etc. Groups, Locations, Special Effects, Floating Texts, ALL MUST BE DESTROYED UNLESS YOU WANT MEMORY LEAKS! If you do a unit group action, get a units location, do a polar projection, create special effect or a floating text, in a trigger that runs at least semi-often, then this is your problem.

Ok... so would it be possible to give a nice breakdown of the stuff we should do? I mean, I only just heard abt DestroyTrigger, and none of the destroy stuff are in the GUI, so we wouldn't know what we're looking for?

And perhaps specifically mention what are the bad memory leaks and what we as end-user programmers can do. I've read quite a few posts on mem leaks, but nothing much to say what exactly can be done. The only one thus far is the DestroyTrigger( ) which I've already started incorporating.
01-01-2004, 07:49 AM#40
dataangel
Quote:
Originally posted by Xinlitik
Well, I played Battledome recently and it lags like hell unless there are only 6-8 players. With 12, people will constantly lag till they finally drop. 10 a few will drop till it's 6-8.

P.S. That's with a Cable host.


Unfortunately, you'll have to be more specific. You might've downloaded the one with the group variable bug I mentioned. The last several versions have cleaned up alot of memory leaks.

Also, how many games do you play where 12 players continuously stay the whole game? I NEVER have. I don't think this is attributable to my map specifically -- usually a few people drop from custom games. Also, if people are dropping, that's network lag. Memory leaks would primarily be a performance issue (admittedly this could then lead to network lag, but I doubt it in this instance).

Quote:
Originally posted by jmoritz
dataangel:
What you say is true: no noticable lag problems remain if people clean up. Problem is, the GUI uses hidden variables that it doesn't clean up. For most people, these pitfalls are not so easy to avoid.

I understand that. My post was focused at those ignorant who call blizzard "crap programmers" and assume the war3 engine is flawed because their map lags. It would've been kind for Blizzard to include automattic garbage collecting -- and they do for the most common types (reals, integers, etc.). It also would've been nice for them to include the remove/destroy actions in the GUI. However, I suspect they decided not to include them because they thought it would just add confusion and most people would never experience the issues described in this thread. To these ignorant posters' credit, they are most likely creating maps more advanced than average. However, the solutions to these problems are frequently mentioned on these forums and on the bnet forums. They're not lieing in hidden tomes somewhere. Custom script actions make groups inparticular to cleanup, and the JASS vault has some xxxxMakeTemporary functions that can be used with a custom script action, so that one doesn't have to go to full blown JASS.

But I would urge all: learn JASS. You don't have to know every command, just learn the general concepts: variables, scope, functions, etc.

Quote:
Originally posted by RicFaith
Ok... so would it be possible to give a nice breakdown of the stuff we should do? I mean, I only just heard abt DestroyTrigger, and none of the destroy stuff are in the GUI, so we wouldn't know what we're looking for?

This has been brought up on the forums before. But I will go into a little detail here. I smell a tutorial somebody should write =)

Locations (called Points in the GUI), Unit Groups, Special Effects, and Floating Texts, are the most frequent causes of leaks. To create special effects that automatically delete themselves after a time, check this out:

http://kattana.users.whitehat.dk/viewfunc.php?id=32
http://kattana.users.whitehat.dk/viewfunc.php?id=31

If you put the code in those two urls in your maps custom script area, you can then use them as custom script actions in any trigger you like.

That's a start... too much detail will just confuse you guys more without screenshots if you're not very programming inclined. I'll ask Cubasis about getting somebody to write this, maybe I will if I have time.
01-01-2004, 07:29 PM#41
Xinlitik
Then may I suggest limiting it to 10 players?

Edit: Dont get the wrong drift.. I love your map. :)
01-02-2004, 03:23 AM#42
dataangel
Quote:
Originally posted by Xinlitik
Then may I suggest limiting it to 10 players?

Edit: Dont get the wrong drift.. I love your map. :)


Then may I suggest setting some slots to closed? If that's not too complicated for ya. :ggani:
01-02-2004, 07:57 AM#43
Xinlitik
That's what I do every time now... but why have 12 slots if it lags more than 8-10? Just seems illogical..
01-03-2004, 05:06 PM#44
Sen
So you're saying you want the decision taken away from the user? Why?
01-03-2004, 09:01 PM#45
Xinlitik
Because it's like those stupid AOL cds that give a month's worth of hours that must be used in a month. Illogically excessive. There's no way either of those situations are going to work out.