What are the most common causes of lag and slow downs?

0 favourites
  • 13 posts
From the Asset Store
Make your horror game even more Scary with sound effects! :)
  • I'd like to know what the most leading causes of lag are. Any info would be appreciated. Also when i preview a game through nw.js, the loading times are tremendously long. i can feel my self losing a lot of patience while i wait. Do slow downs have anything to do with the computer's graphical capabilities? I just got a new computer with a Geforce GTX 850m and was hoping the lag i was experiencing with my last computer would be gone. This isn't the case though :/

  • Try adjusting these to test:

    Too many effects

    Too many objects/collisions

    Too high resolution

    If all else fails:

    Your hardware device

    Your logic

  • 3 Important reasons:

    1- Too many objects which contain JSON data, each JSON data may have a lot of properties such as X, Y, Size, Frames, Layer, Instance Variables, Behavior, etc. the system cannot handle a lot of data in memory to run with 60 fps.

    2- Misuse of loop and effects, sometimes they cause setting values in chaos way may affect CPU and GPU usage that leads the slowdown due to proccesing capabilities.

    3- Resolution and Fill-rate, as GPU is often limited by fill-rate, even every pixel can be seen as a cost. When framebuffer is filled with pixels to be drawn, you might see that the game runs faster at lower resolutions. However, screen resolutions typically tend to go hand-in-hand with the capabilities offered by GPU. Typically, one of the common source of performance problems is coming from too intensive pixel writing.

  • I am not expert and I have not released any games

    But from my own tests I have found that for-loops that move sets of sprites are the biggest slow down.

    The profile debugger tab (I think it is profile?) is good for seeing where the cpu load is going.

    pure logic for-loops are fast and moving individual sprites is fast

    but something like

    for each of (20 sprite instances) move to (calculate move to point) etc etc

    seems to take a big chunk of CPU and can cause slow down (on mobile at least).

    However, whatever I do on whatever platform, on whatever game, I still always get jank during the first 30 seconds after launching though it does go away after .....(if anyone has any ideas on eliminating this I am all ears...)

  • im started to use C2 and follow justtt a bitttt of super mario bros tutorial on youtube. I successfully setting my character(one) and one ground. Its fairly quick to setup in C2 but when previewing in browser its lag a lot, pause when moving, pause during jumping.

    My machine is Amd X4 860k, Nvidia 550Ti,16GB on Windows 10.I do have other i7 machine but not worth trying since its only two sprite.

    Do i need tweaking at this stage?

    Thanks

  • Sprites and music files that are large will slow down load times.

    After you finish a project go back and remove any sprites and sound/music files that you did not use.

    Keep images and music files as small as possible.

    I am having to crunch my Platform Builder and remove some stuff now to get it to upload to the arcade. I always have lots of sound effects, music and sprites I did not use in the project I can clean out before compressing.

    Your game may start playing before the engine has fully loaded and processed everything so if it gets hung up on a big sprite or music file it can cause lags. Sprites with lots of animations also cause lag.

    ADDED: I had 10 long play background music files. Download was over 84MB. I cut that down to just 3 shorter music files and got rid of unused sprites and trimmed out a layout and that cut the download to 35MB. Those music files really add to the MB of a game and slow down your load times.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try not to get confused between download size and runtime performance. The two do not directly affect each other. For example a large music track will increase the download size, but should have no impact at runtime at all.

  • Try not to get confused between download size and runtime performance. The two do not directly affect each other. For example a large music track will increase the download size, but should have no impact at runtime at all.

    Well, I have a sand box game that had 10 large background music files. The game would load and start but lag terribly and sprites would stop moving for a few seconds when ever I started the game even with no music playing. I took out those music files and sprites stopped lagging.

    So there must be some processing of music files going on either in the engine or browser that was causing the lag?

    I add in a pause on games with music files now to let them fully load and process before the game screen starts to avoid the user seeing the lag.

    If there is some other cause I would be interested in knowing what it is?

  • Well, I have a sand box game that had 10 large background music files. The game would load and start but lag terribly and sprites would stop moving for a few seconds when ever I started the game even with no music playing. I took out those music files and sprites stopped lagging.

    There's no technical reason for that, because the engine doesn't touch music files unless you tell it to preload/play them. I'd be interested to see an example of that if you can make one. I would assume the problem was really caused by something else though.

  • Turns out that if i tweak some things in the Nvidia Control panel to gear towards C2 and Nwjs, they will Run almost perfectly. Heres the problem, if i unplug the Power Adapter from my laptop it will go right back to good ol' 2 fps. Plug it back in and immediately its running smooth 60 again. Any Idea what this is about?

  • Turns out that if i tweak some things in the Nvidia Control panel to gear towards C2 and Nwjs, they will Run almost perfectly. Heres the problem, if i unplug the Power Adapter from my laptop it will go right back to good ol' 2 fps. Plug it back in and immediately its running smooth 60 again. Any Idea what this is about?

    My guess would be that your laptop switches to the integrated GPU when you are on battery power. Try setting it in the Nvidia control panel. Look for something like "Setting application performance" and "Power saver" (I don't know what terms the Nvidia CP uses).

  • Whooo lag :D

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