Ashley's Forum Posts

  • We get feature requests and bumps like this daily. There is simply a practical limit on how quickly we can address features, so all I can say is hopefully we will eventually get round to it and I can't provide an ETA. It's already possible to do this with events (or third party plugin? haven't looked at it myself) so I don't see it as urgent, it's just a way to make something already possible a bit easier. Also I don't think this suggestion is as straightforward as you might think: ideally such a feature would be able to apply to any audio parameter, not just volume, allowing you to "fade" anything from the volume to a convolution wet/dry mix over time using a variety of curves (e.g. linear, logarithmic, cosine etc). Then there's the internal complexity of the Audio plugin which currently supports four audio APIs (only two are really relevant today, but we don't want to remove the old ones in case people still rely on them), and this makes changes a little tricky sometimes - it probably needs a rewrite or overhaul.

  • It's still on my todo list. I'm not sure why it would be urgent though, it should be easy to re-do what the behavior does with events, and then you have complete control.

  • Using artwork is no reason not to file a bug - simply blank it out with placeholders and go ahead and file the report.

    However having said that, in our experience bugs which can't be reproduced in a new empty project and involve lots of events (you said 300!) are typically mistakes in the events, not C2 bugs. Also since you use a third party plugin, if the bug is with that plugin we cannot offer support, and this is why we require that all bug reports do not use any third party plugins. I'd recommend first trying to sort it out with lucid and if he determines there is an issue in C2 then we'd be happy to look in to it.

    Moving to 'Closed bugs' for now.

    • Post link icon

    Edit: I had to use the API name. I got it to work. Thanks a bunch for this!!

    Thanks, I edited the parameter description to say it's the API name required. (Not sure when I'll do a plugin update though, seems kind of a small change)

  • My point was the SDK allows you to look in to it without having to wait for us to get round to it. We get requests like this daily, and many of them are non-trivial to implement, and there's simply not the time to do everything immediately. Hopefully we will get round to it eventually, but I can't give an ETA on anything specific.

  • Copying what a mobile browsers does was not our goal because they were not initially designed for gaming.

    It sounds like you are confirming your goal is to diverge from what real browsers do. This then confirms our decision to drop support for Canvas+. We are not prepared to support something which pretends to be a browser, but in reality is incompatible with what browsers do. Your proposed improvements are simply very difficult compatibility problems for us.

    While mobile browsers perhaps used to be terrible for gaming, modern mobile browsers are very good and in my opinion very well designed for gaming. The philosophy that "mobile browsers are not suitable for gaming" is in my opinion now out of date and no longer relevant on today's web, and should not be used as a reason to implement things differently. I could go further in to the details of browser caching and memory eviction heuristics, but I don't see much point - so long as your goals are to deliberately go in a different direction, then I neither want the support burden of having to deal with those differences, nor to become embroiled in technical debates about which is the "right" way. We're going to keep going the way we are which is to design an engine based on a single codebase that runs well in all real browsers.

  • As explained in the above mentioned blogpost, we offer many APIs which give developers even more precise memory control than standard browsers (like the immediate "dispose" method).

    The "dispose" method does not solve the problem by itself. By the time you can call it, the image is already in memory, which means it might already have crashed, and it still unnecessarily loaded it which increases the loading time.

    [quote:l5tfqw08]Construct2 loads all the assets at startup

    No, it only downloads them. It's a web based engine after all and the game needs to be downloaded before starting. CocoonJS is unique in going ahead and decompressing everything in to memory when we only wanted to download. In a local app, since there is nothing to download, it should simply amount to "remember the path".

    [quote:l5tfqw08]Canvas+ just loads an image when the "src" property is set from JavaScript

    This is precisely the problem: in browsers that is the directive to download a resource.

    [quote:l5tfqw08]The entire team agrees that preloaded OpenGL textures make HTML5 games feel more native-like. Reading an image from disk and uploading a texture to the GPU is an expensive operation, which may lead to noticeable glitches or pauses if the process is carried out in the middle of a render animation.

    The key problem is all browsers disagree with you, even mobile browsers. Anyone designing any web-based engine must deal with the fact that all browsers will have precisely that problem with lazy-loading causing jank mid-game. Therefore, anyone with interest in designing an engine that works well on real browsers will have already mitigated that problem. Construct 2 has done exactly this, by some pre-rendering code before start of layout in canvas2d mode, and texture creation in WebGL mode. This brings a smooth, native-like feel to real browsers even though they lazy-load resources. By choosing a different approach, CocoonJS creates two problems:

    1) our approach, designed for real browsers, doesn't work, nor will any other engine which has similarly mitigated the problem for real browsers

    2) anyone designing a game for CocoonJS, then porting it to a real browser, will find it suddenly suffers from mid-game jank due to lazy loading resources the first time they are used.

    So I'd have thought it would actually be favourable to CocoonJS to copy what the browsers do and provide advice on how to work around lazy loading in a portable, cross-platform manner. This solves both problems.

    I think the key problem is that you perceive this change as some kind of performance improvement, whereas really it throws a spanner in the works of any engine that's already designed for real browsers, and will trip up anyone porting their game either to or from CocoonJS.

    [quote:l5tfqw08]That’s why we are going to keep this approach as the default in Canvas+. Do you prefer the other approach? We have added the "cocoonLazyLoad" property to enable it. Just use the one that works better for you.

    At last! I'll add that in as the default for images the next build. But as argued above, I feel this ought to be the default!

    [quote:l5tfqw08]Surprise, Construct2 running with WebGL eats almost twice the memory on WebView than on Canvas+.

    I think all this proves is the WebView has a full browser engine (including features like DOM, web audio API, WebRTC etc), and a full browser engine takes up a bit more memory.

    [quote:l5tfqw08]It seems that Images are not properly released specially on Canvas+ even if the capx uses layout by layout. Inspecting the code with Google Chrome profiler we have found that Image references are strongly retained in the Construct2 engine and are not disposed of (when using canvas2D context). This is bad for the garbage collector.

    It shouldn't matter, because in real browsers holding a Javascript reference to an Image object does not mean the Image is decompressed in memory. We can't drop the reference, because we might need it again if the player comes back to that layout later. If we drop references and re-create them we might invoke downloads in real browsers, wasting bandwidth and causing delays, and a separate codepath also defeats the point of having a portable engine that runs the same everywhere. To me your graph simply identifies the canvas+ bug.

    I'd also point out that it's sometimes difficult to make good sense of garbage-collected memory use graphs, since they can spike high and appear to be using lots of memory, but the next collection is able to release it all. That's an essential point: it is more important that it can release memory when it's high, than how much the highest memory use actually is. This allows the game to continue running as opposed to crash, as evidenced by the larger games which tend to crash when ported to Canvas+ when they run fine in a real browser (even with higher memory use!). The 2nd graph also confirms this: despite peaking higher, the web view finishes with lower memory use than canvas+. So I don't consider the peak memory usage particularly relevant, a more important question is "does it crash?"

  • JohnnySheffield - it doesn't look like it does anything node-webkit doesn't already do, and NW also has the backing of Intel. So I don't see much point in supporting something else that does the same thing unless there's some kind of major problem with NW.

  • I would *strongly* recommend you do not write plugins that directly access other plugins. It breaks encapsulation and is brittle. For example we may go ahead in future and change how the Array object works to fix some bug or change some feature, and this will break everything that depends on it like this.

    Also, it's less useful for users. You force them in to a specific workflow. For example if you at some point run an action in another object, then the user is locked in to that dependency and can never alter it. If on the other hand you run a trigger, then the user can place an action in that event to do that task, or they can do something else, perhaps using a different third party plugin or some alternative feature. It's also easier to understand since you can see what's happening, instead of there being under-the-hood invisible magic causing actions to run unexpectedly. Consider that in the entire C2 engine, actions never run except where they have been added visibly in the event sheet, and a plugin that uniquely breaks that rule will be uniquely surprising. Users can also more easily test by adding logging to triggers, temporarily disabling the action, etc.

    Yes it's possible, but you will design inflexible, breakable plugins - please think of other ways to design your plugin.

  • Crashes (as in the app exits) are usually caused by buggy graphics drivers, or running out of memory. In rare cases it may be a browser bug, but the first two causes are far more likely. There's not much you can do about buggy drivers; most mobile platforms don't allow updates outside of updating the entire OS, which is subject to the carrier/manufacturer approving the update.

    If there's a bug in the C2 engine then if the JS code goes wrong it probably won't crash the app. It will probably freeze instead, since the browser engine catches the JS error, halts the script, and then continues running the page. That's useful in web pages but since the C2 engine is all JS then the game logic halts freezing the game then the last frame remains on-screen. If that happens then ideally you'd be able to reproduce it and report it as a bug to us so we can fix it.

  • We're always on the lookout for new ways to publish, but most of the alternatives we see have some significant caveat that make it a better idea to use one of the existing ones in C2. If there were any alternatives that were really compelling, we'd add them in to C2.

    Aphrodite - note C2 has forced GPU acceleration enabled on Windows in node-webkit for several releases now.

  • Still can't reproduce, runs great on an iPhone 4S running iOS 8.1 with XCode 6.1 on OS X Yosemite. Try making sure you've got the latest Ejecta code from github as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Should be fixed in next build.

  • Well spotted, thanks. Updated the manual entry

  • I can reproduce, but I don't think it's a Construct 2 bug. Our code is pretty simple and just triggers events when the browser events fire. I'd suggest posting this to Microsoft at connect.microsoft.com.