Rather large difference in position between Mouse Pointer and mouse.x mouse.y

0 favourites
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Further update,

    launching Chrome in this mode:

    --disable-gpu-vsync --disable-frame-rate-limit

    Eliminates input lag at this site:

    https://basro.github.io/input-lag-measuring-tool/

    If you disable only one option or the other, you can see the lag goes down, suggesting they both, ultimately, play a role, though I would want to run a few more tests. However, it does seem that there must be an issue with how construct handles disabling v-sync and running full frames or something. Whatever way the mouse position gets reported to construct or however it is handled in construct seems to introduce a delay that does not exist in the above website, which once frames are unthrottled and vsync off, there is basically no discernible lag.

    Also of importance is that if you simply use --disable-gpu-vsync at the above site, you also have only a teeny bit of lag, while construct still has a lot of visible lag, both running in the same chrome environment...

    canvas.onmousemove = function(event) {
    	var r = canvas.getBoundingClientRect();
     currPos.x = (event.clientX - r.left) * devicePixelRatio;
     currPos.y = (event.clientY - r.top) * devicePixelRatio;
    }

    Is the extent to which the website handles mouse position changes. I'm too tired at the moment to bother beautifying c3 JS regarding mouse events, but I'll try to dig around to see if something seems off

  • Construct actually uses higher-frequency raw pointer input events to avoid being limited to V-sync rate input events.

    As I said before, the frame latency is pretty much all controlled by the browser/OS/graphics driver. There's not much Construct can do to influence it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley, I don't understand then... With vsync disabled and framerate unlocked, why do other applications in a chrome browser (or other games not made with construct) have significantly less lag while c3 projects are still running at 16ms lag on a 60hz display.

    Basically, regardless of settings, construct project's mouse position is still throttled?

  • I don't know. Construct just reports the mouse position as soon as it possibly can. Any delays are probably in the browser or system.

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