How do you make a online multiplayer game?

How do you make a online multiplayer game which you can play from another computer also if you have any tutorials that can help that would help

1 Like

Depending on what type of game you are making. It can be SUPER complicated.

Monogame doesn’t do this by default, you will need addon libraries like LiteNetLib. There are a few other TCP/UDP libraries but most are not maintained anymore.

LiteNetLib: https://github.com/RevenantX/LiteNetLib

If you are looking at doing FPS or close to real-time action or interaction, you’ll need to understand all this too:

Part 1: Client-Server Game Architecture - Gabriel Gambetta
Part 2: Client-Side Prediction and Server Reconciliation - Gabriel Gambetta
Part 3: Entity Interpolation - Gabriel Gambetta
Part 4: Lag Compensation - Gabriel Gambetta

Honestly, I don’t think there are any Monogame + LiteNetLib tutorials. There might be some small sample projects if you search GitHub.

im doing a rpg survivalish game but ill try this out thanks

You should also read up on the types of online multiplayer designs. Such as Peer-to-Peer or Server-Client design. Peer-to-peer can have more cheating verses an authoritative server client model.