| 08-01-2008, 04:05 AM | #1 |
Okay so, sometime while I was AWOL dynamic triggers were decided to be the devil or some stupid thing, so I have a few questions in regards to this. 1) Are dynamic triggers bad? What issues do they cause and how can it be avoided. 2) I am trying to write some stuff for a buddy, he wants damage detection but as I recall, Vexorian said to me that Trigger Events leak....so is there a way to clear off events as units that they reference to die? If not then #1 is the biggy. Also, what other fun coding thingamjims have I missed in my time gone? |
| 08-01-2008, 07:54 AM | #2 |
events doesnt leak... the rest is relative and depends what you have on the map. but if you mean to use 1 trigger with alot of events so yes you will have problems with it. the most important thing... never use TriggerSleepAction() (PolledWait whatever). |
| 08-01-2008, 12:35 PM | #3 |
Oho, nice to see you back Chuck. You planning on war3'ing for a while or just a temp thing? For damage detection, perhaps check out Dusk's new one in the systems section. |
| 08-01-2008, 12:50 PM | #4 | |
Quote:
something stupid indeed, I suppose someone at sometime had a bug they could not place their finger on, so they blamed it on dynamic triggers - the rest is history |
| 08-01-2008, 02:20 PM | #5 |
You are free to use dynamic triggers, just don't use DestroyTrigger - that's the true culprit , err that would make your map leak, but since dynamic triggers are soo useful, they are worth the sacrifice... ... Err, I just noticed, dynamic triggers aren't even useful!, ouch. |
| 08-01-2008, 02:26 PM | #6 |
So how do you deal with the problem of having loads of events on a single trigger? Is it even a problem or inconsequential? |
| 08-01-2008, 02:29 PM | #7 |
It's not a problem. |
| 08-01-2008, 02:31 PM | #8 |
I think at the end of the day, dusk's damage system which uses only one trigger and adds all events to it, performs better than the other damage systems. The whole cleanup-the-trigger-when-the-unit-is-removed stuff just adds more overhead, you need more events detecting the dead and some sort of attaching, plus you have a whole trigger per unit. And that's about the only use left for dynamic triggers, everything else can be done without them and without a trigger that gets a lot of unit-specific events, it is crazy. What's worse is that the code without dynamic triggers is much simpler. Edit: What's worse memory-wise? An event per unit that has ever existed or a Trigger+Event+Condition/Action per unit that is currently existing? |
| 08-01-2008, 03:10 PM | #9 |
Could someone explain what is a dynamic trigger and what is the alternative? |
| 08-01-2008, 03:36 PM | #10 |
Check Vexorian's tutorial in the tutorial's section. I think it's called "Triggers in JASS" or something. |
| 08-01-2008, 03:42 PM | #11 |
Chucke_Brother: You can use my damage detection system, it's very simple to use, (simpler than Dusk's system): http://www.wc3campaigns.net/showthread.php?t=101600 |
| 08-01-2008, 04:45 PM | #12 |
I'd rather write my own as I have some very specific needs for it. Also, since I've been gone so long, what else is there that I need to know? I've read a lot of recycling timers/groups/etc, whats the issue here? I left about the time that vJass started getting popular, so the biggest question on my mind: How bad is the gamecache? Really bad or only slightly bad? |
| 08-01-2008, 04:48 PM | #13 |
Not bad, just that with the vJASS we've been able to develop alternate methods. |
| 08-01-2008, 07:56 PM | #14 |
Gamecache is innocent, but kind of slow. However... Using any kind of I2H function might mess up Warcraft's handle count. This means that any kind of GetStoredUnit(), GetStoredEffect(), GetStoredBLAH() is a danger to your map. You should only use the game cache for attaching integers (vJASS structs are integers). Now, there are better methods than game cache for doing that... =) I might as well use you as a test object for my new tutorial on advanced jassing ![]() Check out the part called "Attaching". http://www.wc3campaigns.net/showthread.php?p=1026573 |
