sqiddster's Forum Posts

  • Hi all,

    I've made a wonderful optimization to Airscape by dividing up all the levels into a grid and destroying certain static objects which are too far away from the player, and using 'recreate initial objects' To bring them back when the player gets nearby again. All of these static objects are part of a family and so can be easily regenerated with the aforementioned action.

    It works fantastically, however I've run into a fairly substantial issue and I was wondering if anyone could help out.

    Airscape has a robust 'terrain motion' system where almost all the game objects can optionally be pinned to nodes that will move them in certain ways. Most of the static terrain instances that are subject to the optimization aren't pinned to nodes like this, but in most levels a few are. When using the create/destroy grid optimization, these pinned objects are destroyed/recreated - and when they are recreated, they are totally misaligned with their node and unpinned, since the initial state is reset.

    Putting the nodes themselves in the family isn't an option, because they need to be operational even when the player is far away. Doing other sorts of fancy tricks won't work either - what happens when destroyed terrain is brought closer to the player by a node?

    All I need is a way to exclude certain instances from the destroy/recreate process. Excluding them from being destroyed is easy, because I have full control over my method of destroying objects occupying a certain region. Excluding them from being recreated, however, is proving impossible as the 'recreate initial objects' action doesn't leave its loop exposed to the event sheet - it simply recreates all instances - and if those instances haven't been destroyed, it just creates another copy on top of them! If the action was instead 'recreate instance' I could do something with that - but as it stands, it does appear like there's no way to exclude certain instances from this action.

    It's possible that I could create my own recreation function entirely, by storing valid objects in JSON format at start of layout (along with their coordinates) and recreating them as necessary, but this seems messy and expensive - I'd have to use the Nickname plugin to recreate objects by object type. Presumably for the 'recreate initial objects' action C2 does this internally, or something similar, but in a more efficient way.

    Does anyone have a method that I could have missed? And does anyone thing that this is a feature worth looking at adding?

  • TiAm actual text objects.

  • Elliott Off the top of my head, the main advantage would be ease of use (don't need to manually put together a proper spritesheet and set character spacing etc). Other advantages would be lower graphics memory usage (presumably, although if it's pasting to super large textures this might be negated) and perhaps dynamic bolding/styling etc, as well as the fact that it's vector based so you can render large text without blurriness - although this can have bad implications as revealed by this very topic!

  • newt what do you mean? 60fps is 60fps and it will obviously be noticeable if scaling at any lower rate. Anyway that wasn't the cause of the problem.

  • Problem Description

    It seems that Construct 2 (Or maybe just the browser itself) struggles to render very large text characters, with draw calls steadily increasing, eventually crashing the browser. In C2, this manifests when zooming in on a text object, and presumably also when text size is increased to very large values.

    I'd wager that this isn't a problem that you'll be able to fix (I'm sure browser aren't design with super large text rendering in mind) however I think it would probably be a good idea to at least force the engine to stop rendering text when it's drawn over a certain size, to prevent very mysterious crash issues.

    Attach a Capx

    I can't seem to attach a file, here's a link: C2 text zoom bug

    Description of Capx

    Zooms in on a text object

    Steps to Reproduce Bug

    • Run the capx

    Observed Result

    Increasing draw calls, browser crash

    Expected Result

    Normal zooming

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Win 8.1 64bit

    Construct 2 Version ID

    r210

  • I figured it out!

    It's the *text*!

    Apparently if you zoom in too much when some text is on a zooming layer, the draw calls go absolutely bananas, and the browser will eventually crash! How nobody has run into this issue, I'll never know.

    Thankfully I've been able to replicate it in a blank project and I'll be submitting a bug report.

    Thanks for the suggestions everyone!

    Edit: Here's a link to the bug report.

  • Just tried both rounding and doing it without dt, still crashed.

    Here's a video of the crash in action. Note how long the video goes after frames have stopped showing up!

    (Oh, and you might think the white particle has something to do with it but the results are the same with that disabled.)

  • Colludium I've seen most results at high resolutions which may well stress the GPU. I'm not sure I follow about how small textures are handled though. Is there any precedent for this being an issue?

    Prominent I's using an equation, yes. Basically layerscale = layerscale * some_acel_value ^ dt.

    I could try rounding it, but that's really weird if it's the case? Again, is there any precedent for something like this?

    I really appreciate the suggestions everyone!

  • newt 60, for a smooth zoom. And does 'calling a zoom' have some kind of performance implication that I'm unaware of?

    Prominent haven't checked but the game is only designed to run in Chrome.

  • tomsstudio not a bad guess. But why does this only happen when zooming quickly? Shouldn't scrolling present the same problem? (it doesn't).

    Colludium - the crash happens when zooming *in* so the number of objects on screen can only be getting *smaller*!

    I've managed to recreate the problem multiple times on my super powerful gaming PC (only when using the integrated GPU though)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • afaik there's nothing too special about the layout. I've tried enabing/disabling layers but since it's so infrequent to reproduce it wasn't very helpful.

    fldr no tilemaps.

  • Hey all,

    I've been running into some really weird behaviour in Airscape recently. One of the visual effects involves zooming in very rapidly. I've noticed that on occasion, this rapid zooming can cause *incredible* lag spikes and recently I've heard reports of the entire game crashing during these zooming sections!

    I've recently been doing some testing, and it's a very weird issue. Here are some of the things I've noticed:

    • it happens very infrequently, and repeating the zooming process under the same conditions can either reproduce the problem, or work perfectly fine.

    -When it does happen, the profile measurement for CPU 'draw calls' skyrockets, eventually reading as >100% of the CPU just used in draw calls.

    -I've checked and double checked, and I'm not doing anything dumb like accidentally spawning hundreds of objects while zooming. It's definitely the zoom that causes it.

    -It only seems to happen when zooming *quickly*. Slow zooms won't cause the issue.

    -It only happens on a certain layout of the game (the map screen). Rapid zooming in other levels has never caused a problem.

    -I can't find a reliable repro, no matter what I do. I do know it seems to happen more often when the GPU is already struggling.

    Basically, I'm asking if anyone has any idea what could be causing something like this? It's driving me up the wall and it's a high-priority issue as it's crashing the game for a lot of users. What on earth could cause the draw calls to skyrocket all of a sudden like this, and so unreliably?

  • Yep, hopefully this gets looked at in C3!

  • That's interesting. Is this an empty project? If you test an empty project and this doesn't happen, then you know it's a problem with your project.

  • TiAm NotionGames

    Reinstalling both NW and C2 seemed to fix it.