Multiplayer Question

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By djmick

How would I go about making a multiplayer game like Tic-Tac-Toe where you simply press play on a menu, then if there is another person somewhere in the world ready to play as well, it matches you up and you can play? I know how to make the tic tac toe part, I just need to know how I would go about making multiplayer like this because every tutorial I have seen makes it so that someone needs to create a room and the other needs to enter the ip address to join. Thanks!

I’m sorry, I do not have an answer, I feel like there mighht be a lot of different things that need to be considered, beyond the scope of a single answer, but may I ask, could you please link some of the tutorials you’re talking about?

mymokol | 2021-07-31 16:40

Yeah it was hard to explain exactly what I needed, but this is the tutorial that I was talking about: https://www.youtube.com/watch?v=lpkaMKE081M&t=154s

djmick | 2021-07-31 16:43

:bust_in_silhouette: Reply From: Wakatta

Setup a server where each client connects to, eliminating the IP & port typing part.

Have the server randomly choose another connected peer based on experience or other criteria and start a game between the two.

Finding a step-by-step tutorial for beginners of this will not be practical. Rather learn each phase and connect them all together.

What you’ll need

  • A server that

    • accepts peers
    • matches connected peers
    • handles unexpected behavior (like disconnects)
  • A client that connects to the server and plays the game when instructed to do so