I tried different solutions in the past like Photon / UNet within Unity, often stopped after I made a simple connection using multiple clients and a server. I didn’t like using a premade solution where most of it is already done and I’m not learning about the real networking itself.

Yesterday and today I tried Tom Weiland’s tutorials he uses a mix of TCP/UDP but I barely learn anything, there’s not a lot of explanation going on.

My goals is to create simple fun games to play with some friends on a dedicated server using a TCP/UDP mix. Can any of you guys recommend me some good tutorials that explain networking, with good/clear explanation about what’s going on? It doesn’t have to be in conjuction with Unity, just C# is fine.

I think the usual suggestions for this sort of thing are the following:
https://beej.us/guide/bgnet/
And
https://gafferongames.com
There’s also a lot of white papers and things that companies have published such as

[PDF] https://www.gamedevs.org/uploads/tribes-networking-model.pdf
[PDF] https://zoo.cs.yale.edu/classes/cs538/readings/papers/terrano_1500arch.pdf

Keep reading some of these and you’ll likely run into more online. I believe there’s another famous one from Halo or CoD, for example.
https://youtu.be/cSlL4nWmZuQ
steven cleary about tcp/ip

Pluralsight has really good networking courses on the hacking and security path

I don’t have any tutorials, but I just pushed my newest build om my network library to GitHub if you want something to use as a bit of a reference. I reccomend Looking into the Client, Server, And ObjectHeader classes. I only use TCP in this, but there are a few solutions that may be helpful, unless its too hard to read

Just go to some conferences and talk to people. Most conferences have networking time scheduled

Hi! I’m a network engineer.
this book/series is the gold standard.. Disclaimer : I own volume one, first edition.

There are simpler books / resources. There are tutorials that teach you how to networking with c#. But, I always say that when you fully understand how something works, it becomes easy. That is, if you fully understand networking – it just becomes a matter of “which methods do I call to accomplish X in language Y?”

Note, that for volume 1, the first edition is generally preferred. Despite being 27 (!!) years old, like 75% of it is still current (networking moves glacial slow compared to development), and it’s much better than the 2nd edition. The things that volume 1 is missing aren’t that critical in general, but if it’s important for you, you can either top up your knowledge from other sources, or purchase the 2nd edition as well.

The first volume is language agnostic. (you can find a PDF quite simply on Google). It Durante convert anything about programming – it explains the protocols themselves and how they work.

The second and third volumes discuss the actual implementation of the TCP/IP stack in BSD. if I had to guess (I don’t own these volumes, and a PDF is harder to find), it would be in C. These are typically seen as less useful – though I’m usually looking at it from the perspective of a networking person, not an implementer.

Raknet was bought by Oculus I believe and is now free and open source. However, there are quite a few bugs in it and I believe a few things were removed. The project is no longer maintained but it’s still mostly stable to use and is a professional solution. A fork of it was created which is actively maintained and quite a few issues were fixed, I do not remember the name of it though but it’s worth researching.

Writing your own networking library is doable, but not entirely feasible, especially in C#. You’re going to want the best performance you can get out of it so it’s best to write it in C or C++ and build a wrapper. You’re going to have to learn about things such as NAT punch through, network prediction, and more, which is not for the faint of heart. But it would still be a fun and creative project, you’ll also gain a lot of knowledge too which is the best takeaway.

For simple games though, where you’re only sending a couple of packets to a couple of people, C# should be more than enough.

source

Categories: Computer Science