Download Construct 2 release 35

  • I just tried in Classic, and its platform movement has the same bug. Nobody seemed to notice it there...! It's only ever a gap of less than a pixel.

    What? I don't see any gap in Classic

    That was a problem several builds ago, but Davo fixed it. Unless it's happening on some graphics cards and not others...

  • When I insert a platform onto a layout it either places it at integer values or x.5 (i.e., Position: 304, 180.5). Could that have something to do with it?

  • The "pixel float" problem is this:

    • the editor places objects at integer coordinates by default
    • objects have a centred hot spot by default
    • objects with an odd width or height therefore actually end on a half-pixel
    • the platform movement push-out algorithm only works to the nearest whole pixel

    This is the same in both Classic and C2.

    For example a 15x15 solid block placed at (50, 50) with a centred hotspot actually extends from (42.5, 42.5) to (57.5, 57.5). That's exactly what you asked for, it's just the math means its edges land midway between pixels.

    The way the platform movement works is like this: when you are falling, you are actually teleporting small distances every tick. When you land on a solid, at first the object doesn't land perfectly on top - it ends up lodged some way inside a solid. The platform movement notices this and starts what's called a 'push-out': it moves the object up one pixel at a time until it's no longer overlapping a solid. Now the player has landed perfectly on top of the solid, but to the nearest pixel.

    This means the platform movement floats only half a pixel above solid objects with a centred hotspot and an odd number for height.

    Then, it's the whim of the renderer how this is displayed: it may round it one way, and there is no gap. It may round it the other way, and there's a whole pixel gap. It may support sub-pixel rendering, which results in a gap which is a 50% blend of the background and the floor colour, which still looks like a gap, but fainter.

    In short, everything is working correctly, but the results are not always consistent or intuitive.

    As I said it's the same way in Construct Classic. It seems pretty minor so I'm tempted to let it go - the solution is pretty tough as well, considering you can floating-point position objects to be, say, 0.117 of the way between two pixels. Getting the push-out algorithm to detect this exactly is tough. It seems better to say it will land you within 1 pixel of the floor. It seems to have done the job OK in Classic. Does that sound OK? Has anyone actually had real problems with the sub-pixel float in games they've made in Classic?

  • I thought in CC upon pressing 5 would place the hotspot at the closest integer pixel to the center, not placing it at a subpixel?

    Since C2 has no hotspots yet and I assume is mathematically calculating the center, perhaps simply round that number then?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That would be a possible solution, yeah. Not sure that Classic does that though because I did seem to be able to reproduce the issue. I think the nearest-pixel-hotspot would be good for C2 if Classic doesn't.

  • For example a 15x15 solid block placed at (50, 50) with a centred hotspot actually extends from (42.5, 42.5) to (57.5, 57.5). That's exactly what you asked for, it's just the math means its edges land midway between pixels.

    Ah, maybe that's why I never have that problem. I always use power of 2 sizes for my player and colliders, and I make sure they're always aligned on a power of 2 sized grid.

  • I feel I need to use this.

    <img src="http://i79.photobucket.com/albums/j135/mr_norris/ossum.jpg">

    Edit:

    There's one thing I'd like to suggest (I might have already suggested this, not sure. so excuse me if I'm repeating myself)

    What if C2 remembered how you placed your views, like it remembers event sheet lengths?

    I do this when I do stuff in C2. Having both views open at the same time is awesome.

    http://i79.photobucket.com/albums/j135/ ... kspace.jpg

    And when I load the project again it reverts back to this.

    http://i79.photobucket.com/albums/j135/ ... space2.jpg

    Mostly something for convenience, not a necessity. But it would be nice =P

  • Inkbot, I'm awesome? Why? What did I do? ;p

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)