PDA

View Full Version : Creating multiplayer game, don't know a thing about multiplayer, looking for advice



MongKong
9th September 2019, 22:02
Hello !

so i decided to make a Ludo game for my graduation project, i want to make it so that player can play vs pc ( 1 player vs up to 3 AI ), now all those things i believe i can handle but what the problem is, i want to add multiplayer for this game, but i don't know where to start and what to look for exactly, i searched for some stuff on google and so far i haven't found anything and im still lost... Can anyone please give me any kind of advice, any kind of website or video from which i could learn how to set up multiplayer for my game. I really don't like networking so i want to make the multiplayer part as short and less complicated as possible, if that is even a choice....

d_stranz
10th September 2019, 16:17
I really don't like networking

But you are going to have to learn it, but I don't think there will be any way to communicate between different instances of the game playing at the same time on different computers.

Making a multiplayer game is hard. I found a research paper here (https://www.cs.cmu.edu/~ashu/papers/cmu-cs-05-112.pdf) that discusses some of the architectural design requirements. Maybe that and some of the references in it will help get you started.

MongKong
10th September 2019, 17:16
Thank you, I'll go through it and see if it helps. And i forgot to mention but regarding the multiplayer thing it doesn't have to work over the internet, LAN would be just as fine, for my graduation project it's required for game to be played by for example 4 players, but each player has to play the game on their own PC.

d_stranz
10th September 2019, 18:05
There's really no difference between "work over the internet" and working over LAN, except dealing with issues of security and firewalls. You still need some kind of network-based communications protocol.

From what I read, you can have two different models:


Client-server based, where a server maintains the state of the game and each player, and keeps everything synchronized or
Distributed, where there is no central server, and game and player state is held by all of the players


There are advantages and disadvantages to each model.

In a client-server design, the server always has to be running so clients can connect to it (or the first player to sign on automatically starts the server on their PC), and the server listens for broadcasts from clients requesting to join. All the game complexity is in the server, and the clients only have to be aware of their own player's view of the world. But a client-server model may not scale very well - the more players added, the higher the level of communication and the more state the server must maintain. And if the server goes down, the whole game goes down.

In a distributed model, there is no server, so the protocol has to be implemented so that all players are connected in some way to each other. Any player can come in or leave at any time without affecting the overall running of the game. But now every instance of the game must maintain the state of the game, so the executable is more heavy-weight. A distributed design could also scale better, for example, if players only need to know about other players who are "near" each other in the game world, then that player can ignore updates from players who are too far away to matter.