Performance Question

0 favourites
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • hi! so, i have many questions... if some of you samaritan can help me, i would apreciate it.

    1-what happens if i get my cpu usage to 100% does it start to lag?

    if so, i have a quad core phenom gaming CPU, wich i use to play BF4, you are telling me that javascript intentionally does not take full use of my CPU? why would that be a good thing?

    2- if you see my debbuger screen shot, i have 1700+ objects using 100mb of video, on my pc, (my game is being made for pc only)

    and 17000+ collision checks per second, on a 10000x10000 layout, is that too much? i mean, how much collision cheks is too much, i have done my best to make my game extremely optimized, but i still get lag here and there on my gaming pc, i just dont get it. and yes im using an old version of NW.js becuase the newest version are a mess.

    most of my objects are static, its a platformer, i dont even use physics, or many shaders, but still, im getting dissapointed with C2.

    and about the collision cells, i need some clarification, about the position of the events. how is this supposed to be done? ( see image) and would the cells still be used, if there is more than 1 overlapping condition?

  • It might not be "static" if a sprite has platform behavior. A "static" sprite might have no behavior.

  • BF4 is very well threaded, it will use up to 8 threads so fully using most CPUs.

    C2 is single threaded. 1/4 of your CPU is being used if you see 100% CPU usage.

  • Platformer behavior = lots of collision checks

    Lots of collision checks = high CPU usage

    1 core + JavaScript itself + browser issues = forget about too advanced games

  • ~800 col checks per tic isn't that high. It's definitely due to all the other AI and events.

    And yes, there's limitations. One needs to be very careful to optimize it. If the game is too complex in scope, best to use another engine with multi-threading support.

  • Multi-thread programming is not easy, it also need to separate logic very well into Independent parts.

  • What fps do you get outside of the debugger? (ie text object set text to fps) The debugger can't really be trusted to that regard sometimes.

    In my game, most of my layouts have over 2k objects with ~130mbs of memory used. Every enemy and play have the platform behavior and have over 50 events per enemy towards their behavior and I can keep an even 60 fps (+/- 5 for the very awful node-webkit jankiness). Granted, I have a high end i7 with a high end nvidia card, so not much can make this machine chug.

    Regarding the collision cells, the events should be layered with the overlapping on TOP, and then everything else as a subevent. I had that issue, too, for a while and then realized that switching it cut the collision checks down by a 1/4.

    Also, it's actually not C2's fault, it's the fact that C2 uses HTML5. It's HTML5 is creating all the limitations, not C2.

  • What does the debugger profile page show? It's cpu loading is less as well, so you'll see a more representative game play / frame rate - but most importantly you'll see what's eating up most of your cpu time. As long as you've broken your events into groups it'll be easy to identify what's using up the most cpu time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try the current r198 beta which has an optimization in rendering and the latest NW.js 12. I think you'll get much better performance at least concerning any jittering you might have.

    -EDIT- Also, Ashley just posted a blog post in response to your question about single core usage.

  • eli0s

    why is everyone saying that NW.js 12 is good? its horrible! take a look, this is with the exact same project!!

  • Colludium my AI its quite complex, so that what is taking most, im doing some optimizations right now.

    ome6a1717 i get 60 fps smooth with the old nodewebkit (the new one sucks and i think im stuck with it forever) but my pcs is powerful too, but that practice you are doing is very bad, why?? becuase your benchmark is your pc, and that means your game will be intended for pc as powerful as yours only, just becuase in my pc i get 60 fps, that does not mean that all people will have a pc like mine, so i need to understimate my game so it will work in less powerful pc's, you should try your game in less powerful pc's and you will notice that it does not run like you want.

    dont take your pc performance as the only benchmark to see if your game i well optimize.

  • Lunatrap

    This is my result on i7 2600, Radeon HD5870. Without debugger i got about 60 fps on PC (Chrome and NWjs), on galaxy s3 i got the 51-56, on note4 i got a smooth 60fps.

    My object count is less than you but my collisions check is higher. Maybe image memory usage ? Or some logic causes it ? I didn't use any is overlapping trick yet. Don't forget to disable collisions and animations on static sprites.

    This is basically a super mario platformer kind of game.

  • ome6a1717 i get 60 fps smooth with the old nodewebkit (the new one sucks and i think im stuck with it forever) but my pcs is powerful too, but that practice you are doing is very bad, why?? becuase your benchmark is your pc, and that means your game will be intended for pc as powerful as yours only, just becuase in my pc i get 60 fps, that does not mean that all people will have a pc like mine, so i need to understimate my game so it will work in less powerful pc's, you should try your game in less powerful pc's and you will notice that it does not run like you want.

    dont take your pc performance as the only benchmark to see if your game i well optimize.

    This is very true, which is why I have friends that don't have my machine test my game. However, if MY machine can't obtain 60 fps, something is certainly wrong.

  • eli0s

    why is everyone saying that NW.js 12 is good? its horrible! take a look, this is with the exact same project!!

    Yes, I saw this on the other topic and I am very surprised. I don't understand how or why on some machines the recent updates made things worse. In my case the improvement is dramatically for the best on a recent benchmark I made. On this particular example I don't experience any lag, jerkiness or frame rate inconsistencies.

    However, just to be on the safe side, before I replied with this post I visited my old post about the jerkiness in the movement and run the ridiculously simple capx I 'd made on that first post. I must say the results are not as smooth as I would have wished for.

  • tumira

    well, im consfused, my game is 1080p i guess that why it takes so much

    ome6a1717

    yeah, thats a goodpoint.

    eli0s

    i dont know why is that, but im very worried of getting stuck with 10.5 for the 2 years of the development of my game.

    i hope someday i will be able to update, is not on my part, becuase my debugger screenshots use the exact same project.

    its annoying.

    btw, your jet forest demo, was amazing

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