C# Networking Tutorial Series: Build Multiplayer Games

C# networking tutorial series

As some of you might know, back in May, I wrote a (super long) post about connecting clients to a dedicated server using C#. Since then, I’ve built on and improved that networking solution a lot, and over the last few weeks I’ve been uploading tutorial videos on my YouTube channel.

The C# networking tutorial series now has five parts, the last of which I uploaded yesterday. Although I’ll probably continue the series in the future with videos about more complex networking-related topics, the core of the networking is all there, which is why I’m writing this post now.

If you want to get notified when I add to the series or you want to follow my devlog journey, consider subscribing to my channel. Also, come check out the Discord server where you can share your progress, ask for help, and hang out with other game developers.

Even if you followed the written tutorial and are using that networking solution, I strongly recommend taking a look at these videos. The code is cleaner, easier to understand, and it includes support for UDP communication. On top of that, if you’re trying to learn how this stuff works, going through tutorials and rewriting the code multiple times can be super helpful—it’s one of the reasons my understanding of networking is where it is today.

This Post Has 2 Comments

  1. WatIsDeze

    Hey there Tom, I’ve enjoyed your networking tutorial although I ran into it randomly. The main issue I find here is that the use of TCP is in most cases not a good idea. It ensures your packets arrive, but this can take a long time. Meanwhile, hogging the application while you are waiting. In general it is a better idea to use UDP and write one its own protocol on top of that. (Use the time big time, hint.)

    I’d like to get in touch with you since we’re both Dutch and in a similar Discord channel. However, sadly, Discord didn’t allow me to text you so I’ve sent you a friend invite. Greetings.

    1. Tom Weiland

      Hey, I’m glad you enjoyed it.
      If you watch the videos, you’ll notice that we use UDP for things like player movement, and TCP for messages that need to be delivered and will only be sent once. Most games use a combination of the two—fast-paced games will rely more heavily on UDP, while a turn-based game could use TCP exclusively without issues—I believe World of Warcraft is built entirely (or at least mostly) on TCP.

      Which protocol is better is highly dependent on the situation, and I mentioned the pros and cons of both in at least one of the videos. This series is meant to give people the tools they need to get into building multiplayer games, so it wouldn’t have made any sense to leave out TCP, especially considering that most games do use a combination of the two protocols.

      I’m actually German/Canadian (out of curiosity, why’d you think I was Dutch?).

      As a general rule, I only friend people on Discord that I’ve known for a long time, but I’d be happy to chat on the server at some point!

Comments are closed.