Ashley's Forum Posts

  • If you're worried about security, this does nothing at all to improve the security of your game. Anyone who wants to access the local resources or code can do.

  • We moved away precisely because it is virtually impossible to get those features you noted to work. Rather than support a platform where a wide range of features simply cannot be supported, we instead focused on the standard system webview, which has reasonably good performance and supports almost all features.

  • On most devices, the normal Cordova webview performs well.

  • Construct 2 dropped support for Canvas+ around 4 years ago, so it's been unsupported for years now. That's probably why things don't work. You shouldn't use it any more.

  • FYI Construct 2 dropped support for Canvas+ around 4 years ago, so it's been unsupported for years now.

  • Construct 2's NW.js exports can work on Mac, but you must configure the file permissions. This is because Windows doesn't understand the same file permissions that Mac uses so omits them. This happens at the OS filesystem level and is not directly due to Construct. Then when you copy files without the file permissions the executable files are not marked executable so cannot be run; adding the executable permission back fixes it.

    Construct 3 works around this by exporting a zip file, and configuring the zip file permissions. This means as long as you extract the zip on a Mac, the file permissions are correct and it works out-of-the-box. However if you extract it on Windows then copy to Mac the same problem happens, because Windows doesn't understand the file permissions again. There's no workaround to that; Windows just works differently.

  • Ashley, would it make sense to offer an import of sprites, and spritesheets, via TexturePacker?

    Not really - firstly this still has the same problem: as soon as you edit anything Construct will throw out the old spritesheets and create new ones, essentially undoing anything that was done in TexturePacker. Secondly Construct sometimes packs spritesheets differently depending on project settings, e.g. downscaling quality. If an external tool does not respect this setting or provide it as an option, it's incompatible with that project setting, meaning Construct has to either re-pack the spritesheets itself (again undoing anything done by TexturePacker), or ignore the project setting (creating the possibility of issues like graphical glitches that appear if TexturePacker created a spritesheet without using the same algorithm Construct does in high-quality downscaling mode).

    I think the best option would be to be able to choose which sprites go into algorism, an option within the properties of the sprite would solve all the "problem".

    So presumably you'd want to configure this to reduce memory use. In that case it's even better if Construct can do this automatically for you. We have an upcoming change designed to do exactly that.

    Maybe set a max spritesheet size?

    I was going to add exactly this for the next beta cycle - I've already tested it and it seems to be the single thing that makes the biggest difference (moreso even than packing objects that are used together on the same sheets). It's a shame this can't be detected automatically - I want to try to avoid ending up with loads of advanced project settings that all need to be configured just right - but at least the option's there in case you need it.

    I am sceptical that adding any other more options would be useful. Packing spritesheets is actually a far more complex and subtle process than most people imagine. You might just think it means "throw a lot of images on to one larger image". Suppose you then start downscaling images a long way with mipmapping enabled (which it is in Construct for best quality rendering), and find that bleed happens on the lower mip levels. Turning off mipmaps is actually slower, so is not a good solution. Adding padding at first looks like it solves this, but actually just postpones the problem to a lower mip level, where it still happens. So then the best approach is to position and pad at power-of-two sizes so only the very lowest mip levels exhibit any bleed. Then you find transparency still bleeds in to the edge pixels. So you need to repeat the outer pixels of the image. Repeating it once doesn't solve the problem for low mip levels, because transparency still bleeds in again. So you need to repeat the outer pixels until they fill the entire power-of-two sized cell it's been placed in. Then for good measure, center the image within that.

    This is just a single aspect of spritesheeting, regarding resizing smaller. It has been directly informed by bug reports from real users with real problems. There are many other caveats involving memory usage, efficiency, compatibility, rendering quality, etc. I think this has led Construct to a more sophisticated spritesheeting algorithm than other tools. For example I don't think I've seen any other tools that provide an option for automatic power-of-two padding to solve the mipmapping bleed issue. Providing a customisable padding is the first-level solution to that, but doesn't really solve the problem properly; the power-of-two padding is the second-level solution that we've ended up with. So to me this looks like they have not yet run in to all the same issues as we have yet, so have not developed the algorithm as far along as we have. This is the case in other areas too, such as repeating the outer pixels in to the padding to avoid bleed either between other images, or with the transparent background of the spritesheet, since it ensures even fractional texture sampling right at the edge of an image returns the same color pixel.

    On top of that, AFAIK there's no reason to keep spritesheets square, it simply wastes memory. It's impossible to keep everything on one sheet, because eventually you hit the maximum texture size limit - avoiding that makes multiple spritesheets mandatory. And so on.

    In short I think we have a much more refined and well-developed spritesheeting engine than most people think. Adding more options unnecessarily burdens users with difficult technical choices with tradeoffs they might not understand, and in some cases are wasteful or unnecessary. Since it makes a big difference I think the max spritesheet size is the sole exception to this. It'll turn up in the next beta cycle so you can try it out.

    • Post link icon

    Launch external editor doesn't work for me, it just spins eventually returns control after a minute or so. It works for me in the desktop build though.

    Please report any bugs to the issue tracker following all the guidelines.

  • Yes, it is. There's a new JSON object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • By that strict definition you could just check to see if the angle is greater than zero.

    It's not clear to me if you are actually suggesting to do this, but this is another case of incorrectly making linear comparisons on angles.

  • - the thread you linked to, apart from having quite a lot of confusion over how WebGL rendering actually works, is a good demonstration of the tradeoff. Conceptually we can imagine either extreme:

    Maximum spritesheeting - there is a single gigantic spritesheet that contains all the images in the entire game.

    Pro: the entire game can be rendered without ever switching texture. In ideal circumstances, this means a single draw call can draw everything! (Although things like opacity, blend mode, effects etc. will "break the batch" and add more draw calls)

    Con: the game always uses the maximum amount of memory. There is no possibility for memory management - either everything is loaded, or nothing is. For large games this means they may not be able to run at all if there is not enough memory.

    Or: maximum memory efficiency - every single image is a separate texture.

    Pro: minimal memory use, since memory management is effective at ensuring textures which are not needed are not loaded.

    Con: maximum draw call overhead - every time a different image is drawn, it must switch texture.

    You can't have it both ways - this is a tradeoff between each extreme. I think the maximum spritesheeting case is worse than the maximum memory efficiency case, since the game can fail to run at all if it doesn't fit in memory. On the other hand the maximum memory efficiency case may be slower, but at least it can run.

    Neither C2 or C3 actually does either of those extremes, but C2 is closer towards the maximum memory efficiency end, and C3 is closer towards the maximum spritesheeting end.

    Taximan sent me their project by email which I am using to guide changes to the spritesheeting algorithm. In the case of their project, there was a signficiant increase in memory usage between C2 and C3, and it looks big enough that it may prevent some devices from being able to run the game at all. So I think it's good evidence we need to move back further the other way. In theory this could increase the draw call overhead, but as ever if people send me actual projects I can use them for testing and optimisation as I am doing with Taximan's project; otherwise I can only speculate. We do have some more changes in the pipeline though that should help both memory usage and draw calls, as well as giving more control over the spritesheeting process.

  • What should the note say? "If your math is wrong then some mathematically identical angles will be treated incorrectly"?

  • You do not have permission to view this post

  • Did you export with a different runtime to the same URL? It might be a caching issue. Try clearing the cache or publishing to a different URL. Other than that, in general Construct is not responsible for a failed server response, that would be something to investigate on the host.

  • Well, I don't think that's anything to do with Construct - the server is refusing to serve a file. So it's probably something to do with the host.