Ashley's Forum Posts

  • Madster: that's correct, if you use a condition to filter down the objects before checking an overlap, then the overlap is only checked on those instances matching the previous condition. (That's the normal operation of conditions - filtering down instances condition by condition.)

    The fact invisible offscreen sprites still affect performance is for two reasons:

    1) If they're animated, the animation still needs to be ticked along so when they come back they're showing the correct frame. If they only have one animation with one frame, though, I think an optimisation kicks in that does no processing at all, though.

    2) Construct must check every renderable object every tick to see if it needs to be drawn. Even invisible sprites are checked - it will just say, "oh, this one's invisible, next please". If it is visible, it does a very simple is-on-screen check (determine the bounding box then one to four integer comparisons) and if it's not on-screen it skips to the next one as well. These are trivial and take a tiny amount of time on modern processors, but with hundreds of thousands of objects these tiny tests become significant. 100,000 objects at 60 frames per second is 6,000,000 checks a second.

    If you like calculations, since that's running on a single core at probably around 2.5GHz, each sprite takes about 400 cycles to check, which is about 160 nanoseconds. Yep, most games probably don't have to worry about that!

    It's possible to improve the engine such that invisible or offscreen objects don't even need to be checked like that - it's something I'll consider for Construct 2.

  • This is a good idea for C2, but per pixel isn't much of a waste of resources. At 1 bit per pixel for a collision mask you're only using 128kb of memory for a 1024x1024 object, on machines which these days typically have well over 1gb physical RAM going spare.

  • Have you thought about having a single event sheet that more than one layout uses? You could have a 'standard level' event sheet which includes 'Gameplay' and 'Rain' and simply select that as the event sheet for several levels.

    Does that do what you want or were you after something more?

  • Yeah, I always wait a couple of days after asking just to be sure. There's no rush.

  • Shall I mark this build stable? I haven't heard of any problems with it yet.

  • Over 5000 objects would probably be pushing it for low end machines, and large layouts should be fine (there's no memory/cpu usage proportional to layout size so it essentially doesn't matter how big a layout is). The only issue is objects store their position in single-precision floating point numbers, which means they might start getting inaccurately calculated at really big X/Y co-ordinates - it should be OK within 100,000 pixels of the layout origin though. You could always experiment with a slow moving object at (100000,100000) and see if it still moves OK (use unbounded scrolling to save having to make a layout that big).

    You'll probably get better performance with smaller levels with less objects: currently, construct has to check every object in the layout, no matter how far away it is from the screen, to see if it needs to be drawn or animated. This incurs a tiny performance penalty, but in theory having over 10,000 objects in a layout could slow down the game purely because those objects exist.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What are you trying to do? If you're trying to connect two objects with a line, the Line object is the way to go, since all you have to do is update its start and end position. If you want to draw a picture consisting of many lines, you probably want to use the Canvas object, which is better suited to procedural drawing.

  • Download Construct 0.99.96 (unstable)

    Link to previous build (0.99.95) changelog

    Here are some more fixes, hopefully we can make this another stable and move relatively straightforwardly to some release candidates soon

    Update 26th October: Marked stable.

    Changelog

    Editor

    • [CHANGE] Cleartype enabled for as many places as I can find in the editor. Also changed the font in many places from Arial to Segoe UI. (Ashley)

    Animation Bar

    • [FIX] Launch Explorer no longer crashes when you have an action point

    Runtime

    • [FIX] Fixed slowdown when using per pixel collisions. (R0J0hound)
    • [FIX] Fixed crashes when using families with private variables. (R0J0hound)

    3d Object

    • [ADD] Can now change the z position at runtime (Davo)

    Event Wizard

    • [FIX] Crash that occured if you obtained an expression from an object before typing anything into the expression editor. (Davo)
  • You do not have permission to view this post

  • You do not have permission to view this post

  • Moved to Your Creations

  • You do not have permission to view this post

  • I've always thought this would be much less useful than people think. Consider typing "On collision between SpriteA and SpriteB". If you typo'd and wrote "On collisiion between SpriteA and SpriteB" Construct wouldn't be able to recognise the condition and would point to it as an error. And it'd take so long to type out you probably could have picked it out from the menu by then, if you're experienced. Plus the text format could never be as clear as the event sheet: to prevent ambiguities in which part of a condition or action are parameters, you'd have to differentiate it somehow. So instead of "Sprite value 'X' less than 5" you'd have to type something like "Sprite: value param('x') param('less than') param(5)" which has already destroyed the readability.

    Are you sure it would make it quicker and easier considering that? I think an experienced user can click through the menus very quickly so typing out a long event could actually take a lot longer IMO, especially if you make some typos.

  • You do not have permission to view this post

  • Welcome back