Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Could a learning AI algorithm solve the latency problem for gamers?

Discussion in 'General Discussion' started by Arowx, Jan 22, 2021.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    So there is input delay and output delay and players interacting with your game and maybe that latency is reducing their performance.

    What if you had an AI learning the players style and response times that could bypass the latency delay problem providing the player with a smoother and more performant experience?

    Or to use the "How's he doing that?" scene from Robocop[2014]... about 3.14



    Most games have difficulty settings and even dynamic difficulty to ensure a player keeps playing the game would it really be that much of a step to enhance their performance a bit?
     
  2. FrankenCreations

    FrankenCreations

    Joined:
    Jun 14, 2017
    Posts:
    326
    All it would take is a few wrong guesses making me do something I didn't actually do to make me remove that game from my harddrive.
     
    Neonlyte, SparrowGS and Joe-Censored like this.
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,574
    @Arowx if is too hard for you? Play easy mode, or use aimbots / cheatmodes, no need for any other fany tech. Play some multiplier shooters, then you will quickly know, what cheating is about.
     
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
  5. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    This is some next level S***, we use machine learning to estimate VR avatar poses, but we have some realtime input to our model. This AI needs to look into the future :)

    Edit: machines predicting the future, like Sarah Connor once said, There's no fate but what we make for ourselves :)
     
  6. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,960
    It is possible to have the AI "enhance" a player's gameplay by "knowing" when the player is going to shoot based on statistical response times & accuracy. But of course, even if most players wouldn't notice that anything's off, some will feel the gameplay isn't consistent, as if the reality they're interacting with isn't real. They will be The Chosen Ones!
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Why even play the game at all? Just train your AI, and go watch Netflix. Come back in an hour and see how many matches you won, and check how you're doing on the leaderboards.
     
  8. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    120
    "Oh, so your AI can mind-read/predict my actions and replicate my playstyle? Sounds cool. Does the collector's edition come with a rope?"
     
    Ryiah and Joe-Censored like this.
  9. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    741
    Better still, lets just make the whole game one great big QTE. Because the last thing a player wants when they play a game is agency, amiright?
     
  10. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Sounds like Google's Stadia thought of it first.
     
  11. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    I really hate rubber banding in multiplayer games. I guess this tech could give some really strange rubber banding effects.
     
  12. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    Reducing latency and improving performance are two very different things, though.

    If I get a better PC which results in less IO latency then I may get better overall results when playing, but my own performance is not improved. It is exactly the same. What has changed is the other parts of the system.

    Performance enhancing stuff already happens in plenty of games. Aim assistance is a classic example, as is cyote jumping. Basically what you're talking about here is aim assist algorithms which take some kind of "simulated muscle memory" into account.

    Is it possible to do well? No idea.

    Would I want it? If it somehow just figured out and magically accounted for system latency? Yes please. But if it also tried to 'enhance' my performance, no thanks.
     
    SparrowGS likes this.
  13. BennyTan

    BennyTan

    Joined:
    Jan 23, 2014
    Posts:
    141
    How much delay are we talking about here ? Accounting for wired keyboard/gamepad, system, screen etc... the total latency caused by the system is probably minimal assuming proper equipment? Eg, top tier arcade sticks and gaming keyboards have very very low latency, with anything below 5ms being considered pretty ok.

    If you are referring to human latency, as in their reaction time then... i probably would would not mess with it, as others mentioned, its feels like cheating? To me it sounds like recording a macro at pitch perfect timing (improving performance). I'm into vs/fighting games and no one, not even top tier players who can execute frame accurate gameplay can execute everything perfectly 100% of the time. As the saying goes, "S*** happens", and that's part of what makes gaming fun, and why you need practise. (At least for me, and i've taken part competitively in both FPS and VS tournaments).

    Also, you tend to factor these "latency" into your play in the form of muscle memory especially when you practice alot and become familiar with a piece of equipment. Having the latency change dynamically depending on what the AI predicts MIGHT be detrimental to professional play Eg, i play Guilty Gear and many characters have 3/4/5 frame moves, being off by 1 frame due to the AI and getting punished for that would be sucky. For me, consistency would be preferred... For the casual player, well i guess they might like it as it might improve their performance.

    For networked games there are some nice solutions out there such as rollback netcode etc depending on your needs and genre.
     
    Last edited: Jan 25, 2021
  14. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    Looking at stuff listed on displaylag.com, 20ms is considered "excellent", 40ms is "great" and 60ms is "ok" for monitors. So even if you're specifically targeting an audience who would search out and probably pay a premium for a low-lag monitor it could still eat up well over a whole frame at 60hz alone.

    Also consider that many renderers use render-ahead techniques, so what's sent to the screen is often a whole frame behind the current one, which uses input collected when it starts processing.

    So for a game running at 60fps you could easily see over 100ms of display latency on a PC.
    I think standard USB polling is 125hz, so unless there's processing to do it should be 8ms max and 4ms average input latency before doing any fancy "gamer" stuff to improve it.

    Optical mice are one obvious exception, as they need to analyse the image to determine motion before sending the results off. Which I must admit seems a little ironic to me, because I remember when mice where mechanical devices with a ball and rollers which got the same job done with effectively zero processing and therefore no additional latency. (I also remember having to clean them regularly and related issues, so I do understand why we moved away from them before people started caring about latency again.)
     
    BennyTan likes this.
  15. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    I would never buy a monitor with more than max 5-10ms inputlag.
     
    MadeFromPolygons likes this.
  16. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    What if we had choose "your own adventure" frame buffers, where the most probable player actions are rendered ahead then chosen based on input?

    In theory you would not need the whole frame for all actions e.g. player actions e.g. shooting could just be a foreground layer.

    It would be very easy to do with minimal frame rate drop for slow moving or static players e.g. Sniping/Camping.
     
  17. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,574
    You either are 100% sure or not. It seems like cause of more problems, jitters and unpredictability.
    Can you give single good use case, based on existing game titles?
    Just assure me 100%, you are not simulating cheating effect.
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    This is a nonsensical "what if". It clearly can't work if you think it through.

    First, it's self defeating. You're talking about drastically increasing sim and rendering workload in order to reduce time spent waiting on sim and rendering. And no, splitting to layers would add yet more complexity while potentially not helping much. And the dev time to implement this would be ridiculous, as would the additional memory usage.

    Second, putting the technical issues aside the stats don't work. Take a look at a histogram, aka "bell curve", and notice how the "most probable" value represents a tiny portion of the graph. That's just for one input axis - most games have many, and most games where people care are multiplayer. So even if you did make it work, it'd almost never do anything useful anyway.
     
  19. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Then could you explain how Google Stadia's Negative latency is going to work, as it sounds like they have figured something out?
     
  20. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,904
    Well, that's not entirely true. There was no processing latency as in image processing, that's true, but there was mechanical and photo-electronic latency. It was coming from two sources:

    - mechanical friction (or the lack of it): when the ball slipped on the rollers you experienced movement in one or both directions (x and y in the mouse) lagging
    - the inherit nature of the mechanical mice was that the ball rolled two rollers (horizontal and vertical), they rotated two discs with slots in them. The mouse was trying to shine a light through those slots, since the roller was rolling, sometimes it shined through, sometimes not, this changing of state gave the information to determinate if movement was made. Now, the size of the roller comparing to the slots was one source of latency (although a small one, we are talking about sub-millimeters) and from the photocell and depended on the quality of the photoresistor used.

    With that said, the mechanical was a killer one, everything else were small if a mechanical slip happened.

    Yes, I have a couple of dozens dismantled mechanical mice in the attic. When my newer trackballs misbehave I just bring it up to the mice-cemetery and show them what would happen if they don't work...

    ---

    Google Stadia is aiming for low latency-sensitive games and for casual gamers where the latency doesn't matter too much. They are also using a farm of servers and advanced machine learning to serve those casual gamers. And they are failing.

    I really wouldn't spend too much time on it, let Google do it. They have the manpower and the money to figure it out if possible. But counting on it right now, in our current tech, especially our _broad_ tech (including low-latency applications) is futile in my opinion.
     
    SparrowGS and Ryiah like this.
  21. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    I'm not saying that "negative latency" can't work. I'm talking about that specific proposed solution.
     
  22. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,792
    Shooting games..shooting games..shooting games.. play the whole game for you.. Umm. No.. Finding the tendencies one may have in any game play style can be patterned. If there is error correcting and predictions occur only a second or two into the future then it can be viable for many types of multiplayer games. There are other games than first person shooters..Ya wouldn't guess it by the answers here.
     
    Antypodish and Ryiah like this.
  23. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
  24. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,792
    Lots of people discuss all kinds of stuff that goes nowhere but does provide fodder for imagining. If yer not into imagining then stackexchange is a few sites over. Just as your thing seems to be critique and attacking the messenger, his gig is to promulgate something to do with games and the advancing tech. I frankly prefer the latter as the passive aggressive attacks can be found on any internet forum or comment section these days.

    Just a note of irony. I remember the OP posting about the use of the GPU in doing certain things in Unity,. A torrent of abuse was unleashed on him attacking the messenger saying never happen..bogus!! shutup dude!!. That week a German high maths and computer science major showed up and showed how he was doing just what the OP had promulgated and got shot down hard for. Heh. My irony meter had to go and get recalibrated. Many of the same folks chimed in here with false premises..everything is a shooter..play the whole game..shutup dude..