TetroniMike's Forum Posts

  • Windows, haven't tried the other two yet.

  • Whoops, turns out I was using NWJS 0.46.0. I made sure I was using the correct prebuilds (Chromium 83), and have a constantly refreshing canvas (every tick I rotate a 0-opacity object that stays in the middle of the screen). I've tried running it after uploading to Steam and running it as a "non-Steam game". Do you have any other ideas I can try to fix this?

    And to be clear, the game does indeed detect that it's being run from Steam, and achievements work. Just the overlay appears to be borked.

  • Danny can you post a full list of the chromium args you're using?

  • Anybody else having issues with Steam Overlay in NWJS 0.44.0 on Windows? Here's my chromium args, am I missing something or is something I added in addition to in-process and direct-comp breaking it??

    "chromium-args": "--disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files --ignore-gpu-blacklist --force-device-scale-factor=1 --disable-gpu-vsync --limit-fps=60 --disable-devtools --in-process-gpu --disable-direct-composition"

  • Thank you for the response! I'll look into this guide. I might also try High Quality full screen, and apply a (relative) 1px Mosaic effect on any scaled images.

  • Okay so to work around this issue I had to do the following:

    1) Set the original canvas size to a square, 180 x 180. This allows me to adjust the height manually to fit screen size.

    2) Set Fullscreen mode to "Letterbox scale". This centers the square canvas on the screen with black bars on the top and bottom.

    3)On Start of layout -> Set canvas size:

    - Width = OriginalViewportWidth

    - Height = floor(PlatformInfo.ScreenHeight/(PlatformInfo.ScreenWidth/OriginalViewportWidth))

    This sets the height of the canvas to the size of the screen, but to an integer value. I use Floor instead of Ceil or Int because if the height ended up larger than the screen height then we'd get tiny black bars on the right and left sides of the screen.

    ADDITIONAL NOTES:

    In my tests this only works on Mobile, not in preview mode in my browser on PC. So when setting the size you'll want to use PlatformInfo to check "Is on mobile". If so, use this scaling technique. If not, you must figure something else out. In my case, when not on mobile I decided to force the canvas size to [OriginalViewportWidth] x [floor(OriginalViewportWidth*(16/9))].

    Code to copy in to C3 if you want to use this method:

    {"is-c3-clipboard-data":true,"type":"actions","items":[{"id":"set-canvas-size","objectClass":"System","parameters":{"width":"OriginalViewportWidth","height":"floor(PlatformInfo.ScreenHeight/(PlatformInfo.ScreenWidth/OriginalViewportWidth))"}}]}

  • I just tried converting to Scale Outer instead, but this did not help the problem. I also tried manually setting the canvas/viewport size to integers but when using the Scale Inner/Outer modes it appears the engine overrides any manual changes.

    I'd really rather avoid turning off automatic scaling and doing it myself, but if I have to I guess that's what I'll do :/

  • Agreed StartY and EndY would be the best way to handle this, imo. You don't want to tie it to time in case of physics engine or framerate variation. Also consider whether you want to set StartY when the player leaves the upper platform, or at the apex of whatever height the player starts actually falling from, in case the player jumps off the platform vs walks off.

  • Hi there, I'm working on a mobile, low-res game that uses Sprite Font objects, Low "Fullscreen quality", and the Scale inner "Fullscreen mode". The dimensions of the viewport are very tall, so it can cover any device with any display aspect ratio. The viewport starts at 180 x 540, and on my device for example (Google Pixel 3XL, 1440 x 2960) it resizes to fit the phone at a resolution of 180 x 369.61165...

    The problem I'm running into is that this decimal number height seems to cause the images to tear near the bottom, assuming because it has to do some rounding to keep the pixels crisp. Please see the following video and screenshot where I move a Sprite Font object over the tear, you can see the problem happening near the bottom of the debug text window, it's a pretty dramatic and unwanted effect:

    Video: https://1drv.ms/v/s!AnfGCnwpFF_Yg6sUxYNhIoaERPB0-Q?e=epLfkX

    Screenshot: https://1drv.ms/u/s!AnfGCnwpFF_Yg6sWWVxdQ5v2DXSsEA?e=CZaQ8V

    My question is, what can I do about this? Has anyone else experienced this problem?

    Thanks for your help :)

  • +1 same problem, it was working about 2 hours ago for me.

  • We need a plugin to interface with Xbox Live API's on PC, in a game using the NWJS exporter. It must support the following using the latest GDK from Xbox:

    1) Xbox Live Sign-in

    2) Achievements

    3) Cloud Saving

    Price negotiable, if you've got the skills and have access to the latest Xbox GDK get a hold of me!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does anyone happen to know of a previous version of NWJS where this bug was not present? scirra.com/nwjs

  • While it is true that we're doing some unorthodox things with this project that aren't necessarily supported, the fact remains that this problem occurs with internally stored sound files too. You can test this in my provided capx, exported to nwjs, by clicking the internal sounds button. The sounds played there are all stored in the capx itself. I'm not sure, but I would guess if this was fixed for internal sound files, it'd also be fixed for externally loaded files as well :)

  • Correct, I tested in both Firefox and Chrome, and this only happens in NWJS.

  • TLDR; in NWJS, when playing the same set of sounds over and over again over a period of time, used memory will increase (potentially infinitely) until it affects performance.

    The following pertains to EXE's exported with NWJS from Construct 2. C2 and NWJS are updated to the latest versions.

    When playing audio, it appears that some sounds get "stuck" in memory and stack up over time. After a long time in a complex game with lots of audio, this results in slowing down the framerate.

    I've tested with sound files that are (A) stored in the exe, and (B) stored externally. For external audio, you can use Audio - Unload All to bring memory and framerate back to normal, but using Audio - Unload by name for each sound file does not help.

    I've created a test capx with internal sound files and buttons which manually preload and unload external sound files. There are two buttons which toggle randomly playing these sounds extremely rapidly. One only plays internal sounds, the other only plays external sounds.

    In the following tests I took note of the Memory in MB via Windows Task Manager. There are inconsistencies sometimes when running these tests, but my findings in general are listed below:

    1) CONTROL - Run the EXE and do nothing for 5 minutes.

    Results: Memory starts at 75mb, after 5 minutes memory ends up at 73mb.

    2) Run the EXE, Preload external sounds, Play external sounds rapidly for 5 minutes.

    Results: Memory starts at 72mb, after 5 minutes memory ends up at 92mb.

    Addl notes: Unloading sounds manually (by name) does not decrease memory usage. Unloading ALL sounds DOES decrease memory usage.

    3) Run the EXE, Play internal sounds rapidly for 5 minutes.

    Results: Memory starts at 72mb, after 5 minutes memory ends up at 94mb.

    Addl notes: Unload Sounds (by name) and Unload All Sounds both have no effect on memory.

    Letting the test run longer than 5 minutes shows the memory increase further, I did not see a maximum in my testing.

    This seems minor when looking at this small test EXE, but with a big project with hundreds of sounds effects and music, this becomes a problem where memory can increase in the hundreds of megabytes over 10 minutes of play and negatively affect framerate. In my actual game, memory increased from 200mb to 2200mb over the course of 20 minutes of play, and framerate dropped to 30fps. Using Unload All Sounds fixes the problem temporarily, but I cannot use that during normal play for game audio quality reasons, and Unload Sounds (by name) has no beneficial effect to memory or framerate.

    Capx and audio files:

    drive.google.com/file/d/1iGf_hWjeu6EfqG3XIihX7dJycuROU71_/view

    Put the audio files in a folder titled "data" in the same folder as the exported EXE. Let me know if you have any questions, and thank you for your time.

    Edit: I did some additional testing. It appears that if you Preload external sounds, toggle them on for a few minutes until memory increases noticeably, then toggle the sounds OFF and wait a few seconds, then neither of the Unload commands do anything for the memory. So it appears that the Unload commands only affect currently playing sound files?

    Note: If you'd like to more quickly see results in your test, add "Repeat x times" to the code as shown in this linked image:

    drive.google.com/file/d/1wCN1RGmTJJ-wyAY9le1WU49ipEByRr5p/view