Lan Unity Chat

2023-2025

Lan Unity Chat is a small project where I experiment with local TCP and UDP messaging.
I set up the project so that clients can dynamically gather a list of all servers in the local netwrok through UDP broadcasting a connection request, after which the server responds with its local ip and port.

The project started from a template unity project made by Hans Wichman, with a built in state machine, and framework for tcp messaging. On top of this I built the UDP broadcasting and server discoverability, as well as the ability to send over images between clients. The sending over of images proved a bit more of a challenge than imagined. Since the image data was more than could fit in one tcp packet, I had to rewrite the tcp messaging framework to support messages being split up into multiple packets.

For Images I also wanted to learn how to get a webcam input into Unity, which was surprisingly simple, and then capture an image from the webcam, encode it to Base64, send it over the network socket, and decode it again on the other side.