Ashley's Recent Forum Activity

  • Excal - textures are loaded layout-by-layout when WebGL is supported.

    0plus1 - WebGL shouldn't be loading everything on startup, how are you measuring that? If you can see VRAM increasing to unusually large levels maybe you should file a bug about it.

    However I still disagree, Ejecta is at fault here. Browsers handle it perfectly fine, and if Ejecta's purpose is to allow you to port browser games to native, then it should act like a browser too.

    Here's what Construct 2 does:

    On startup, it creates an Image object for every object in the project, and assigns its src property. This tells the browser to download it. Browsers do *not* create a texture in memory yet, because they're smart. They either write the compressed PNG/JPEG to a disk cache, or leave the compressed file in memory if there's room. Most DOM-less engines (including CocoonJS) make the mistake of creating a texture as soon as you assign the src property. This means they crash before a real browser would have even created a single texture. Browsers only create a texture the first time you draw it.

    When a layout starts:

    • in the WebGL renderer, we explicitly create textures for objects that are on the layout.
    • in the canvas2D renderer, we draw every image for each object that is on the layout in an invisible way. Since browsers create a texture the first time it's drawn, this effectively pre-loads all textures for canvas2D, and avoids "janking" (pausing as images are loaded mid-game).

    When a layout ends:

    • in the WebGL renderer, we explicitly free textures for objects that are on the previous layout and not on the next layout.
    • in the canvas2D renderer, there's nothing we can do, it doesn't provide a way to say "release this texture" (yet, anyway). Luckily most browsers are also sufficiently smart that if they run out of memory trying to create a new texture, they'll go back, release a bunch of textures that haven't been drawn for a while, then try creating the texture again. It's a bit of a hack, but it does successfully prevent devices running out of memory as you move between lots of different large layouts.

    The problem with a lot of DOM-less engines is they are naive, and do the dumb thing of creating textures as soon as the src is assigned. The solution is to make it do what browsers do.

  • You can already export Linux desktop apps using the node-webkit exporter.

    We get a lot of requests about porting C2 to other platforms. We're aware of demand, but as a small team (just 3 of us) it's not something we will be starting for the foreseeable future.

  • Construct 2 shows an estimate in the status bar in the latest builds. At runtime some browsers can show you WebGL memory use, in Firefox you can check in about:memory IIRC.

  • Closing, please report this to Ludei. It's a bug in CocoonJS and we can't fix it for them.

  • TBH it probably is nothing. The "fix" will probably amount to removing that log message.

  • There are no angles past 360 degrees - it wraps back to 0 degrees, which breaks the normal lerp. This is what anglelerp fixes - it knows about the wrapping.

  • 'Else' means 'the previous event at the same indentation level was false'. So sub-events don't affect else in your example.

  • Our own layout-by-layout memory loader only works with WebGL support.

    In canvas 2D, most browsers are smart enough to implement dynamic texture management in a way which prevents them running out of memory (e.g. release textures which have not been used for a while if encountering an out of memory error). A problem with most DOM-less engines is they make absolutely no attempt to do this and so just crash. The problem is with Ejecta rather than C2, canvas2D doesn't provide a way for us to manually release a texture.

  • Sounds like a job for the Array object.

  • It sounds like you ought to ask Squarespace about this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Construct 2 already automatically spritesheets on export, and our rationale is explained at the post - if we went further it could actually make projects bigger to download.

    The problem here is your server. You need a better one!

Ashley's avatar

Ashley

Online Now
Early Adopter

Member since 21 May, 2007
Last online 3 Nov, 2026

Twitter
Ashley has 1,835,608 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x126
    Coach One of your tutorials has over 1,000 readers
  • x74
    Educator One of your tutorials has over 10,000 readers
  • x6
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x44
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs