0 Favourites

confusing performance

  • Hey, I'm confused about something, check out this image, this is when launching my game:

    and this is after the game has been running for 10 mins, just standing still, stationary.

    I'm not sure if I'm reading this right, but I can't see what's adding to the event CPU% everything seems to increase maybe by 1 or 2 % which I can't figure out why yet, but that shouldn't constitute for a roughly 40% increase.

    In the scene, there's under 1000 objects but I'd say maybe 4 - 600 of them are physics objects using box2D

    I'm confused as to what could be causing the gradual increase in consumption. I have a few 'repeat x number of times' at the start of layout but after that not much.

  • the 1 or 2 percent may not be that huge of a deal (perhaps even imprecision leading to that), but the cluster main group is what takes a big hit it seems, I wonder what this group is doing.

  • Aphrodite

    Yeah I can't really figure it out, this is what's happening in the cluster main group:

  • Its primarily the "On collision" under setup, try to disable that and let it run again. You shouldn't use "On collision" it is a performance killer

  • ah I think it was the asteroids overlapping asteroids, destroy asteroids event that was doing it actually, I'm now using only 15% CPU at the start, will leave it running and see what happens.

  • nimos100 - is overlapping better?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Yeah you should only use overlapping, never on collision. Did this test the other day. which compares the performance. Optimal you want to use "Is overlapping" and optimize it, that will give you the best performance.

  • If you're using On Collision, maybe try Trigger Only Once with it? I don't remember if that's possible, but triggering stuff only once always saves performance.

    heh, "ass_destroyer"

  • nimos100 - shit! wow so is overlapping and trigger once it is then.

    I'm still getting creeping performance, only less severe, I'll keep poking at it.

  • You will use some CPU so will never get to zero, I don't think trigger once, will help improve performance. When I say optimize, its to reduce the amount of collision checks that is needed. Trigger once will still do 60 checks per sec, but you can try to disable it and see if you get worse performance, but I would imagine that it would be the same,

    With optimization I mean you actively enable and disable collision on objects that there are no reason for C2 to check. For instant an asteroid not even near the player, there is no reason for C2 to check for collisions on that, so you could disable that, until it for instant is within a certain range of the player. Even though that will require more updating it will improve FPS. But it kind of depend on your program, how you can optimize it best I think.

  • If you're using On Collision, maybe try Trigger Only Once with it? I don't remember if that's possible, but triggering stuff only once always saves performance.

    heh, "ass_destroyer"

    That the whole problem with "On collision" you can't optimize it. It will trigger when there is a collision. So its like a "On created", "On destroyed" etc. That's why you should only use "Is overlapping". Something is just not very good in "On collision" but don't know what it is. But since its a trigger like "On created" I imagine that maybe C2 uses a lot of resources to constantly check whether it should trigger or not. But honestly its just a guess.

  • nimos100 - I get you, yeah that makes sense I'll go through an optimize that way, turning off collisions on sprites that are just for background art for example?

    I like the distant object off / on example, I wonder how it works with physics, what's the difference between collision properties and collision box 2d?

  • nimos100 - I get you, yeah that makes sense I'll go through an optimize that way, turning off collisions on sprites that are just for background art for example?

    I like the distant object off / on example, I wonder how it works with physics, what's the difference between collision properties and collision box 2d?

    You shouldn't spend time disable objects that doesn't require collision checks, that doesn't help. Only those that are involved in collisions.

    Im not sure about the physics, but if you can disable collision for those objects the same way as for normal objects, I can't see why you shouldn't get a performance increase, but I don't know the physics functionality that well, so you would have to check if that's the case or even possible.

  • I find no difference between On collision or Is Overlap.

    Ran through this battle () a few times with the different collision/overlap triggers. Similar checks per tick, cpu usage, etc.

    I normally only use On Collision because it triggers once by default and thats what I need most of the time.

    CrudeMik For physics, they can be disabled separately to the normal collision. There's two layer of collisions for objects with physics.

  • I find no difference between On collision or Is Overlap.

    That sounds weird, because there is no doubt when I test it that I get a huge difference in performance, do you have any data to show, that would be interesting to see?

    Like how many objects etc. would like to see that.

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