Toby R's Forum Posts

  • The source image is not a part of the project. Once you load it into your project, C2 makes a copy of that source image. Resizing it with the built-in image editor will update the image (in project, not the source) so also will affect the download size and memory usage.

    If you would for instance resize the source file (in external editor), nothing would happen in the project itself.

    Note that resizing the sprite object won't have such effect as this will resize only the object, not the image.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It is not an issue for most of games, however there are some games like OP's game that are heavily dependend on the big amount of sounds which are unique per layout. In such case the good approach would be to preload only common sounds at start of the project and then preload those unique sounds at the beginning of the particular layout. Once the layout (stage) is over and those sounds are no longer needed, their buffer should be released.

    And so I've added several actions to unload/release sounds:

    All I'm doing here is just dropping a reference in audioBuffers array. It obviously doesn't work instantly as it's impossible to call the Garbage Collector manually in JS, but it is good enough as GC comes soon during next layout gameplay. In the end the game consumes much less memory with this approach and C2 is no longer limited to light sound dependent games.

    Just disabling sounds preload on start is not enough as during the game more and more sounds get loaded into the memory anyway what in the end has the same effect - memory limit reached.

    As mentioned earlier, we are still testing those features but it looks promising. TheRealDannyyy will write a bit more about it soon. I really hope you Ashley will have few minutes to take a look at the code and consider adding those features to the official Audio plugin as maintaining both plugins which are in 90% the same from the code perspective is pointless and it will be easier/less confusing for C2 users.

  • I personally can recommend Borys (

  • .@StaticCloud it would be the best if you could join us on Armaldio's C2 Discord server (https://discord.gg/YfMsC5D). We are online there most of the time so it would be more comfortable to talk with real time chat software there.

    Indeed TheRealDannyyy suggested recently to create audio unloading (memory releasing) features as (as he mentioned already) Audios in C2 can eat up a lot of RAM and bring problems. The plugin is in alpha testing, but it seems to work well already. Your project would be a great test case for us. So please join the Discord and ping me (Toby R) or TheRealDannyyy there to talk further. Thanks.

  • Could you not accomplish the same thing with, say, a blank dictionary? Am I missing something?

    As I mentioned in my recent post:

    It’s all about the approach. You can use nearly any other plugin and achieve the same result. I just made this one to have an empty plugin so to not load unnecessary data to the memory and have a separate plugin with unique icon to make it visually distinct.

    So yes, you can use a blank dictionary as well. Wouldn't be that elegant (IMO) as using this empty plugin, but you can achieve the same results.

  • I took a quick read, I see a difference is... just for sorting?

    No it's not just for sorting.

    It is better to use Globals plugin approach instead of native global variables because:

    • it has the same features as native globals (and more!)
    • it has boolean type variables (not possible with native globals)
    • it doesn’t pollute the variables listing
    • it doesn’t pollute the event sheets
    • it is possible to group variables (not possible with native globals)

    Up to that this approach is better semantic-wise and code architecture wise. You may know that modern languages like C# or JAVA do not allow globals at all (for a reason), instead they offer public static variables encapsulated within the class namespace (so basically the same solution as with Globals plugin. You can read a bit more about that in my recent post (if you haven't yet - also linked to the first post here).

    Going further, sticking to good practices (following good code architecture and semantics) lets you keep your code clean and intuitive which then implicates in better project maintanability and so on... It's a whole big chain.

  • What are difference between this plugin globals and c2 globals?

    I explained that in my article: Globals – Construct 2 plugin – alternative for native global variables

  • Alright so I asked the NWjs team for clarification via Twitter (as they reply pretty quick on tweets) and they replied:

    No idea when and where was it announced... but it seems that the fix is indeed implemented in 0.19.1 (haven't tested on my end yet)

  • Let me explain.

    The video recording issue was related to the flickering issue. It was reported to the Chromium team and fixed with Chromium 56.

    The point is that there is no NW.js version based on Chromium 56 yet and that's why we still have to use --disable-direct-composition as a workaround.

    I assume that the roundup states How To: Workaround Recording Issues & Canvas Flickering (NW.js v0.14.0rc1 - v0.19.0) just because in the time TheRealDannyyy wrote it, 0.19.0 was the latest version and we were all expecting new version to have Chromium 56 implemented. In other words it should be "... (NW.js v0.14.0rc1 - v0.19.2)" for today as Chromium 56 is still not there yet.

    Interesting is that below it's written:

    [quote:303zztnc](Fixed for all NW.js versions starting from 0.19.1, use the workaround only in NW.js versions from 0.14.0rc1 to 0.19.0!)

    Latest NWjs still uses Chromium 55

    Was it somehow fixes with 0.19.1 and I missed it or was it written due to expectation that the next version will have it fixed TheRealDannyyy?

  • Version 1.4 available now.

    v1.4 update (2017-01-11)

    • ScreenWidth expression added: Return the width of currently set screen resolution.
    • ScreenHeight expression added: Return the height of currently set screen resolution.
    • GetScreenRatio expression added: Return the (string) aspect ratio of the screen (ex. "16:9") or 0 (integer) if could not detect.
    • IsScreenRatio expression added: Check if screen aspect ratio is equal to "WidthRatio":"HeightRatio". Return 1 if true and 0 if false.
    • GCD expression added: Return the Greatest Common Divisor for a and b parameters or 0 if wasn't found.
    • Is screen aspect ratio(Width ratio, Height ratio) condition added: True when screen aspect ratio is equal to "Width ratio":"Height ratio".

    Trivial example usage of some of new features.

  • I added a little update to the first post, explaining "why this approach over the native globals".

  • I'm back on track with MoModth. A lot has changed. I have moved some functionalities to the MoModth plugin. MoModth is still event based framework, just the absolute core features like modules handling/managing, storage managing and preloader are covered with plugin which makes life easier.

    It is strictly modular based which makes it easy to maintain no matter how big the project is and it's of course highly extensible/customizable. I will post more details soon. For now you can see how the example MoModth controller module looks like: https://puu.sh/th2qK/330bf3c688.png

  • I think you're trying to make what Pode already made. So you can take a look at his code:

  • FYI, NW.js 0.19.2 still produce black screen on OBS without '--disable-direct-composition'.

    Issue will be fixed with Chromium 56. NW.js 0.19.2 is based on Chromium 55, so we still need to wait a little bit.

  • Let me quote myself here as I would write pretty same thing as in my article anyway.

    [quote:3h7zaz9f]The discussions whether native C2 global variables are good or not have been raised many times on the Scirra forum and beyond. Some people say globals are ok, some that they’re not. I’m in this second group and that is why I made this plugin

    Download for C2 Globals.c2addon

    Download for C3 Globals.c3addon

    Please read the short article (more images than text) to unterstand the approach of using this plugin:

    Globals – Construct 2 plugin – alternative for native global variables

    == EDIT ==

    I've been asked several times to explain in more details "why this approach over the native globals". So here is some update to clarify.

    == UPDATE - New extended version ==

    Globals 2.0 is now available in Scirra Store (note that Globals v1.0 is still and will remain free).

    Globals 2.0 is an extended version of Globals plugin with the following extra features:

    • Compatible with Globals 1.0
    • Save/Load variables to System storage
    • Save/Load variables to LocalStorage (or any other place by export/import JSON)
    • Reset variables
    • Can be used as a "struct" data object

    For more details and the video please visit the Globals 2.0 store page.