I "Just Added Multiplayer" to My Game

  Рет қаралды 34,033

DaFluffyPotato

DaFluffyPotato

Күн бұрын

Пікірлер: 90
@TheGonzaDev
@TheGonzaDev 5 ай бұрын
I wish the "Just add Multiplayer" button was real
@modernmage
@modernmage 5 ай бұрын
*Puts code into chatGPT version 8 in 20 years* Prompt: "just add multiplayer" ChatGPT: "umm... no i still cant do that"
@Gwizz1027
@Gwizz1027 5 ай бұрын
Roblox
@adriandeveraaa
@adriandeveraaa 5 ай бұрын
Even then adding multiplayer is just one part of the battle. Ensuring your game isnt exploitable is another.
@GameJam230
@GameJam230 5 ай бұрын
Gamemaker is probably the closest thing to getting to that point, but unfortunately new updates to it have been delayed until after the release of GMRT (the new Runtime), and it will only be directly supported for Opera GX web games at first, other platforms coming later. But the way they implement it takes a LOT of the responsibility out of developers by just treating the extra player instances as any other object, so as long as you can code local multiplayer with controllers, accounting for player instances being dynamically created or destroyed, you can use their rollback multiplayer system. The only issue to account for currently is that players can't have any data that affects functionality set BEFORE the multiplayer game starts (so for example, a game where you can create a character and then join any world with them, keeping your inventory and upgrades, like in Terraria), as it doesn't allow for that pre-synchronization of data yet, as it assume that ALL players have the same game state upon start so that it only needs to send controller inputs to other clients, and all copies of the game will simulate the same code, rolling back the game if a desync occurs. Despite its flaws though, it will be easy for everyone to implement.
@FriedMonkey362
@FriedMonkey362 5 ай бұрын
You kind of can, in steam if you have a couch multiplayer game wich supports multiple players all you have to do is check a box to enable it, Cuphead has it, its called remote play i think
@owencmyk
@owencmyk 5 ай бұрын
This is incredibly impressive. I think the closest thing to a "just add multiplayer" button you could get would probably be rollback netcode, as it only technically requires the ability to save and load the state of the game, as well as the ability simulate 1 frame. Ironically however, implementing rollback netcode in practice is FAMOUSLY one of the most difficult things in game development due to the serialization and optimization required and it's only really been done well a handful of times
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
Rollback can't be generalized. It by definition requires an algorithm to reevaluate a separate set of events. The shared objects method I used gets pretty close, but realistically you still want to use abstractions to reduce bandwidth usage and improve the feel. An engine/game-specific shared objects system is about as close as you can get (Roblox would fall into that category I think).
@shenanicode
@shenanicode 5 ай бұрын
​​@@DaFluffyPotatoit can, using ECS. Saving, rollbacking, and serializing entities and data in sparse set ECS is so simple and fast that you can forget another approaches altogether. While building one in a robust and manageable way is a challenge, now I can prototype games without using rollbacks, and then just substitute my storage to one with rollbacks
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
I haven't looked into rollback much, but I thought the reason people said it was complicated was because it's not simply changing the state of a single object. I think you would have to reevaluate the side effects of a rollback within the rules of a game, which requires thought in how undoing certain events should behave with your specific game (similar to how my AttackSchedule object cannot be automatically networked due to how it's implemented with the game design). The best rollback technique probably varies by game design.
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
Apparently GGPO exists as probably the most credible attempt at making a framework for rollback, but it hasn't really been adopted (it sounds like it's because it didn't generalize well enough). www.reddit.com/r/Fighters/comments/lzvkhm/question_why_do_devs_feel_the_need_to_build_in/ GGPO seems to force you to write your code in a very specific way, so it's the opposite of plug-and-play.
@shenanicode
@shenanicode 5 ай бұрын
@@DaFluffyPotato yeah, a history based on a commands with undo/redu is very hard to maintain. But you can just save the whole game state every N-th game tick, and rollback to this state whenever you want. If implemented efficiently, saving works really fast. In sparse set ECS there is a simple Array.Copy call for each set of components. Both for saving and rollbacking. Overall, prediction-rollback do not require writing any netcode in the game simulation itself. It just works by design. The concept is simple, but it is hard to implement it in a simple way. Especially if you want to achieve input-only bandwidth for your networking - a superpower of prediction-rollback netcode
@cupofdirtfordinner
@cupofdirtfordinner 5 ай бұрын
i really appreciate how in depth you talk about code, absolutely nobody else does this the way you do. I'd argue this is better than a sebastian lague approach because you still talk at some length about a game with the primary intention of being fun, rather thana vehicle for (albeit cool) experiments. probably the best devlog ive seen since Rujiik the Commatose last uploaded
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
I try to make my devlogs more informational than entertainment relative to the average out there. Although it's a tricky balance to get right. Also, most things I work on wouldn't even make an interesting devlog from that perspective, so it's quite tricky.
@ZaeNonQ
@ZaeNonQ 5 ай бұрын
"just add multiplayer nothing could go wrong!" - junior developer
@bigwhoopgames
@bigwhoopgames 5 ай бұрын
Great video and glad I could help! I really liked your explanation of attack scheduling, good to keep in my back pocket for a later optimization. Keep up the good work!
@beeleaveme
@beeleaveme 5 ай бұрын
I'm here racking my brain to understand blueprint in the UE, meanwhile the guy creating framework, making holes in the moon through codes. Life is hard
@boxhead-zk7sn
@boxhead-zk7sn 5 ай бұрын
i am boxhead 0:57, great video and it was a nice playtest but i got last place 🤣🤣
@stickstick8903
@stickstick8903 5 ай бұрын
the next best thing would be to implement local co-op, then enabling remote play on steam by checking the box
@GameJam230
@GameJam230 5 ай бұрын
Really, the only way to make a "Just Add Multiplayer" button would be to develop the game with distinct client and server instances, even in singleplayer, like Minecraft does. Even in a singleplayer world, the game has two separate processes to handle what the player sees, versus what the game THINKS you should see, and that makes it pretty easy to expand into a multiplayer format. Tbh, it's probably a good way to look at game development, and game engines could probably even look at that approach being the default in the future.
@DemidCode
@DemidCode 5 ай бұрын
good video, you made multiplayer a lot easier!
@AetherXIV
@AetherXIV 5 ай бұрын
oh you are super smart. I'll move along and say good luck.
@ThinkWithGames
@ThinkWithGames 5 ай бұрын
This looks really impressive! It's always cool seeing other developers who use python and similar whitespace languages (like gdscript) as their preferred language!
@gamerzero6085
@gamerzero6085 5 ай бұрын
yeah i agree it's cool to see whitespace languages being used. especially if it's elixir, ocaml or haskell.
@ConfidentlyRong-jo5yt
@ConfidentlyRong-jo5yt 5 ай бұрын
Amazing job! Love the tree animation :)
@capsey_
@capsey_ 5 ай бұрын
I love art style of your games
@cmbaz1140
@cmbaz1140 5 ай бұрын
So many games in the works ...its nice to see
@SeanStClair-cr9jl
@SeanStClair-cr9jl 5 ай бұрын
This is fuckin awesome!!! Also wow I love your camera control!
@StormwreckerOfficial
@StormwreckerOfficial 5 ай бұрын
Great content! You cover so much unique material! I was wondering if you could do a plain generic multiplayer tutorial? One that would be adaptable for any genre of game? I notice that you don't use socket, but I'd still like it to cover a TCP multiplayer framework. I can't be the only one out there with the same question, and it would be extremely useful if you were able to do a video on how to do one. Thanks again for all your great content, and keep up the good work!
@codecaine
@codecaine 5 ай бұрын
Excellent content!
@6IGNITION9
@6IGNITION9 4 ай бұрын
Super cool! Multiplayer doesn't take as much work as people think! (Especially since the same people routinely spend 3-5 years working on a single-player steam game nobody plays...) For example, I made a PVP game for a game jam in 48 hours earlier this year. (Probably 15-20 hours of actual work?) The logic was entirely client side, the server just forwarded messages: I think this architecture is called "brokered p2p". Anyway, since all the logic was on the clients, someone figured out how to hack it within literally 15 minutes of launch. He spawned infinite bullets in a sine wave. Good times XD The benefits of client-side logic are (1) simple (2) responsive. The downsides are security and inconsistency (different people see different things based on lag). You can make it purely server-side, which keeps it simple, and solves security and consistency. But then the input latency gets very unpleasant the farther you are from the server. That can be ameliorated somewhat, but at that point you get into input prediction, rollback, and all manner of complications. (And your "reward" for all this work is that the game looks a lot more glitchy when input mispredictions occur...) The simplest solution I've come up with is to keep the pure server side logic (i.e. thin clients, just send inputs and render world state) is to just have a separate server in major population centers, to keep ping
@RugbugRedfern
@RugbugRedfern 5 ай бұрын
3:55 The biggest issue I've had with scheduling things like this is players' system times not matching exactly - for example sometimes players would manually change their system time which would result in issues where scheduled events would never occur. Steam provides an API for getting a server-side unix time independent from system time, but it is only accurate down to the second. How did you manage to solve this (or did you not encounter it)? 🤔🤔
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
The networking framework I wrote has built in time synchronization (accessible through a framework property). It starts at 0 when the server starts up instead of being unix time, but getting the correlation would be easy as well. It uses proper approximation techniques to estimate it within a couple milliseconds on a stable connection as well.
@RugbugRedfern
@RugbugRedfern 5 ай бұрын
​@@DaFluffyPotato That's really cool! Do you have any resources on the approximation techniques? I'd love to do something like that for my own multiplayer games
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
NTP uses a variation of Marzullo's algorithm. I took some of those ideas. I think my technique used multiple samples and estimated based on the ping of the samples with the fastest responses, which works under the assumption that the fastest responses are least likely to have asymmetrical trip times.
@RugbugRedfern
@RugbugRedfern 5 ай бұрын
​@@DaFluffyPotato Awesome, I'll try implementing that when I rebuild my networking solution :)
@SeriousGamer-pi7kw
@SeriousGamer-pi7kw 5 ай бұрын
I recommend using a different music or making it quieter, but it makes it a bit confusing for me when I try to focus on what you are saying. Otherwise, very interesting Video, thx for making it!
@robotinfluence
@robotinfluence 5 ай бұрын
Great work, I imagine you dream code at this point.
@samSosiska
@samSosiska 5 ай бұрын
9 years of gamedev, potato
@Hetkinsonn
@Hetkinsonn 5 ай бұрын
Just make the game better, game would be better
@thatoddshade
@thatoddshade 5 ай бұрын
yeah, just put that goodness slider all the way to the maximum.
@ZevALT
@ZevALT 5 ай бұрын
DaCutiePotato: I added Silly Mode to my game :3
@That_0ne_Dev
@That_0ne_Dev 5 ай бұрын
"Just add multiplayer" Brah I had to restructure half my codebase to make multiplayer work
@gruntkwintin
@gruntkwintin 5 ай бұрын
we need developing monsters like you on roblox
@ashersilver7388
@ashersilver7388 4 ай бұрын
have you published your pygame library?
@PixelMystifier
@PixelMystifier 2 ай бұрын
Next breaking limits goal: make GTA in python
@HassanMohamed-dc3tt
@HassanMohamed-dc3tt 5 ай бұрын
What type of structure do you use like ecs or oop or sth in between like how do you strucutre your code
@obelexobendre
@obelexobendre 5 ай бұрын
This is not on the topic of the video but I noticed at 2:51 that you used dt*0.5 in the condition for randomly jumping, but I think this is not the right way to achieve framerate independance for this task. For instance imagine dt is 1, the slime will have a 50% chance of jumping, but if dt is 2, the slime will have a 100% chance of jumping with this code, which is not the same as a 50% chance per frame over 2 frames, which would be a 75% chance of jumping at least one time during those 2 frames (the probability of not jumping for two consecutive frames is 0.5*0.5 = 0.25, so the chance of jumping at least once is 1-0.25 = 0.75). I believe the formula could then be fixed as random() < 1-pow(1-p, dt) with p the probability that the slime does jump across the time of one second (if dt is in seconds). Also, this is my first comment on your channel. I want to say that I really like what you do, you’re an inspiration. Keep up the great work!
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
It's close enough that it's not really an issue. The server runs at a fixed framerate anyways.
@ikcinbeatz4365
@ikcinbeatz4365 5 ай бұрын
Just add local coop.
@vVearon
@vVearon 5 ай бұрын
just make a movement system, some guns, a battle pass, good graphics, and multiplayer. making a successful game is easy.
@happygofishing
@happygofishing 5 ай бұрын
Before I learnt sockets, I wrote pong multiplayer using GET requests. 💀
@someman7
@someman7 5 ай бұрын
Why is it jittery? Rasterization? Rounding down?
@dbweb.creative
@dbweb.creative 5 ай бұрын
soooo is the client sending character position? you should be sending movement and other feature commands, and then send out resulting positioning after interpolation.
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
interpolation is done on receiving clients. The purpose of interpolation is to visualize smoothly with limited data points, so you wouldn't send after interpolating.
@TheDarkchum1
@TheDarkchum1 4 ай бұрын
In 2024 would you still recommend learning Python for game dev for someone just trying to get into programming?
@a_pi_guy
@a_pi_guy 5 ай бұрын
nice video when are the frameworks going to be public i have been waiting since the original video (and if its alreeady public where i cant find it on github)
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
I talk about that at the end of this video. It would be after Shobnet is tested through the project in this video.
@a_pi_guy
@a_pi_guy 5 ай бұрын
@@DaFluffyPotato sorry i missed that thx
@rhnirsilva652
@rhnirsilva652 5 ай бұрын
be gamedev, do python w4r crimes!
@omar-diab-dev
@omar-diab-dev 5 ай бұрын
I don't see any "multiplayer networking" tutorials talking about this enough, but is there actually any free way of hosting the game online? It really is just feels a bit dismaying to be getting into developing a multiplayer game only to realize it will only work on your local machine.
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
I rent servers already for my websites. I can just put game servers on them. The "free" way that works at scale is peer to peer through Steam's system.
@finnf9051
@finnf9051 5 ай бұрын
Lets wait for 2 more years and Unreal Engine 5 will have the utton 😂
@RossiGiova
@RossiGiova 5 ай бұрын
where can i find you 3d framework and the multiplayer framework?
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
Neither are released yet
@ShreshthoSaha
@ShreshthoSaha 5 ай бұрын
What's the future of pygame developers?
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
games
@ShreshthoSaha
@ShreshthoSaha 5 ай бұрын
@@DaFluffyPotato cool🙂❤️👍
@forfreeStory
@forfreeStory 5 ай бұрын
please make multiplayer freamwork open source and help the community
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
I plan to at some point (see the end of the video).
@perezident14
@perezident14 5 ай бұрын
You never gave a reason why you didn’t just run a fiber optic cable through the center of the earth… Do you not care about your player base??? Unbelievable. 🙄
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
Yeah, my bad. I think I have to make a public apology for not putting the players first.
@ev3rybodygets177
@ev3rybodygets177 4 ай бұрын
bro out here still programming AOS and not SOA
@voldiriddle4203
@voldiriddle4203 5 ай бұрын
Wait. which enginee does he use? Not Godot right?
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
none
@voldiriddle4203
@voldiriddle4203 5 ай бұрын
@@DaFluffyPotato sorry, you are the pygame pro. I confused you with some other guy ... sorry
@ronitsingh9955
@ronitsingh9955 5 ай бұрын
Since when did python become 3D ??
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
since ModernGL
@hillybankok
@hillybankok 5 ай бұрын
@@DaFluffyPotato and pyopengl
@mikaa2557
@mikaa2557 5 ай бұрын
Yo are you a gamedev. I need to collab with you too. I am trying to get into gamedev too.😢
@NineSidedYT
@NineSidedYT 5 ай бұрын
#DaFluffyPotato You could add spritestacked players to give it a more 3-dimentional look. I'm not sure how difficult that would be but it would sure look great! :)
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
It would be easier to do a 3D model, but I want to use billboards for the visual style. Spritestacking also only spins on one axis.
@TheManager963x
@TheManager963x 5 ай бұрын
0:50 bro will do it in the Israeli way
I Turned Cellular Automata into a Game
16:28
DaFluffyPotato
Рет қаралды 171 М.
"Balancing" Gamedev and a Day Job
8:50
DaFluffyPotato
Рет қаралды 91 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 10 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 58 МЛН
I Added Multiplayer to My 4D Game! (4D Miner Devlog #3)
14:14
Mashpoe
Рет қаралды 1,3 МЛН
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 367 М.
Why I Ditched Godot For Unreal Engine
9:04
AueSip
Рет қаралды 10 М.
Why has Black & White Been Abandoned? - Noclip Greatest Hits
28:44
Noclip - Video Game Documentaries
Рет қаралды 729 М.
A Game Engine Built For Optimisation
5:16
Vercidium
Рет қаралды 246 М.
Every game needs this feature! | Devlog
6:03
Challacade
Рет қаралды 60 М.
Adding Realistic Shadows to my 3D Python Game
8:26
DaFluffyPotato
Рет қаралды 29 М.
I Made Multiplayer Gamedev EASY!
9:51
DaFluffyPotato
Рет қаралды 43 М.
Why Starbound Failed
15:00
RoboKast
Рет қаралды 964 М.
Making a game where you get sucked into your own (bad) code
23:10
Robert Thomson
Рет қаралды 1,4 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 10 МЛН