Ashley's Forum Posts

  • Spritesheeting had a number of upgrades in C3. However it's extremely complicated and involves endless tradeoffs. It's pretty much the case that any change we make at all to spritesheeting, half of games get better in some way, and the other half get worse. We've played this game of whack-a-mole for some time and I don't think there's much more we can do to improve things for everyone.

    The key changes in C3 are preview mode also uses spritesheets - C2 does not in preview mode so you have to export to get a fair comparison; and C3 can combine more kinds of objects on to single spritesheets, whereas C2 never does. This means in C2 you often have far more separate image files, which in some cases can slow down downloads and loading, and reduce rendering performance at runtime, however it offers more granularity in memory management. In C3 the objects combined on to the same spritesheets are the ones most commonly used together on layouts across the project, the idea being that when it loads a spritesheet it's most likely all those objects are being used at the same time, thereby minimising the likelihood that a spritesheet is loaded with some content that won't be used. From what I've seen this does tend to scale pretty well to large real-world projects. (This doesn't tend to work so well with dummy projects, because they're not realistic examples of objects being re-used across multiple levels.)

    Also, C3 does already provide options to control this. The max spritesheet size setting lets you alter the performance vs. memory use tradeoff. According to my tests with the provided .capx I get:

    Exported C2 project: ~26mb image memory

    C3 project with max spritesheet size 1024: ~29mb image memory

    That's near enough to the C2 memory usage, so it seems that option is already there and working for your case.

  • Look at the memory management system actions. They're only available in the C3 runtime. There are also new spritesheeting project settings to help control memory use.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Post link icon

    Ah, I see. (This is the kind of detail that gets lost in long threads...)

    I've added a new beta branch on Steam that is fixed to r265 so you can use that to roll back if you want. But that doesn't itself do anything to solve the problem.

  • Conditions only check the instances picked by previous conditions. So you can use a condition to filter down the picked instances to just a few, and then the next conditions will only run on those instances.

    Testing overlaps is actually a good way to filter down instances, because it uses the collision cells optimisation to avoid even checking far-away instances. So it can even scale to enormous layouts with thousands of instances and stay efficient.

  • Construct 3 can directly import C2 .capx files.

  • And how can I call their library inside the runtime.js inside the c2runtime folder?

    I don't understand why you're asking - it's all still JavaScript. So, the same way you already are.

  • FYI Construct 3 may well be better suited for this. Firstly the C3 runtime handles image memory much more efficiently. IIRC the C2 runtime always holds all compressed images in memory at all times, so you pay a memory cost for images even if they're not loaded. The C3 runtime avoids storing them in memory at all until they're really loaded, which can save tons of memory for large projects. Secondly the C3 runtime has built-in features to load and unload images for objects which helps manage the memory usage within a layout.

  • My plugin does not have a c2_runtime folder

    You'll need a c2runtime folder with a script named runtime.js in there with the C2 runtime implementation.

    I'd hope sooner or later KaiOS will update the browser engine and then C3 runtime games will work fine on it too!

  • Create an event sheet function with a string return value. Inside the event sheet function, add a script action with:

    runtime.setReturnValue(testing());
    

    Now you can call the event sheet function as an expression, and it returns a value from JS.

    The general approach is to "wrap" JS functions with event functions.

    • Post link icon

    Then what about making a beta branch with r265?

    What does that actually solve? You can already roll back to r265 if you want. Just download and install it. It won't open projects saved in newer releases, but if you're willing to modify the project file to allow that, then you can already go ahead and do it.

  • Which platform is that? All major browsers have supported WebGL and WebAssembly for some time now.

  • At this point the vast majority of projects are already using the C3 runtime. You could just skip supporting the C2 runtime.

  • This looks like a bug we already fixed in the latest beta. You should check using the latest beta release to ensure it's not something we already sorted out, otherwise filing a bug report following all the guidelines is the way to go.

  • Unless otherwise noted, everything in the SDK documentation applies to both runtimes.

  • Great to hear! Sounds like an excellent use for Construct. Hope things continue to go well!