0 Favourites

Game performace decrease over time after NWjs export

  • My game is already on steam (Xenia) and some people tell me they get stuck after some time.

    It starts ok, but later the framerate might be lower and if the player dies, he has an increasing delay until respawn and later if he dies more times, eventually he doesnt respawn at all. The game is not frozen (the player can access the pause menu and exit the level) but the character stays at the last frame of the "death" animation.

    I know its not about how powerful each system is, because i have a Core2Quad with an rx 230 and the game works perfect from start to finish.

    Someone has an i7 with an nvidia 980 and the character gets stuck on "death" animation at lvl9.

    Ive tried "if load fail" trigger (in case it was not loading last savegame) but nothing triggered.

    The game is about 1200 events, no physics, i use about 20 times "every tick" and 10 time "for each" (if that matters), i use local storage to save lvls and C2 save/load for checkpoints.

    Using C2 244 and NWjs 0.24

    PS In 48 hours, ive slept 3 hours....i must fix this... :/

  • In preview mode i can't recreate the issue, only after exporting with NWjs.

  • Have you checked your object count in debug? If it keeps increasing over time then you've got object instances hanging around that are slowly filling up your memory/hogging your CPU. Alternatively, are you continually adding to arrays/dictionaries?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanks for the reply.

    I dont use arrays/dictionaries

    Collisions check per tick is 200-500 and object count is 300-400

    Also cpu usage (core2Quad) is about 50-55% and RAM (in task manager) about 90MB and then it drops to 5MB

  • I see now that the 2 processes using 90MB RAM, after i left the game open (just open a lvl and stay idle) for about 30min it went up to 600MB RAM!

    So i guess that is my problem..

    I will try --single-process arg but i dont think it will make any change.

    Any other arg or some setting in NWjs or C2 to solve this problem?

  • I see now that the 2 processes using 90MB RAM, after i left the game open (just open a lvl and stay idle) for about 30min it went up to 600MB RAM!

    So i guess that is my problem..

    I will try --single-process arg but i dont think it will make any change.

    Any other arg or some setting in NWjs or C2 to solve this problem?

    Single processing is broken (again) in the recent releases.

    This sounds more like an eventing problem to me as well and the increasing amount of memory usage is probably related to audio files being loaded into memory (if you don't load everything into memory on start). You should debug your project and closely watch for suspicious and unusual behavior.

    Very old versions of NW.js had a problem like this as well, so testing this out using a more recent version might help.

  • > I see now that the 2 processes using 90MB RAM, after i left the game open (just open a lvl and stay idle) for about 30min it went up to 600MB RAM!

    > So i guess that is my problem..

    >

    > I will try --single-process arg but i dont think it will make any change.

    >

    > Any other arg or some setting in NWjs or C2 to solve this problem?

    >

    Single processing is broken (again) in the recent releases.

    This sounds more like an eventing problem to me as well and the increasing amount of memory usage is probably related to audio files being loaded into memory (if you don't load everything into memory on start). You should debug your project and closely watch for suspicious and unusual behavior.

    Very old versions of NW.js had a problem like this as well, so testing this out using a more recent version might help.

    Thanks for the reply,

    I have removed many "for each" and "every tick" events and excluded audio from save along with some other minor tweaks.

    I also used --single-process.

    So far it looks fine. Ive played from start to finish with no problems and also someone who had the issue did not have it now.

    I hope it got fixed.

  • Thanks for the reply,

    I have removed many "for each" and "every tick" events and excluded audio from save along with some other minor tweaks.

    I also used --single-process.

    So far it looks fine. Ive played from start to finish with no problems and also someone who had the issue did not have it now.

    I hope it got fixed.

    If single processing works you must be using a fairly outdated version of NWjs.

    Anyway, I'd still recommended debugging your project and letting it run for a while.

  • If single processing works you must be using a fairly outdated version of NWjs.

    Anyway, I'd still recommended debugging your project and letting it run for a while.

    Well, i use v0.24 and i have "chromium-args": "--disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files --disable-software-rasterizer --ignore-gpu-blacklist --disable-devtools --in-process-gpu --single-process

    I've played my game for 2 hours with no problems.

  • Another user has reported performance issues in NW.js recently. Feel free to subscribe to my NW.js topic for further updates about this.

    ()

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