Can anyone explain what's happening in the attached pic?

  • Group and Group2 are groups that i've placed inside triggered functions which in turn are inside the group 'm' which in turn is in group 'three=1'

    Why is group 'm' showing 0% and -30.2% self? Negative sign?

  • Pandy Without a CAPX its hard to fix it. I am guessing you have some sort of variable that is set to subtract 1 on a certain action. You may need to not allow it to go past 0. But without seeing the whole event sheet no way to know for sure.

  • I am guessing you have some sort of variable that is set to subtract 1 on a certain action. You may need to not allow it to go past 0.

    I don't think this is related at all.

    Pandy this might be a bug on the debug engine, try to reproduce it in a minimal capx and post a report. Or you can opt showing some screenshot of the group, or just attaching the capx will do as well so that others with idea can point out why is it like that.

  • DuckfaceNinja yea maybe it isn't, just taking wild guess, haha.

  • DuckfaceNinja

    Ok, will do.

    Can you clarify one thing for me please.

    Triggered functions take up cpu too as well ,right?

    For example. Enemy near player > call function("enemy slow")

    and on function("enemy slow") > enemy speed half and enemy fire rate half and etc etc .....

    Imagine that the function calls a lot of actions ,like 10 or so. This would make cpu usage high.

    My problem was that the cpu usage for functions in groups were barely showing 0.2%. That's why i put the group(GROUP and GROUP2) withing the triggered functions ,and then i got such high values and also the weird total group cpu usage.

    It's all irritating now, especially when i'm trying to make the project more efficient.

    Thanks for your input anyways, i'll upload a capx when i'm done with the days work.

  • Can you clarify one thing for me please.

    Triggered functions take up cpu too as well ,right?

    For example. Enemy near player > call function("enemy slow")

    and on function("enemy slow") > enemy speed half and enemy fire rate half and etc etc .....

    Imagine that the function calls a lot of actions ,like 10 or so. This would make cpu usage high.

    My problem was that the cpu usage for functions in groups were barely showing 0.2%. That's why i put the group(GROUP and GROUP2) withing the triggered functions ,and then i got such high values and also the weird total group cpu usage.

    I'm not sure about this, but I do have a single function with 97 action in 54 lines, no performance impact at all, so amount of action doesn't affect anything significant. This will have to do with what condition/action you're doing, what I know is a heavily nested loop can give a bit of hiccup if there's too much looping on object creation/destroy, there are other extreme cases as well.

  • DuckfaceNinja

    Yeah, i just realized my function calls another function which in turn calls itself. Group calls group2 which in turn calls itself. I guess there's where the issue is. Top of that it occurs for multiple objects.

    Function calling a function is kind of a nested loop, right? . Now i have to rework them argh.

    Thanks for the help.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Function calling a function is kind of a nested loop, right? . Now i have to rework them argh.

    That sounds like recursive functions. You have to be careful not to create infinite loop of function call, you need a way to exit the loop, it can lead to browser freeze and crash. I did an infinity loop before and I would say it's a bad practice at least for me.

  • My functions have to pick an object, so i guess it exits once it can't find any object under the picking conditions. I'm guessing recursive functions are still cpu heavy if you have a lot of objects that take part in the loop.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)