WebRTC Pong

Поділитися
Вставка
  • Опубліковано 12 гру 2021
  • Play the game: mitxela.com/pong
    Learn how it works: mitxela.com/webrtc-pong
    Support me: / mitxela or paypal.me/mitxela
  • Наука та технологія

КОМЕНТАРІ • 91

  • @djmips
    @djmips 2 роки тому +345

    I invented roll-back netcode in the late nineties when I worked making sports games (peer to peer). I prepared an article for the Games Gems book series in the network section but they rejected my article because they didn't think it was a good idea. I feel vindicated 20 years later by the comeback of this idea!

    • @dakedres
      @dakedres 2 роки тому +53

      I might need some proof of this haha

    • @davidpontius7031
      @davidpontius7031 2 роки тому +13

      Wow that sounds cool, you got any record of the article or the response? I'd like to see it.

    • @djmips
      @djmips 2 роки тому +32

      I think the idea is fairly obvious once you really sit down and try to solve this problem but it did take a long time for it to become more mainstream.

    • @mikiex
      @mikiex 2 роки тому +4

      Duke Nukem had client side prediction in the mid 90s

    • @DiThi
      @DiThi 2 роки тому +14

      @@mikiex When client side prediction is used, you don't really need to save the state of the whole world nor replay player inputs to achieve consistency. Many shooters of the time instead just trust the client: You saw the other player being killed by you and the server honors that experience even if the other player was just getting behind a wall and from their perspective you would have shot through the wall. The illusion usually works with first person shooters because people run forwards where they can't look sideways.

  • @DiThi
    @DiThi 2 роки тому +89

    The main hole punching technique was not explained here. It works as follows:
    - A and B gather the public IP and port of each other through a third party server.
    - A and B start sending packets to each other. Let's say A went first.
    - Packet from A to B is blocked by B's NAT because it was not a response.
    - Packet from B to A was sent to A because its NAT identified it as a response to the above packet.
    - Packet from A to B is also identified as a response. Hole punching is achieved.
    This only works in cone NATs, when the external port doesn't change for different destinations. This is typical of home internet connections.
    It doesn't work with symmetrical NATs, where external ports are different for different destinations, or with port restricted NATs that just block incoming traffic. Both are typical of some corporate environments.

    • @LaPoule1
      @LaPoule1 2 роки тому

      Well explained 👏

  • @riccardoiacob4560
    @riccardoiacob4560 2 роки тому +14

    > Start video
    > Turn brightness up
    > Get flashbanged
    > Become blind

  • @seth_deegan
    @seth_deegan 2 роки тому +2

    This should be called "how WebRTC works" not "WebRTC Pong". This was an extreamly good explaination and people who want to know how it works are missing out!

  • @bytesabre
    @bytesabre 2 роки тому +10

    Nintendo will probably C&D this just for mentioning Slippi

  • @archivushka
    @archivushka 2 роки тому +70

    When Mitxela posts a new video, you know it's aesthetical explanation of something unique

  • @TheR971
    @TheR971 2 роки тому +15

    I took a pause from making my board game implementation of Roads & Boats with webrtc support and saw this in my sub feed. Nice. (though since it doesn't need to be as hard realtime as pong it is easier, though there is simultaneous play as long as there are no resource conflicts but lambert clocks are good enough)) .

  • @Encysted
    @Encysted 2 роки тому +5

    I've always wondered about this. Thanks for making such an easy to follow explanation and tutorial!

  • @SakiandCo
    @SakiandCo 2 роки тому

    Excellent as always!

  • @hikingpete
    @hikingpete 2 роки тому +4

    I don't remember where I first encountered this. I had thought it was with AoE, but rereading "1500 Archers on a 28.8: Network Programming in Age
    of Empires and Beyond" reveals the first approach - delayed input processing. I guess that makes sense given how demanding the simulation would have been at the time. Maybe it was an FPS? Anyhow, this was a very nice presentation of the topic. Clear and concise.

    • @BattousaiHBr
      @BattousaiHBr Рік тому

      if i had to guess I'd say the first commercially successful implementation of rollback netcode was in some FPS game in the early 2000's.

  • @a52productions
    @a52productions 2 роки тому +18

    This is insane!! Rollback netcode is one of those ideas that really feels like it absolutely should not work at all, let alone as well as it does.
    Also, thanks for the explanation of NAT and port-forwarding! I always wondered why setting up a Minecraft server was such a confusing and anxiety-inducing pain, and now I know the reason, it's that the web is a confusing mess.

    • @TheBaldr
      @TheBaldr 2 роки тому +1

      A minecraft server setup is easy mode. About two months ago I setup a dedicated linux server for Satisfactory without much documentation the day dedicated servers were released.

    • @logandunlap9156
      @logandunlap9156 2 роки тому

      you’d have to be really lazy or really dumb to think a minecraft server is difficult to set up

    • @a52productions
      @a52productions 2 роки тому +2

      @@logandunlap9156 bruh i was 13 years old when i tried to do so, i didnt know what port forwarding was and i didnt have access to my router

    • @mariocamspam72
      @mariocamspam72 2 роки тому

      @@a52productions how did you set port forwarding up without access to router administration panel

    • @BattousaiHBr
      @BattousaiHBr Рік тому

      as someone that had to go through these tutorials years before working with networking, i can safely say the fault lies in the people writing these guides as they themselves barely know anything of what they're talking about.

  • @oleksiifisher8175
    @oleksiifisher8175 2 роки тому

    This video made me subscribe. Prime explanation, very entertaining. Thank you!

  • @Kriszzzful
    @Kriszzzful 2 роки тому +1

    great explanation. I wish you showcased a side by side comparison of p2p pong with and without rollback, maybe in slowmotion. It‘s really fascinating, I remember when project slippi hit the smash scene with rollback it felt like magic how all of a sudden the game ran as smooth as you were playong with someone on the couch right next to you

  • @Owl90
    @Owl90 2 роки тому

    Incredibly interesting and educating video. Thank you!

  • @Masterball777
    @Masterball777 2 роки тому +5

    Love this channel but man would "Rollback Netcode Pong" be a more eye-catching title.

  • @parmsib
    @parmsib 2 роки тому +3

    I started laughing when he mentioned Smash Bros. I KNEW this was heading to Slippi-ville when he started explaining the cons of delay based netcode and mentioned combos :D

  • @illford6921
    @illford6921 2 роки тому +37

    We have Rollback Pong yet some fighting games still ain't got it

    • @hexane360
      @hexane360 2 роки тому +11

      I know you're being funny, but rollback code is one of those things that's very easy to add up front, by treating your game state immutably or making state updates through a consistent interface. It's almost impossible to retrofit to code designed in other styles

    • @enricuhl
      @enricuhl 2 роки тому +2

      The GameCube smash bros mod slippi would like a word

    • @logandunlap9156
      @logandunlap9156 2 роки тому +3

      @@hexane360 Guilty Gear XX AC+R, Blazblue Centralfiction, and Blazblue Cross Tag all now have rollback. If it was “impossible” as you say to upgrade games from delay to rollback, ArcSys wouldn’t have done it 3 times.
      Rivals of Aether is another game that was delay-based for a long time and eventually received rollback (iirc, i think it was upgraded to rollback with definitive edition, i could be wrong and it may not have it yet). And that’s with an indie team.
      As another commenter mentioned, Slippi is a fan made tool for Smash Bros Melee, that added rollback to a game that didn’t even have online, let alone design with online in mind.
      idk man seems pretty possible to me, the future seems quite bright for rollback retrofits

  • @sunglow9835
    @sunglow9835 2 роки тому +4

    WOW I never thought I'd hear someone quote "the internet is a series of tubes" in 2021, what a throwback!!

  • @lorenzoporciani
    @lorenzoporciani 2 роки тому +8

    What's the minimum spec to run that? :P
    Maybe I could play it from my 8088 xD

  • @polecat3
    @polecat3 2 роки тому

    0:50 That's my favorite pen!

  • @silent-science
    @silent-science 2 роки тому

    what a genuinely beautiful video. Thank you for this contribution to human history

  • @omegasalmonfish
    @omegasalmonfish 2 роки тому +14

    Interesting! I want to see a game played with a really bad connection now. Will the ball suddenly change trajectory in the middle of the court?

    • @LuisHansenNH
      @LuisHansenNH 2 роки тому +3

      With rollback implemented, yes, but the input lag will be reduced.
      With its current implementation, no, every motion, including the ball, will be perfectly smooth and synced among the players, but the input lag will take a big hit. So you'll move your cursor and the pad will move a couple hundred milliseconds later.

    • @BattousaiHBr
      @BattousaiHBr Рік тому +1

      yes.
      one of the disadvantages of rollback is this rubberbanding effect.
      however, it must be stated that the disadvantages are massively better than the delay-based alternative for anything that is latency sensitive.

  • @lord_danku3844
    @lord_danku3844 2 роки тому +4

    I shall play Pong post haste

  • @TMinusRecords
    @TMinusRecords 2 роки тому +1

    Would be a great feature having a list of available games to join

  • @whynotanyting
    @whynotanyting 2 роки тому

    mitlexa: uploads
    neurons: fired

  • @Meikulish
    @Meikulish 2 роки тому +1

    I'm really getting called out as a samus main in a mitxela video. I thought I was safe here!!

  • @AlexApol
    @AlexApol 2 роки тому +1

    I work for a small isp. the internet is indeed a bunch of tubes held together by duct tape 😔

  • @chakflying1
    @chakflying1 2 роки тому +4

    Unfortunately it doesn't look smooth on my 100Hz monitor. I guess the reason is that the physics tick rate is slower than the render tick rate, hence creating a lot of jitter.

  • @ryandikdan
    @ryandikdan 2 роки тому +1

    Project Slippi is an incredible achievement

  • @blattoid
    @blattoid 2 роки тому +1

    Neat!

  • @t0biascze644
    @t0biascze644 Рік тому

    15:55 idk smash Bros just slows down to like 5fps when there is bad lag... So you have even more time to react

  • @mathgeniuszach
    @mathgeniuszach 2 роки тому

    This is cool, but what happens if a packet is dropped? Do you repeatedly send packets of the same type until you get a response to guarantee that the packet is received? Also, what happens if the rollback deficit becomes too large, do you just get buffers that continue to get bigger until rollback successfully occurs? I honestly don't understand how you could possibly sync something like that accurately.

  • @spaceshipable
    @spaceshipable 2 роки тому

    It's interesting that port forwarding was always necessary for setting up minecraft servers. That's at least where I first heard of it

    • @TheJamesM
      @TheJamesM 2 роки тому

      Given that it's not only a game, but also a server, it's to be expected that you'd need to do port forwarding to run a Minecraft server. You need to be able to advertise your server on a particular port so that clients - with whom your computer might never have communicated before - can connect to it. Your router needs to know not to throw away traffic coming in at that port, and which device to route it to (the machine running the server). That's what port forwarding is.
      It's been necessary for some games in some set-ups ever since people have had routers in their homes (which is ever since they've had more than one Internet-connected device in their homes), but if you're running a home server (of any sort, but particularly a game) you're pretty much guaranteed to have to forward some ports.

  • @capability-snob
    @capability-snob 2 роки тому

    Wow, that sounds easy to exploit. Presumably there's a threshold past which you just go "nope, no takesies-backsies"? Especially in the case of pong where it's fairly easy to declare that the side the ball is on is the authoritative side.

  • @kivylius
    @kivylius 2 роки тому

    can we get one with 3 plays, e.g high card, low card.

  • @falxie_
    @falxie_ 2 роки тому +1

    I think this is both how Rocket League and Overwatch do rollback from what I've seen of their GDC talks

  • @ff4enjoyer
    @ff4enjoyer 2 роки тому +2

    Here's the extreme example of rollback failure. The only "fair" netcode is the local VS mode
    ua-cam.com/video/gRibc2_vplk/v-deo.html&ab_channel=brawlpro
    P.S. For non-Tekken people: you have to confirm the hit that got "rolled-back". On hit there's a guaranteed combo. On block the opponent gets free combo on you.

    • @BattousaiHBr
      @BattousaiHBr Рік тому

      not to nitpick but delay-based with artificial latency on the host is perfectly fair as well.
      fairness is not the only metric to care about if the game is unresponsive.

  • @tituslafrombois1164
    @tituslafrombois1164 2 роки тому +1

    Nintendo should watch this video.

  • @gljames24
    @gljames24 2 роки тому

    I'm having some issues creating a match on the website.

  • @h2_
    @h2_ 2 роки тому

    How much do things change, rollback-wise, when more than two players are involved?

    • @BattousaiHBr
      @BattousaiHBr Рік тому

      if there's a central server, nothing at all.
      if one of the players is the host, I'd imagine the host to be perceived differently than other players.
      and thinking about it now, it is technically possible to run a mp2mp full-mesh topology, but as far as i know nobody ever implemented anything like this likely due to exponential bandwidth requirements.

  • @sobertillnoon
    @sobertillnoon 2 роки тому

    Wouldn't that rollback net code result in projectiles appearing mid-flight?

    • @Blustride
      @Blustride 5 місяців тому

      With enough rollback and low enough startup, yeah. If you have that much rollback you have other problems

  • @WesYarber
    @WesYarber 2 роки тому +13

    Why do I have a feeling this whole project was born out of hurt derived from smash ultimate
    Edit: Finished the video. Yup

  • @RST_Omega
    @RST_Omega 2 роки тому +3

    every single fighting game dev needs to watch this, how can people make browser games that are passion project and give them rollback netcode but capcom can't put GGPO into SFV because it's "too expensive", they also had someone put out a fix for their netcode on PC and they actively went out of their way to stop it from working

  • @rokushou
    @rokushou 2 роки тому +4

    Is rollback netcode what lag switches exploit? Depending on the game, a player "occasionally stuttering" may be more unfair than everyone having increased input lag. I know certain games where having a bad connection, whether intentionally or not, gives you an advantage.

    • @logandunlap9156
      @logandunlap9156 2 роки тому +4

      a lag switch is more annoying in delay-based netcode because everyone loses control of their characters
      a lag switch could be unfair in rollback because you’ll see it in the form of rubberbanding on the characters which will make it hard to keep track of them

    • @rokushou
      @rokushou 2 роки тому +2

      @@logandunlap9156 Yup, the rubberbanding is what I'm referring to. It can be super unfair playing against those people because hit detection gets messed up from the perspective of your screen and they can instantly do huge bursts of damage to you when the game syncs.

  • @kayezero703
    @kayezero703 2 роки тому +1

    جميل

  • @m4rt_
    @m4rt_ 2 роки тому

    I haven't watched everything yet, but from what I've seen, it might leak players ip address.

  • @TheBaldr
    @TheBaldr 2 роки тому

    "...mix of characters that are perfectly balanced..." Just so I am on the same page, you are talking about Smash Bros????

  • @jaedenvanderberg3890
    @jaedenvanderberg3890 2 роки тому +1

    .

  • @ArnaudMEURET
    @ArnaudMEURET 2 роки тому +1

    Nice presentation! It’s a shame though that Pong gets the honors again. It was stolen from from the Odyssey console by Atari (namely Nolan Bushnell) and should really be in the hall of shame of our industry. The credits for “Table Tennis” goes to Ralph Baer, the creator of the Odyssey. Bushnell even tried to deny it and downplay the importance of the Odyssey. Even after losing multiple lawsuits. A despicable human being in my book.

    • @logandunlap9156
      @logandunlap9156 2 роки тому +1

      cool fact but honestly i feel like you’re splitting hairs here. we all know “Pong”, not “Table Tennis”.

    • @ArnaudMEURET
      @ArnaudMEURET 2 роки тому

      @@logandunlap9156 Exactly! Pong is the one that got all the light despite being basically plagiarism. I don’t condone patenting. But Bushnell’s pathetic attempt at rewriting history for his personal fame is abhorrent.

  • @Subroutine2
    @Subroutine2 2 роки тому

    random comment

  • @xnc2t283
    @xnc2t283 2 роки тому +1

    As a player, rollback is way worse - it's the culprit in rubberbanding. Also it allows lag switches to be useful (this is bad).
    Let me give an example, using Pong;
    Player 1 is heading the wrong way, away from the ball. They begin lagging.
    Player 2 sees player 1 _miss the save,_ continuing along their current trajectory based on previous inputs or random inputs.
    Player 2 returns to center to wait for the next save.
    Lag ends - Player 1 dodged towards, and caught the ball. The game state is reset to pretend that that always happened; _player 1 rubberbanded._ And now, suddenly the ball is zipping along an unpredictable trajectory, deep in Player 2's territory, nowhere near them.
    In essence, rollback netcode;
    * Allows rubberbanding
    * Makes lagswitches useful
    * Punishes higher-ping players in favor of lower-ping players.
    *This* is why it's not used in quality titles.

    • @Blustride
      @Blustride 5 місяців тому

      Are these quality titles not using rollback in the room with us right now?
      If you have so much rollback that it’s affecting your decision making that dramatically, no netcode is going to make that connection playable.

  • @dave-im9hi
    @dave-im9hi 2 роки тому

    I love mitxela but I can’t respect him now that I know he plays bowser. Sadly I must unsub :(

  • @babylonfive
    @babylonfive 2 роки тому

    I LOVE YOU SO MUCH, but that was a lame NAT explanation, for sure. 8 (