C2 SDK Documentation incomplete!

If you have found a bug, or have a suggestion/comment then leave it here

Post » Fri Apr 29, 2016 6:03 pm

I'm not sure what your particular implementation of "delegates" means or does. However the main point of fast triggers is to avoid iterating every trigger of that type. Normally firing a trigger runs every associated trigger in the event sheet, but fast triggers pre-filter by the first parameter. So running a function does not have to check every "on function" event in the project only to pass on most of them because they have a different function name - it only iterates the "on function" events it knows have the right name to begin with. This prevents there being a performance overhead to the "call function" action proportional to the number of "on function" events in the project (which would make functions slower the more you used them). However it had a laundry list of caveats that I can't exactly remember, like it only looked at the first parameter, it had to be a string, it had to be constant (no expressions that cannot be calculated at edit-time), etc... basically all specifically geared towards the "on function" trigger. I don't know if it will work for any other plugin, or if the performance impact would be important.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Sat Apr 30, 2016 6:14 am

@rexrainbow I'm not sure if that's relevant to my question. What would doing that accomplish?
ImageImageImage
B
14
S
5
G
2
Posts: 22
Reputation: 2,151

Post » Sat Apr 30, 2016 6:27 am

@ashley Thanks for the details. There will be tons of triggering conditions in my plugin such as "on delegate invoked", "on function associated to delegate", etc. that are all recognized by one or two string names (function name and delegate name). I'll keep testing the flags to see what happens.

Just for clarification, a delegate would hold multiple function references (names) and on action "invoke delegate", the specified delegate (by name) would call all its containing functions through "c2_callFunction".

If used right, it could solve a lot of headaches with creating a customizable key mapping system.
ImageImageImage
B
14
S
5
G
2
Posts: 22
Reputation: 2,151

Post » Fri May 06, 2016 5:31 am

Ashley wrote:I'm not sure what your particular implementation of "delegates" means or does. However the main point of fast triggers is to avoid iterating every trigger of that type. Normally firing a trigger runs every associated trigger in the event sheet, but fast triggers pre-filter by the first parameter. So running a function does not have to check every "on function" event in the project only to pass on most of them because they have a different function name - it only iterates the "on function" events it knows have the right name to begin with. This prevents there being a performance overhead to the "call function" action proportional to the number of "on function" events in the project (which would make functions slower the more you used them).


I recall reading some forum post or article from years ago that claimed that the official function plugin suffered from this exact performance issue you talked about. I'm glad to see that you came up with a solution for it, though I think you should have it documented somewhere, to clear up misinformation about it.
B
54
S
19
G
13
Posts: 97
Reputation: 10,146

Previous

Return to Website Issues and Feedback

Who is online

Users browsing this forum: No registered users and 0 guests