Multi-player workflow approach?

I’m wanting to make some multi-player card games with my little card game engine. I know how to do client/server stuff so passing data around over the network isn’t too confusing. But what I’m unsure of is an efficient approach to take for workflow so I can simulate playing as 2-4 players at the same time.

2 Likes

If the client applications can run in a window, I would start with running multiple clients on the same machine. A card game shouldn’t require too much interaction with each client, and there will likely be no timing problem if you take a bit longer to switch to the next client to play that one’s hand.

As far as I’m aware you cannot control multiple windows at the same time? So, you’ll have to switch windows for each player. And yeah, instead of full screen, try windowed.

Here’s a YouTube video with some networking code samples using the Lidgren.Network.DLL

Thanks, I think this is a good approach. :slight_smile: At the moment I’m looking mostly at turn-based games, so it’s not all that necessary to have it be as instant as say a FPS might be.

I appreciate you showing me this, I’m going to look into Lidgren a bit more.

I was thinking of doing a simple REST style web service in PHP passing around JSON, since it is pretty easy to set up and not very resource intensive. But it would be nice to do everything in C# and having an example like this is very helpful, so I’m downloading the source code :slight_smile:

You could also use Photon Engine, that way you don’t need server-side code and you already have a server (theirs).
The monogame people recommended it for my card game application. I didn’t look much into it yet, but from what I’ve seen, it could be exactly what you need.

2 Likes

@SoundGoddess - How are you getting on with the network game? I’m new to the networking side of things and recently been looking at the Lidgren library (which actually comes with MG installation so you don’t need the source code) as well. If your still looking for help on this I posted a couple of links in the below topic, one of them is the same as the one above - Looks like Lidgren is very easy to pick up and should do what you need it to do.

I’ve actually been pretty busy with another project so I haven’t focused that much energy on the multi-player/networking side of things yet. It did seem however that it was pretty easy for me to just pass JSON objects back and forth between my VPS with PHP/MariaDB for the server-side and C# for the client side. May be an unconventional way of doing things but it seems to work.