Networking Fun

Our last project in studio at uni was a sort of collaborative art piece involving networking. The idea was, we were all to create a client that took input from the user and sent it, via packets describing various shapes, to a draw server. The server would also send the client programs the positions of every other clients cursor within their screen, which we also had to do something with. The networking was relatively simple. There was no serialisation – packets were pretty much memcpy’s of C structs, and we were on a local network so we didn’t care about packet loss. I used D for my client as I’d been working with DerelictSDL a fair amount prior, and it had a nice socket module in the standard library. I also used libpng to export heatmaps for a while but quickly switched to use SDLs BMP functions on the last day because I couldn’t get libpng to build for windows.

wormeggs
My client was pretty much just a rainbow worm simulator. Each new cursor from the server spawned an egg that would hatch a worm that would follow it around the screen. The hue of the worm was the direction from the head of the worm to the cursor it was following. Every few frames, the positions of the heads of all the worms in the client plus their colours were sent to the server. Upon exiting the client, a heatmap showing the position of the user’s cursor throughout it’s use was saved. Each position saved was drawn into the buffer using a simple 5×5 kernel to make it look nicer but each point was still very pronounced. Using a larger kernel would have been better.

heatmap

manpat

Hello, I’m Patrick Monaghan, a games programmer in training. The purpose of this blog is to track the progress of my various projects relating to game development and various experiments I decide to try.A little bit about myself, I'm fluent in c++. I'm familiar with a few other languages also. I have a working knowledge of blender and gimp, thus can pump out programmer art like it’s going out of style. I’m always willing to learn new things and I always welcome feedback if it means I can improve. Also, here's a youtube channel And my github And my soundcloud Also I'm @_manpat on twitter Finally here's a todo list that I'm putting here so I can't ignore it

Leave a Reply

Your email address will not be published. Required fields are marked *