Where does the Lag come from?

0 favourites
  • 7 posts
  • Does lag in construct 2 reflect the amount of objects in a layout, or how big the layout is? is it just my computer?

    I see games like "The Next Penelope" having so much animation and so many active objects on screen at once and it all appears to run super smooth. I have no where near as much detail as that game(at least I don't think so). But whenever I export my platformer game through nw.js, it always seems to lag quite a bit, making it hard to time jumps and such. I love adding pieces of art to put more depth into my game and would really hate it if I had to remove much of it. (all of the pixel art is mine and mine alone except for the occasional red spring and boost pad.) Is it the amount of layers that causes the problem? I'm fairly new using construct 2, so when I try to look up discussions on the forums regarding lag, a lot of the things I read don't make much sense to me mainly because I don't understand their terminology. Despite this I'm really trying my best and want to know if anybody has tips or knowledge to share about lag and keeping your game running smooth. I'm making a platformer with classic sonic style physics. I'm not quite comfortable giving out a .capx file yet but in the mean time I have videos I recorded with bandicam that should help demonstrate how badly it lags in my nw.exe.

    [I use pixelmonkey's SonicPhysics Behavior add-on]

    -My game on nw.exe: https://drive.google.com/file/d/0B-5Wjs ... sp=sharing

    (^^^this video accurately shows the real-time lag when playing my nw.exe file on my computer)

    -My game in MS edge on the same computer: https://drive.google.com/file/d/0B-5Wjs ... sp=sharing

    (^^^Ms edge runs my game so smoothly compared to chrome and other browsers it actually pisses me off)

  • want to share your capx?

    You find some performance tips in the tutorial section

    here some points

    • Place objects using the same blend modes or effects on the same layer
    • make sure all those objects are placed on their own layer
    • Dont Changing Text objects every tick (specially large text objects)
    • Avoid large areas of overlap between objects
    • Avoid objects with large areas of transparency

    and of course it depends on the computer - but if you play other games that run smooth, then it's your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would spend some time using the profiler tab in debug to pinpoint where things are going wrong. My guess is it's actually caused by taxing the CPU--the profiler would confirm or deny this, of course. My guess is there are some events that are causing a lot of problems that may not really need to. See if your cpu utilization is crazy or anything before you worry about graphical overload.

  • The size of the layout or the number of layers won't cause lag. The engine is well optimized to handle such things. Thre problem is either in your objects or in your code. What C-7 suggested is a good idea. Based on your videos it's not a triggered problem, since it's happening from the beginning of your layout. Does your game lag in other browsers as well, not just with NW.js? Also, what C2 and NW.js version are you using?

  • ZephyrKing THX for showing a video

    [quote:2uygutdt]Ms edge runs my game so smoothly compared to chrome and other browsers it actually pisses me off

    That reminds me of some performance issues I posted before.

    C2 games have troubles on 2 of my 3 PC's.

    Here a lot of the time Edge runs smooth and Chrome or NW.js sucks

    You can try the performance test from Ashley to see how your PC tests

    http://www.scirra.com/demos/c2/sbperftest/

    Here it all depends on browser and the computer

    My gaming rig and the i3 laptop drop around 180 frames and score worse than a MotoX mobile

    The i5 laptop 0 drops

    W10 i3-5010U, 4GB Laptop - has some major issues with HTML - but otherwise a great and fast Laptop

    W10 i5-6500, 16GB, GTX960, SSD Workstation - has also some issues with HTML - otherwise perfect

    W10 i5-5200U, 8GB, SSD Laptop - no issues at all

    Still didn't figure out what is wrong with (especially on my Skylake workstation) - when I try a test like http://www.kevs3d.co.uk/dev/canvasmark/ my computers behave like they should.

  • Just to ask, regarding all of your curved tiles:

    Do you use a collision polygon with multiple points?

    How many points are on a curve usually?

    Roughly how many tiles are in the level that have these curved tiles?

  • Which version of NWj? Because 0.11 and 0.12 are notoriously bad for smooth frame rates.

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