P2P or Dedicated Servers? What's the best for your unity game?

  Рет қаралды 10,233

Jason Weimann (GameDev)

Jason Weimann (GameDev)

Күн бұрын

Пікірлер: 38
@EpicTyphlosionTV
@EpicTyphlosionTV Жыл бұрын
Peer to peer benefits from not needing any server upkeep, which also means you can play the game online far into the future. Only issues are connection and security.
@captainnoyaux
@captainnoyaux Жыл бұрын
Yup, I went for p2p for a start and if there are too much problems (the hosts quits too much or w/e) I'll use a dedicated server, but implemented like it's already a dedicated server in case I have to migrate
@MaZyYTube
@MaZyYTube Жыл бұрын
@@captainnoyaux I think the word or definition p2p is used wrong here. If you mean a player can start a server in the and and clients connect to it (and cannot host in that time).. this is client server model. This is not p2p. And still if host leaves its a problem. Some network systems offers solution for this. But I like to offer both option. Like Source games. They have the option to use dedicated server or just quick start a server from the main menu. Nice to make quick session with a friend if it is small fun game ( for instance garrysmod ).
@captainnoyaux
@captainnoyaux Жыл бұрын
​@@MaZyYTubeyup it's unity's definition of P2P
@smarttarded
@smarttarded Жыл бұрын
If your game is competitive based, meaning you need tight control over the server to prevent cheaters and exploits, then a dedicated server is a must
@SuperParadine
@SuperParadine 11 ай бұрын
I think if the player becomes a server, but it does not change the gameplay for him, then its still p2p. I never heard about game with p2p where each player sends data to each other player.
@princetruth28
@princetruth28 Жыл бұрын
I was just this week starting to learn about this and wanting to have online for my turn based games.. yiu couldn't have chosen a better topicman, great thanks!
@roflcopterpilot
@roflcopterpilot Жыл бұрын
Would love to see a breakdown of CCU calculations and how to go about cost calculations, maybe use a common platform such as Photon as an example? Outside of the scope of coding but it seems to be a factor that scares many developers.
@atilliator
@atilliator Ай бұрын
Love the hoodie infront of the tropical background!
@fmproductions913
@fmproductions913 Жыл бұрын
For games where there is no competitive aspect and when there are mostly just 2 players in a session, P2P seems like a nice and simpler solution for sure. Epic and Steam offer those relay services for a p2p like network structure too, so you don't have to worry about connecting the peers on your own (which can be be a real hassle, can expose insecurities when peers setup to support directly connecting to others and a lot of times, you end up needing a separate server to relay packages between the peers or to connect them together either way).
@Mtylgd
@Mtylgd Жыл бұрын
You also should factor in that simply debugging peer to peer can be much harder so finding and fixing P2P issues can take much more time.
@tetryds
@tetryds Жыл бұрын
I would like to add that maintenance is the biggest cost of dedicated servers, since hosting is not prohibitively expensive anymore. Most indie games can get away with lowest tier hosting.
@alienJIZ1990
@alienJIZ1990 7 ай бұрын
Best way imo is a public server as a p2p client session broker. If it's competitive or hacking becomes a problem, train LLMs to analyze matches and memory states to look for anomalies, use UBA to auto flag suspicious users, efficiently collect telemetry on first launch for more reliable banning purposes (cpu/disk/mobo serial, public IP, MAC Address, etc.), and also anti-cheat post-gameplay telemetry to feed the LLM, with ML jobs to account for intentional disconnects vs latency But most ideally, we need decentralized P2P gaming. The gaming community in general is large enough at this point that to avoid putting server costs on small teams/devs, everyone can just spin up (i.e.) a Raspberry Pi node and share the burden. Decentralized, open source governance, anti-cheat rules, scalable, etc.
@alec_almartson
@alec_almartson Жыл бұрын
I would say: "It depends on the game".
@young-salt
@young-salt 2 ай бұрын
Imo community self moderation is my favorite option and usually very effective. Using a votekick and rejoin timeout or an automated block option to prevent being matched with the same player again by removing them from the match pool for players from the previous game theyd been ejected from This is my very unprofessional opinion, please tell me where im going wrong or if this is much harder than server client moderation
@dviross6096
@dviross6096 2 ай бұрын
Yo I got a question, I'm making a multiplayer game that runs even if only one player is connected like minecraft world, but i want the host to move between the players depends on who connected first. Is that possible?
@personhurter
@personhurter 3 ай бұрын
I’m trying to decide between relay and dedicated servers for my vr social streaming app and need help deciding. Any suggestions?
@JonathanbmillerZIG
@JonathanbmillerZIG Жыл бұрын
I'm curious of any security risks to the players peer-to-peer networking can open up and how to prevent them. I can't think of any, but the thought of someone directly connecting to another computer does make me wonder if there are any concerns I should prepare for.
@captainnoyaux
@captainnoyaux Жыл бұрын
Of course there are, ddos is one. Probably non existant except if your game is a HIT
@TarrenHassman
@TarrenHassman Жыл бұрын
And folks, when he says getting p2p clients to agree on stuff is possible but it’s complicated. He means graduate level distributed systems level difficult, it’s the same fundamental problem cryptocurrency networks are trying to solve.
@Unity3dCollege
@Unity3dCollege Жыл бұрын
Some games it's a bit easier, but I think it's mostly 1v1 games that I can think of at least
@TarrenHassman
@TarrenHassman Жыл бұрын
@@Unity3dCollege yep. Turn based can also make it a lot easier because the delay is inconsequential.
@paddyh4272
@paddyh4272 9 ай бұрын
So a “versus fighting” game will always be run on p2p architecture, is that right?
@Unity3dCollege
@Unity3dCollege 9 ай бұрын
Typically, but with some special considerations. There are some good common solutions for fighting game networking, lots of good gdc talks on it too. Local mp is definitely the best though for it. Apparently parsec is pretty popular for fighting games too (not netcode but a great free tool)
@young-salt
@young-salt 6 ай бұрын
I dont like dedicated servers only. I think peer to peer is best for quickplay with the ability for players to create and host their own servers and those servers being listed in a server browser in-game. I think this would be the best process for bringing a battlefield type of game to the linux and foss crowd. Foss crowd doesnt really like dedicated servers and i dont have the cash or infrastructure to have dedicated servers for more than 10-20 people. I think having a votekick option and giving server owners the ability to permanently ban players is the best way to combat cheaters, abk cant even make an effective anticheat so theres no way i can make one, best to keep that tool in the hands of the players
@goog983
@goog983 6 ай бұрын
any reccomendations for adding peer to peer into my games? like where i should look
@TheAlienpope
@TheAlienpope Жыл бұрын
I might be missing something. but unity's own peer to peer system unity relay, is not free. I haven't looked into the pricing too deeply and done any calculations. But it seems you still have upkeep costs even with peer to peer. Or again, am i missing something?
@Unity3dCollege
@Unity3dCollege Жыл бұрын
Relay costs are a lot cheaper. Last I checked, steam also offered it for free for games hosted on there.
@TheAlienpope
@TheAlienpope Жыл бұрын
@@Unity3dCollege Oh yeah! I forgot steam offered this as well.
@bentv839
@bentv839 Жыл бұрын
What about room based multiplayer games like LOL or Valorant? Most of services like Photon you have to create P2P connection for create room and let one of player rule it. So how we can connect that rooms with dedicated server for prevent cheating?
@MaZyYTube
@MaZyYTube Жыл бұрын
He sadly was not explaining p2p correctly. P2P actually means everybody is host and client at same time. Photon is not like that. You still connect to server and you receive the information from the server not from players directly. Photon has authority system and the server is just a cloud server. This means actually Photon is like AWS (amazon hosting service). But the main difference is you cannot do something on the serverside. Because of this some people try to use the masterclient ( the one who created the room ) to validate things.. but yea masterclient could cheat. I had to once write for customer custom authority system.. it was pain. While games like Lol, Dota are 100% cloud dedicated server but these games are using Matchmaking System. So they know what server are free which one they can use. Its really easy to write your own if you understand how this works. Start with basic and simplied version just to learn it. 1. Write a simple server in unity using mirror, netcode what ever. You don't even need to join. Everytime a server starts let it write(or update) to a "json" file just in any folder you want. Write into the file the player number and the ip + port. 2. Run 2 server with different port. 3. Write now the client part. Just a button "Auto join" and the logic to receive the json file and read the information. Now you already have information about 2 server. Now you can create your own logic.. do you want prio empty server or join a server with players? Of course with players hehe. Connect to the ip you received from json. 4. Voila, you are done and you wrote your first own (even if it is just json file) Matchmaking server. You even can use this information to make a server list. Don't use json for real games. Just for learning.
@bentv839
@bentv839 Жыл бұрын
Thanks for your detailed reply. Very helpful @@MaZyYTube
@TheRealFlap
@TheRealFlap 10 ай бұрын
@@MaZyYTube I don't think JSON is inherently bad, right? Here's my idea to implement your idea. Utilize something like Firebase's Firestore (NoSQL JSON Database) or Supabase (PostgreSQL Relational Database) which has a table for currently active lobbies which is updated and queried as people "Host Game" and create lobbies. Querying that database even in SQL can be serialized into a simple Object for easy data access. If using Firestore, it's literally just a JSON file that's returned which you can iterate through like you stated.
@rexoverwatch
@rexoverwatch 10 ай бұрын
yeeeee
Fast Moving Game Objects - NetCode & Extrapolation
7:21
Jason Weimann (GameDev)
Рет қаралды 6 М.
Who's spending her birthday with Harley Quinn on halloween?#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 26 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 8 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 127 МЛН
What Is A Dedicated Game Server & Why Is It IMPORTANT?
7:12
gameranx
Рет қаралды 364 М.
Peer to Peer Multiplayer, Drawn Badly
11:35
Mark Mandel
Рет қаралды 8 М.
Making MULTIPLAYER Games has never been EASIER!
12:49
Code Monkey
Рет қаралды 83 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
The 6 Design Patterns game devs need?
24:20
Jason Weimann (GameDev)
Рет қаралды 372 М.
How to Choose Your Multiplayer Backend
27:56
Battery Acid Dev
Рет қаралды 19 М.
What is a Server?  Servers vs Desktops Explained
7:14
PowerCert Animated Videos
Рет қаралды 2,9 МЛН
Who's spending her birthday with Harley Quinn on halloween?#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 26 МЛН