Starting Unity Networking With Chat

Starting Unity Networking With Chat

One of the easiest things that you can do to learn how to do any sort of networking on any platform is to create an online chat. The application will do nothing but allow two or more machines send string messages to each other. The reason that this is the easiest way to learn networking is because it shows you many principals in networking and you can easily build off of it to try new things and learn how the network handles your data.

Creating an entire networking system yourself is a bit overwhelming for most, so it is sometimes best to pick up a networking system that works for you. Just as you would pick up a game engine like Unity to make your games, you can pick up a networking system to easily add networking (multiplayer) to your games. We personally would recommend using Forge Networking. This system is open source, freely available, and has a very active Discord community. With virtually every other networking system you have to pay for CCU (Concurrent Users), basically what that means is that if you are paying per-user after a specific point that is connecting with the networking system and is often much more expensive then self hosting. Forge Networking does not use the CCU model because it is open source and also allows you full self hosting.

On the BMS website, we have a tutorial here to get you started with a networked chat in Unity. You will learn how easy it is to get up and going with networking. Also you will find advanced tutorials and the source project for the tutorial there as well. As I was mentioning before, chat is a system that is very easy to begin with because you are just sending strings on the network, getting those strings, then printing them to the screen. You can, of course, make this more complicated with unique client usernames, bad word filters, slash commands and much more that you’ll see in the advanced tutorials. Once you master the simple concepts of networking through making a multiplayer online chat system in Unity, you will be able to move onto more advanced topics with multiplayer games.