I Made Multiplayer Gamedev EASY!

Поділитися
Вставка

КОМЕНТАРІ • 102

  • @bnaZan6550
    @bnaZan6550 Рік тому +189

    Tip: never use strings as keys in network messages, use constant numbers or enums, the equals or hashcode operation is much faster and it's a smaller packet to send, while still being readable in code

  • @willwillcode7568
    @willwillcode7568 Рік тому +58

    It’s actually fun watching his amazing progression over the years! Good job man!

  • @SuadoCowboy
    @SuadoCowboy Рік тому +13

    good to see you learning while also teaching us some useful stuff(I rarely see something this good about networking and games)

  • @edwardrivera8936
    @edwardrivera8936 Рік тому +12

    Very impressive and very informative. I am sure whenever you are ready to open source the code, the community will be there to assist with making it the best it can be. Plus it would be awesome to see what else can be done with your network framework.
    I work in python but have not done anything with sockets except for some book tutorials but you really do make python game design shine! Keep up the awesome work!

    • @glitchedpixelscriticaldamage
      @glitchedpixelscriticaldamage Рік тому +3

      Now I'm not sure i understood correctly, but from what he explained, his net framework is not really that advanced and it uses a central server.
      Second thing from what he described he tried, csv-like-data or the json-data... it sounded like he just discovered the concept of IPC , in this case network IPC, maybe just my own interpretation of what he described he did.
      Anyway... as yourself said, good progress, nice looking game for 1 dev and made in python. it is pretty amazing.

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +5

      The earlier networking concepts were from 5+ years ago.

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

      Sorry , but i do not understand what you mean... by 5+ years ago, IPC as in network communication between 2 or more processes was invented in the 60's. Not 5 years ago.
      2 processes communicating over the network is a form of IPC.
      At a high level like app layer you can create any "protocol" be it using existing http rules or your own csv or json or whatever else does not matter.
      Anyway, again does not really matter, even if it is clear to me you did not learn this in a structured way it is amazing that you did create all these games nonetheless which look very good. So, good job.

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +6

      I was saying that the stuff you were complaining about was what I was making 5 years ago. lol
      I have a lot more experience now.

  • @Evoleo
    @Evoleo Рік тому +2

    Great video! I have actually been developing my own multiplayer framework for a couple years now, except mine is for GameMaker and Node.js instead of Python and it uses classic messages and responses, but the shared objects approach sounds in fact very interesting!
    Thank you for your unique insight from a fellow multiplayer development enjoyer haha
    This sort of content is incredibly rare to come across on UA-cam

  • @sudipbasak-m7y
    @sudipbasak-m7y Рік тому +6

    please create a full online game dev course

  • @SquirrelTheorist
    @SquirrelTheorist Рік тому +2

    Honestly, this almost rivals MariokartDS even. The quality and camera control looks amazing. I can't wait to see when this releases. Thank you for the epic gamedev video!

  • @diamondwhite5208
    @diamondwhite5208 Рік тому +6

    As an aspiring game dev,you and others like you inspire me a lot
    And I hope I get to the same skill level as you one day.

  • @seyproductions
    @seyproductions Рік тому +2

    Love the explanatory art! Makes it easy to understand what you are talking about somehow while being funny xD

  • @tomsterbg8130
    @tomsterbg8130 6 місяців тому +1

    I always took multiplayer for granted simply because I learned game dev with Roblox Studio, but now I'm switching to Godot after 6 years and I plan to stay with Godot for at least 10 years since it's a direct upgrade from Roblox Studio and seems to pick up popularity for a reason.
    You are constantly inspiring me because I know how difficult it is to use code from scratch by making your own assets/libraries in order to abstract stuff. Every abstraction has to be well thought out or modified for every project.

  • @sercrets9531
    @sercrets9531 Рік тому +2

    Say it with me guys: "Release, Release, Release, Release, Release"! Nice work, keep it coming!

  • @mr_minepiesek
    @mr_minepiesek Рік тому +4

    I just can't wait for your network framework

  • @FlareGunDebate
    @FlareGunDebate Рік тому +3

    I plan on making a web based game and I was curious about the particulars. This is great information. Thanks for sharing.

  • @emperor8716
    @emperor8716 Рік тому +5

    this dude is a genuine genius man

  • @KubinWielki
    @KubinWielki Рік тому +5

    Great video, and a cool game cooking up!
    Entirely unsolicited idea: Perhaps consider turning that "oil spill" power-up from a small puddle, into a line that your kart spills over the course of 1-2 seconds, that carries the kart's momentum. That'll require some driving skill from the player, but also be more rewarding to use if they choose to deploy the oil while drifting, to strategically cover more area behind them.

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +5

      I'll be keeping oil spills the same, but that could be an idea for a different item.

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

      @@DaFluffyPotato Sweet! Variety is spice of life, as they say :D

  • @walkingpuppy3282
    @walkingpuppy3282 Рік тому +15

    I gotta say this game is really fun and the idea of making a networking engine in python sockets is just crazy I'm waiting for the next playtest and the game to be released, quick suggestion i like the trees in the field you should make palm trees too in the pirates docks map and the mushroom trees from drawn down abyss in the volcano map.

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

    I would never had imagine that you had dabbled with HLA, thats awesome! Best gamedev content on youtube!

  • @sweettea-hv1ls
    @sweettea-hv1ls 9 місяців тому +1

    It is definitely easy to make multiplayer games if there are no high-level physics interactions and not a lot of units/npcs/projectiles and no fast-paced competitive games. Once you are making the next rocket league, valorant, or starcraft, you will be faced with a lot of pitfalls on current free technologies.

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

    Nice choice of ports!

  • @rx97_mc
    @rx97_mc Рік тому +2

    I had no idea you were in troy's videos lmaooo, GOAT

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +3

      My friend and I were messing around with alts as Logan and Jake Paul and happened to end up in some of his games. lol

  • @ProteusWasTaken
    @ProteusWasTaken Рік тому +2

    A True Pioneer.

  • @hermit97
    @hermit97 Рік тому +2

    I have a solid carrer as a python data engineer, but every time I watch your videos I have the desire to retire and become a python / godot game developer XD. Keep going, your content is awesome.

  • @therayvenn3482
    @therayvenn3482 Рік тому +2

    i love you so much

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

    The game is so beautiful! Wow

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

    currently im not programing but since i started with python, watching this channel motivated me to make games and continue with python...

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

    Is Pixkartz inspired by Circuit Breakers for the PlayStation by any chance? Man, what a fun game that was.

  • @adam-the-dev
    @adam-the-dev Рік тому +1

    Wait why is TCP preferred? Doesn’t that incur a ton of bloated network handshaking? I would have expected UDP? But I’ve never built a networking framework.

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

      TCP is fine in most cases. People overestimate the overhead.

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

    Would you like to share some resources to learn these sort of networking optimizations, I am planing on building a game server with python but everyone keeps telling me its sloww.

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +2

      It's mostly intuitive, I didn't use any resources for it. The main mistake people make is putting the netcode and the game code on the same thread, which is a hard bottleneck.

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

      @@DaFluffyPotato oh that's a nice advice, thanks

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

    can you make a new pygame shader tutorial / update the existing one to be adapted for Macs? Great video!

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

    This is awesome and reminds me of Rock n' Roll Racing.

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

    Oh my... make a Lobby with all ppl riding the car just for the fun BUT all cars are ghosted so you can't bump into each other ... make a Lobby to have fun XD

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

    Can’t wait to see a release of this library :) oh and the game aldo

  • @eboatwright_
    @eboatwright_ Рік тому +4

    Very cool! I've never used Python for multiplayer games, although I'm currently working on a small MMO in Dart :)

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

    Your networking solution sounds like you implemented your own rpc?

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

    What design patterns you use the most?

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

    Dude great work

  • @alteredorange
    @alteredorange 9 місяців тому +1

    @DaFluffyPotato is there any client side prediction and interpolation? Or all updates are just done by the server? Thanks!

    • @DaFluffyPotato
      @DaFluffyPotato  9 місяців тому +2

      There's interpolation, but no prediction. I prefer the simplicity of no prediction (it also looks cleaner).

    • @alteredorange
      @alteredorange 9 місяців тому

      @@DaFluffyPotato gotcha! Looks cleaner code wise, or racing wise?

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

    Have you considered using a free oracle server for it? I hear you can run a Minecraft modpack survival server on one

  • @electricimpulsetoprogramming

    how do you deal with progamming burnout?

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

    A new video🥹

  • @therayvenn3482
    @therayvenn3482 Рік тому +3

    have my children

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

    Can u pls make a video on your planet shader

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

    hello. how did u actually start game dev? did u do any cource or r u self taught

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

    What if you run server in PyPy insteaf of Cpython? Wouldn't that significantly improve performance?

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

    I'm not sure I agree that 100 players per server is very scalable, but the game seems enjoyable. I'd consider possibly using native socket bindings or a library which does so. Even in python, however, 100 seems low. I suspect that attempting to generalize different patterns of sending and receiving has led to over-sending. It's either that or you could be over-sending a very frequent packet, possibly sending all players' positions to everyone every tick. If so, limiting what is sent to what can be seen by each player can help if the cost of that calculation is less than just iterating and sending to all players. A simple solution could be to subdivide the map and only send changes which occur in the regions surrounding the player. I'm also not sure that you fully explained the packet structure, but I noticed that you said updates are streamed as bytes, which is good to begin with. However, if the bottleneck is the server, and not via over-sending, then I would suggest stripping every packet to it's barest minimums and to try to be using the smallest data types for everything possible (e.g. sending floats over doubles, shorts or bytes over ints), however I'm not sure how possible that is in python. It's also worth noting that Python may be coaxing you into allocating much more than is necessary, as is the case with most languages, but it's probably possible to write it with less allocation without many sacrifices in code quality.

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

      1. The servers are very cheap. Just a single core for processing. 2. Every player in a racing game lobby needs to know every other player's location for minimap updates, so 100 is a lot. It can be optimized, which is why I mentioned optimization. 3. As mentioned in the video, everything already is compressed down to the base datatypes since there's only a couple types of messages being sent. Overall, I'd say handling thousands of active players on less than $100/mo is pretty good. The same servers I'm using can't even run a Minecraft server with 2 people on it without the tickrate dropping. Keep in mind that renting even a low end VPS is quite expensive compared to running one yourself.

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

    Why would you use TCP for a real-time game..

  • @tkjo64
    @tkjo64 2 місяці тому

    im not sure if th game is 2d or 3d

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

    Neat! So clients actually push shared state updates in this system rather than having state changes being purely server-authoritative? (Presumably there's some kind of anti-cheat logic to prevent clients from pushing bogus updates?)
    Is server/client state desync ever a thing this system needs to deal with in that case, or does it just kinda trust TCP to do its thing correctly? (Or are all updates just purely idempotent in a manner such that that wouldn't actually matter in the long run?)

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

      In optimal cases, the server is pretty much just forwarding the updates to clients authorized to see them. Anticheat would basically proofread the updates and block them if necessary. Clients work with whatever the latest data is. TCP should make it so updates aren't dropped (only sometimes delayed), but if it's really important, you can add in some extra steps to make 100% sure something was received.

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

      @@DaFluffyPotato Cool stuff. I'm mostly curious because in my experience anti-cheat logic for dropping bogus packets that can contain arbitrary updates can sometimes get a little bit insane depending on the game lol. The engines I've been working with recently simplify that a little by only accepting forwarded I/O inputs from the client (rather than actual state updates), and having state updates only being computed on the server and pushed to the clients, but that kind of architecture leads to a whole bunch of other complications that you then need to design systems to compensate for...
      IMO having a shared state model is definitely the right move in any case!

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

      Games that need a 100% server authoritative model base on IO are usually structured much differently overall, but yeah, the shared object abstraction could still be used for it.

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

    This is very interesting! Looking forward to see how your game and framework take shape. Also, is that the GBA Bowser Castle map in your game 😳

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

    Do you host your own server or where is the server code running

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

    Great video!
    I've been wondering if you will do a tutorial series on Godot 4 game engine?

    • @DaFluffyPotato
      @DaFluffyPotato  Рік тому +2

      No because I don't have much experience with Godot at the moment.

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

    Hi, did you rent a server, or did you use your own computer as the server?

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

      Both work, but I rent

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

      @DaFluffyPotato I wanted to use my own computer as a host to play with my friend who lives in another neighborhood. I'm just afraid a hacker would be able to get access to my machine.

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

    Do you try to implement rollback netcode?

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

      That would exist at a higher level than the framework.

  • @costelinha1867
    @costelinha1867 Рік тому +3

    As always, your projects are insane.
    I just wish I could get out of my coding burnout already. I guess I'll just have no choice but to try to force myself into working on my projects again, otherwise they'll never be finished.
    Although I'm kinda lost to be honest... I don't know if I want to make a game now, or if I want to do web development as my next project, or just some other thing like networking..... I'm not sure if you or anyone here can relate to that, but damm it sucks. I was so confident after finishing a computer science course, so happy, but now I can't bring myself to work on anything lol.
    But enough of my personal problems, this game looks so good. Will you ever make a video showcasing your networking stuff, or a basic tutorial on networking like you did with pygame + opengl?

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

      I'll probably make a tutorial for my networking framework if/when I release it.

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

      @@DaFluffyPotato Thanks.

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

      ​@costelinha1867 are you Brazil costela? I passed through the same phrase as you, try to do something different like a sport, don't force it.

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

    I didnt understand much... but it's been beautiful

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

    Listen bro, You might change python multiplayer forever, as soon as you publish it pls drop some tutorials bro🙏

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

    Sugoi

  • @Jim_96504
    @Jim_96504 9 місяців тому

    Did you not consider UDP even once?

    • @DaFluffyPotato
      @DaFluffyPotato  9 місяців тому

      I believe I mentioned it in the video, but there's not much of an advantage. TCP mostly just causes slowdowns when packets are out of order or corrupted and need to be resent. If I want packets in order and guaranteed to be received, I'd just be writing that myself for UDP which would be more tedious and slower.
      If you watch the playtests, the networking performance is fine.

  • @spenceabeen
    @spenceabeen Рік тому +2

    Gonk :D

  • @프로즐겜러-u7b
    @프로즐겜러-u7b Рік тому

    if you can write in korean, please write korean subtitle.
    But it isn't here, I will see your video because it is very useful for me

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

    W rizz 🗿

  • @Andres-gq3zp
    @Andres-gq3zp Рік тому +1

    first

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

    :D

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

    5s ago lol

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

    Second

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

    First comment

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

    lol, python game dev

  • @童貞翻訳サービス
    @童貞翻訳サービス Рік тому

    first