[Solved] Problems regarding lag=Firefox and browser prob.

0 favourites
From the Asset Store
This is a single chapter from the Construct Starter Kit Collection and the Student Workbook from the Workshop.
  • Update: Solved on page 3.

    I have been working on a game for about 2 weeks now, the last week being quite intensive.

    The game uses 16.2 mb memory, has 98 events and its approximate download is 1.3 mb in size.

    The resolution is 1200x800 in landscape mode. The sprites/graphics are done in a 1 to 1 ratio, because I thought that changing them from to the power of 2 would solve the problems but it did not.

    Scaling is turned off, but I did try with 'scale inner' - no difference.

    My graphics drivers are up to date and I have a Geforce GTX 960 with 16 ram and a multithreaded procesor.

    The game wasnt running smooth throughtout but I thought to myself that its my computers fault, and testing it on other machines will prove that. It didnt turn out quite that way unfortunately.

    Now Im having performance issues regarding scrolling items (as it is a type of infinite runner game), they arent scrolling smoothly enough and are lagging somewhat

    from time to time, even so slightly sometimes but that does make a difference.

    I have tested the CapX file on 3 different computers and the results are somewhat simillar, unsmooth slightly jittery scrolling and movement.

    There is one background and several items scrolling from side to side once they are spawned outside the screen (at max there are 20 sprites of 1 instance about 30x30 pixels in size, and 2 insances of another, and 2 x 1 instance of some seperate sprite. I have tried turning those off but no luck there).

    I am destroying the items once they leave the screen so that is not the issue.

    I have *dt everywhere in the values.

    I have tried to test it, and have turned off certain sprites, and the background too and the effect is the same.

    I am wondering if the problem lays withing the file itself because there is a wierd glitch where I cant change the preview browser(it just doesnt respond, other time doesnt see the installed web browser - but it is there for sure. I even tried reinstalling the browser but that did not work either), which happened on the other 2 computers as well.

    I am attaching an empty capx file, the one that I used for my game but have cleared almost all data. Just open it and try to preview the file in a different browsers; start with Firefox, then Opera and Internet Explorer (scroll down for link to file).

    I have set different browsers to default browsers to no avail too. I tried to reinstall Construct 2 as well but that did not help either.

    In one last act of desperation, tomorrow Im going to try to create a part of the game in a entirely new file, and see how it goes there.

    If this doesnt work Im going to call it quits unfortunately, as I came to really enjoy Construct 2 and its event sheets. But focusing on such issues drains my patience and creativity so that I have no more energy to focus on the gamey side of things, even so I have been trying to troubleshoot this issue for quite some time now.

    Will keep you all posted, any suggestions are welcome as always.

    Link to file:

    https://www.sendspace.com/file/nrsdso

    Also screen of problem:

    My other 2 threads regarding this issue:

    Bug section: viewtopic.php?f=151&t=165188&p=998445#p998445

    How do I section, with a very brief explanation: viewtopic.php?f=151&t=165188&p=998445#p998445

  • A couple hours down the line I created an empty scene with only 2 boxes moving on the screen both with wrap behaviour.

    One is moving using bullet behaviour and the other self.x + x * dt behaviour.

    Now what I find is that every second the boxes lag and then go back to smooth movement.

    So its something like this:

    Moving smoothly....1 seconds passes, a quick jerk then - moving smoothly....1 seconds passes, a quick jerk then - moving smoothly.... etc.

    So its smooth movement until the 1 second mark is passed, then a sharp jerk for some miliseconds, then it all repeats.

    Additionally when any help bubbles appear around my desktop, the boxes start to lag more...

    Could someone take a look at my Capx file below and see if its only me that is having such issues? Thanks.

    https://www.sendspace.com/file/fvhk8a

  • Update:

    Installed Chrome, managed to preview the scene with 2 boxes (attached above), this time tried different resolutions (testing with scaling turned off):

    (Cpu utilisation: under 1 percent)

    Resolution: 1280x800 px -----> 37-39 FPS in debug mode - very choppy

    Resolution: 1440x900 px -----> 60 FPS in debug mode - No lag, seems that Im on to something (but I dont want to work or view the game in this resolution as its blurry)

    Resolution: 1680x1050 px ---> 58-59 FPS in debug mode - Overall smooth, every time 1 second mark is passed there is a jitter/quick lag

    Resolution: 1920x1200 px ---> 59 FPS in debug mode - Overall smooth, every time 1 second mark is passed there is a jitter/quick lag (same as above), really really annoying!

    Is html5 really so fussy about resolutions? Am I doing something wrong? Is it a problem with my video card (which is new, only less than a year old, and has up-to-date drivers), or does the problem lie within Windows 7?

    Any ideas?

  • I've tried both of your capx without a big problem. The preview in different browser works. I have only sometimes the problem that the browser not comes up into foreground.

    I do have the lagging problem, but only in the beginning, after a few seconds it mostly works without problem. What I recognize is, that the browser seems to be sensitive against other program starts or clicking intensive with the mouse. You could look at the Task-Manager if there is any program what start uses CPU-Usage when the lagging appears.

  • Asmodean

    Thanks for responding. Regarding CPU-usage in the Task Manager, it is 1% (multi threaded procesors).

    The lagging, do you have it with other capx files too? Or only this one?

    What Im wondering is, if I purchase the full version will I be able to export to windows in another way than html5? This is a deal braker for me, because if yes I will buy Construct today.

    UPDATE 01:

    I have done the following:

    1) Formated the computer.

    2) Installed new fresh Windows 7 64 bit.

    3) Installed all the up-to-date drivers for all the components, including graphics card.

    4) Updated bios.

    5) Installed Construct 2 and Firefox, nothing else.

    6) Ran the example that Ive posted here (uploaded above).

    Still the lagging problem persists. I am having issues like I mentioned above with the example I uploaded, the two boxes moving.

    I can rule out:

    1) Windows

    2) Graphic drivers

    3) Full hard-drive

    I read somewhere that there has to be a problem with the hardware somewhere, or perphaps a driver, Im not sure. But regarding drivers, there are no errors in the Device Manager under the Windows Control Panel. Same goes for hardware, no errors, nothing.

    Im not sure how to go about it at the moment. Any insight would be great.

    UPDATE 02:

    I have installed Opera, and still I cant open the file in Opera, same error.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for responding. Regarding CPU-usage in the Task Manager, it is 1% (multi threaded procesors).

    The lagging, do you have it with other capx files too? Or only this one?

    What Im wondering is, if I purchase the full version will I be able to export to windows in another way than html5? This is a deal braker for me, because if yes I will buy Construct today.

    I have the lagging also with other capx. The more complex, more often I see micro stuttering in the beginning, but it is only for a few seconds and I think that it's because of loading of the assets without preloading. I see it only when I start direct with the layout where movement is.

    Every export with construct based on html5, if you have the full version you can export to nw.js that wrapped your game direct in a chromium-based browser. So you have a direct runnable game without browser.

    [quote:2v9iurrd]

    UPDATE:

    I have done the following:

    1) Formated the computer.

    2) Installed new fresh Windows 7 64 bit.

    3) Installed all the up-to-date drivers for all the components, including graphics card.

    4) Updated bios.

    5) Installed Construct 2 and Firefox, nothing else.

    6) Ran the example that Ive posted here (uploaded above).

    Still the lagging problem persists. I am having issues like I mentioned above with the example I uploaded, the two boxes moving.

    I can rule out:

    1) Windows

    2) Graphic drivers

    3) Full hard-drive

    I read somewhere that there has to be a problem with the hardware somewhere, or perphaps a driver, Im not sure. But regarding drivers, there are no errors in the Device Manager under the Windows Control Panel. Same goes for hardware, no errors, nothing.

    Im not sure how to go about it at the moment. Any insight would be great.

    [quote:2v9iurrd]5) Installed Construct 2 and Firefox, nothing else.

    Not any antivirus software in the background or plugins?

    Do you have the lagging with games from the arcade or any other scrolling game?

    Have you tried it in fullscreen? (F11 in Browser)

    What Graphiccard do you have? Can it be that the newest driver has a problem with micro stuttering? (Do you google it)? Could it be a problem with the vsync in you driver?

  • Asmodean

    Once again thanks for taking the time to respond, I really appreciate it.

    Turning off the antivirus in the background does not make a difference.

    My graphics card is a Geforce960. I am looking into micro stuttering and vsync as you suggested (I did have tearing in the past) but Im not sure this is the case in this situation.

    The issue is that every second (or 60 frames) the smooth movement of a moving sprite is interupted with a micro stutter (I think I can call it that as to your previous post).

    As you might imagine this is really annoying and makes for testing games more difficult as Im wont be sure if its the micro stuttering causing lag or simply too much data in my game.

    I do have the same lag in games here on Scirra in the arcade section, so that shows that is not only when I preview my game.

    As for the vsync problem in my card, the vsync is turned off at the moment and I dont see any tearing but I still do see the micro stutters. I need to do some more research, in the meantime any more suggestions are very welcome.

    Thanks.

  • [quote:15e6mb7e]

    Once again thanks for taking the time to respond, I really appreciate it.

    No problem, what me really baffles is that after you set up all new the problems still exists, even the problem with the browser selection. I wonder if this is the same cause or a complete other. That means we could exclude 3rd party software. It remains a hardware problem, windows itself or windows driver.

    Do you have installed Windows, Construct and the Browsers all on drive C or some exotic drive like J or Y?

    Maybe this could cause a problem in finding the browsers.

    [quote:15e6mb7e]

    My graphics card is a Geforce960. I am looking into micro stuttering and vsync as you suggested (I did have tearing in the past) but Im not sure this is the case in this situation.

    The issue is that every second (or 60 frames) the smooth movement of a moving sprite is interupted with a micro stutter (I think I can call it that as to your previous post).

    As you might imagine this is really annoying and makes for testing games more difficult as Im wont be sure if its the micro stuttering causing lag or simply too much data in my game.

    I really understand that is annoying and a big problem for you.

    Can you test your box capx again in firefox and this time press F12. Now the WebConsole from FireFox should be shown. There should be a Performance-tab on the top of the webconsole-window and a little double window icon(show in own window) on the right (second last before the x).

    While your capx is previewed in FireFox with WebConsole open. Click the performance-tab, now there should be a record button, click it and wait that the stuttering appears several times. Now stop the record and click on the second icon from the right to show the result in its own window(maximize the window).

    You should now see the stuttering in the graph above. There is a millisecond scale on the graph, look the time where it stutter and now scroll down, on the left side you should see what happens to the time a little yellow or red square is on the time scale. With a little luck you see the culprit.

    In my example you can see one stutter at ca. 4800ms and the culprit is the garbage collection shown below.

  • [quote:3g2vd14b]Do you have installed Windows, Construct and the Browsers all on drive C or some exotic drive like J or Y?

    Maybe this could cause a problem in finding the browsers.

    Nope, Ive installed everything on a C:\ drive. Ive got a 2GB hard drive without any partitions, and clean after the format (well now it has some hardware testing utilities as I have been testing the temperature of my graphics card and processors, as well as the fans whether they are working or not and all is ok in this matter).

    I have done as you suggested but still cant figure out much from the graph?

  • Ive created another one, this one seems more busy and I even did not do anything to keep my computer busy.

  • Just responding to say, it isn't just you..

    I can only test on my low end tablet, but when fps drops under 60 the stutter is there for both the dt object and the bullet-behaviour object..

    After a few seconds the game runs on 60fps and the stutter is gone..

  • LittleStain

    Yes, but on my end once the worst part at the beginning is over, every second I have a stutter...

  • LittleStain

    Yes that is normal, but you can see in the second picture of the performance graph that something frequently bothers the javascript task and I don't think that is a normal behavior.

    Solomon

    I'm not an expert in this and all I do is guesswork. I think there is one task/process that bothers the browser, but I could be totally wrong.

    Can you try to start the capx in FF again without webconsole, then start the task-manager put it in front of your playing capx in FireFox. activate 'show process from all users' click on the CPU-tab that the little arrow points down.

    Now wait if you see a stutter, in this moment or a little before a new process could show up for a short time.

    Is something like this happens?

  • I did as you instructed, pulled up the task manager and set the highest usage of the procesor descending from top, to see if there is something that pops up.

    The 99% at the top is idle (in Polish language).

    I did find something but it is not in sync with the lags I am getting. Firefox is jumping places every now and then, swapping for into second place, but I guess that its because it is using the 1% of processor power and the rest is using 0.

    Do you think that is relevant?

  • That looks not suspicious at all. That the CPU-Usage of FF varied is normal but I see Window-Update, that could cause problems even without high CPU-Usage.

    I've run out of ideas, what you could else try:

    No internet access. Turn your Internet access off

    Wait until all windows updates are installed.

    You could try with a non browser 2D scrolling game if you have the same stuttering (I recommend Hydorah http://www.locomalito.com/hydorah.php (80MB slow server)) and if Videos on YT with the html5-player stutter.

    Boot your PC complete without all extern plugin Devices (USB) (except Mouse and Keyboard) even Lan-Cable or WLAN-Adapter. If you have build in WLAN turn it off.

    And last try Windows in Safe Mode that should all turn off, even drivers.

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