So I’ve just started looking into networking with Monogame. I’ve decided to try to implement a simple Lidgren based network and just try to get 2 clients to hit the same enemy (got to start somewhere right? :)).
I find a lot of posts about networking but I cant seem to get my head around the actual data-storage. Lets imagine my single enemy. Its spawnlocation, health and respawntimer must be server data right? So is the general concept just to have a small database alongside the network-server? Lets say a Lidgren-based UDP server communicating directly with a SQLLite database for example.
Just try to get my head around the data-handling for server/client based games. Any resources are appriciated.
Apologize if my question is already well covered in some other post/s. Then please just refer me to them
Then my updated question becomes: Are there any Monogame specific recommendations for client->server->db setups? Maybe som Git-repo examples? If not I guess I’ll just try with Monogame<->Lidgren Network<->SQLiteDb
Second edit: Nevermind SQLite. Lets go Monogame → LidgrenServer → SQLExpress
If you’re just starting with networking, I would suggest developing one stage at a time.
First maybe try making a simple peer-to-peer game with LAN connections only. Each client acts like every other (sending their position to every other client, etc) and where a single decision must be made the host makes that decision.
Once that’s working move on to integrating a hosting provider or developing a separate server application with matchmaking, packet relaying, etc. After that, work on keeping persistent data available through a database and/or cloud storage.
Not sure what type of game you’re developing but you may find peer-to-peer with a packet relaying service is sufficient if persistent data between sessions can just be kept client side. One downside is the host could run mods which may make cheating easier compared to using an external server.
There are lots of options regarding hosting providers. Personally I stick to peer-to-peer logic and currently use Photon Realtime (with 20 concurrent players for free) for matchmaking and packet relaying. When I need more secure functions and persistent data I use Azure Functions & SQL as well, then combine that with Blob Storage where there is user generated content.