Ruskul's Recent Forum Activity

  • Lol, NEVER!

    ~back to editing json~

    Does anyone know if you can break a project simply by copying variables on on object type or family type json files?

  • Okay, you make big object with lotsa variable, then you decide it should have been family all along. Is there any way in the editor to create a family type from an object type, or to perhaps simply copy the variables from one object to another?

    In the editor, it seems you have to painfully recreate them all... one by one.

    Or, and WAY easier than manually creating them one by one, is to edit the files directly in the project folder. (simply create the family type in the editor, then open up is JSON file and copy the variables from the object type you want.

    In the same way, you make other edits to your project that are sometimes easier than doing so through the editor. Fun times.

    Any advice here?

  • It sort of defeats the advantage of having a visual event system when you can't define an icon for each family type. As anyone who makes large projects probably knows, 9/10s of all events are likely wrapped up into a family events...

    At least, that's my humble 2 cents, and should be an easy addition. Any hot takes?

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • Further update:

    This website shows input lag. If you run it on an old browser, you can actually get the lag of your device/setup. As it stands, it confirms that basically all browsers are coalescing input into less frequent events to coincide with framerate.

    Incendentaly, I get exactly the same input lag on both chrome and firefox, but while running a construct game on firefox I get 2x the lag. Possibly something wonky going on here.

    https://www.vsynctester.com/testing/mouse.html

  • Ashley

    On all my devices, regardless of browser, it appears that the difference between the hardware cursor and mouse.x/y remains consistent while switching between v-sync and unlimmited full frames.

    Do you know if that has to do with a polling rate on the browser side? It seems that whether fps is 60 or 35000, the lag time is still the same?

    EDIT / Update

    TIL Chrome collapses mouse events to match screen refresh rate. So regardless of how many frames you CAN run the game at, the input from the mouse at least, remains at 60 hz.

    https://developer.chrome.com/blog/aligning-input-events

    As far as I can tell, it looks like you can pull expanded info from the mouse event, but I don't see a way to increase the frequency (say 2x framerate)

  • On my fx504 with a 60hz screen:

    Firefox definitely does something that bumps the lag up to 4 frames.

    On chrome and Edge, I only see 2.

  • I've got 3 macbook airs, and one macbookpro, all at 60hz. I have an asusfx504 at 60hz, an Asusg15 at 144hz, an hp revolve at 40hz, and an assortment of all in one desktops to try some tests on (along with like 100 other computers)

    I am not getting the same answers, depending on the device used and browser. Assuming one wants to export the game as a standalone app for windows, I should test using Edge right?

    Eitherway, I know chrome has some built in latency but didn't have a clue about the others. What is weird to me though, is how much the future prediction jitters in some cases. I thought it could be related to dt fluctiaitons, but that doesn't seem to fully account for it.

    I am going to try to create a setup with a qmk keyboard controlling the mouse so I can get absolutely precise mouse input - though I'll have to account for the lag introduced by the board if that is relevant.

  • Hey, here is the file: https://drive.google.com/file/d/1yQ01n8EX2RFXmgUoQSiuPWFGU4UcmxMZ/view?usp=drive_link

    I misspoke earlier, frame lag is 4, not 2. 2 is reasonable, 4 is a much harder pill to swallow, especially when it is always 4/60ths of a second regardless of actual frame rate.

  • Further exploration leads me to believe (on the current computer at work) that:

    A) Input lag is 2 frames at 60hz. I conclude this by storing the previous mouse coordinates one frame back and extrapolating forward 2x that distance. That position is typically spot on the hardware cursor

    b) Changing to unlimited fps, either ticks only or full frames, still results in a 60hz 2 frame lag. So either input is still being polled at 60hz regardless of frame rate, all my mice and track pads only operate at 60hz, or something else is causing this?

    ASHLEY. 2 frame lag isnʻt unreasonable, Iʻve got some 40hz and 144hz screens I can test on too and see if that changes things, but so far I am assuming there is a 60hz input buffer? Does construct do its own thing or does it build its buffer on another system?

  • I am not sure what you mean. I just tested (sprite set position to mouse.x/y) and the lag is barely noticeable at 60 fps. At higher fps there is practically no lag at all.

    In any case the lag can't be more than the duration of one frame, 0.016s at 60 fps.

    Does it happen in a blank project?

    Yes, it happens in a blank as well. I create a box and then set the box position to the mouse.x/y position.

    You can notice it most profoundly when moving the mouse in steady motions at the right speed.

    You can add several other objects that are daisy chained to the position of the the first, but set in reverse order so they each lag behind one frame. I use this to get an idea what several frames of lag should look like, but the mouse much further ahead.

    Ashley Iʻm curious if there is a particular hardware/software issue then. I donʻt think I would have noticed it if I hadnʻt been playing a lot of sc2 lately. Hopping from sc to construct and it was very noticeable .At some point in history, I knew firefox had less latency than chrome, and Iʻm not sure if that is still true, but I wondered how many layers input has to travel in a construct project being tied to the browser. Constructs input lag on my test, had to be perhaps 1/6 of a second or more, regardless of the FPS being vsynced or not. Whether the project was at 60fps or 22000fps. I wondered if constructs double buffer was daisy chained inevitably to several other double buffers? Iʻll try to get a screen capture when I am next at home.

Ruskul's avatar

Ruskul

Member since 23 Nov, 2013

Twitter
Ruskul has 2 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies