Optimization suggestion?

0 favourites
  • 10 posts
  • Hello again.

    I am trying to optizime my events in many passes.

    I try to add repeated events into functions and so on.

    I have this block, there's a number of similar event blocks like these in my events:

    Where it examines in more than 1 direction to see if it get a hit.

    It may be 2 directions, it may be 4 directions as in the example, and I have a few with 9 directions.

    So X-1, X+1, Y-1, Y+1 etc.

    Are there any way to combine those into one single event line and pass over the coordinates properly?

    (I know, thinking is not my best side sometimes)

  • maybe if you put a variable that takes these values, you can put the variable inside the function assuming the value of that variable

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • We would need to see all the events to give an idea, this event looks like its indented a lot of times as a sub event. For example calling a function is not going to resolve anything if those events are running every tick.

  • Ok I see!

    Here's the entire nested events for those specific events.

    portions are deleted that is not part of those specific events.

    As you can see much of the nesting is because of groups (for my own clarity's sake).

    (and if curious, here's event 189 expanded:)

  • Is that all nested under the every 0.2 seconds? I can't really help with this it looks convoluted and I don't know what's going on. Maybe there is a simpler way to do what you want though.

  • Yes, it is under the 0.2 seconds.

    I know it is very hard to grasp.. Well, thank you for your attempt. it is probably easier to figure if you have the capx and game logics ready. Even then it is hard to get into!

  • Well I had a good look at it and I don't see any potential performance issues.

  • Ok!

    I moved the "ceil(random(BurnRate)) = 1" out from the Functions to be performed before the MapArray checks and the Function calls. Better to verify if it "time to burn this thing" before actually executing the events for those.

    I think it might be better that way. Not much difference, but maybe teeny tiny tiny bit.

  • Also I just noticed you are settin the fps to a text object every 0.2s which might not give good results so I hope you're not using that, again in the debug preview it shows the FPS.

  • Yeah, I am aware of it.. (that text object is not ideal)

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