An online multiplayer 1v1 asymmetric tower defense/offense game, developed as a solo project in Unity.

Developer
Lande Audio
Platforms
Windows · MacOS
My roles
Programming · Music · Sound Design

In development

Castle Siege has been a personal project of mine since 2016. It started out as a Ludum Dare jam 42 entry made in Godot, eventually switching over to Unity. I view it as a learning experience, with potential to become an actual playable game some day. I tend to work on it when I'm in-between freelance gigs, which means little time has been spent on it in the last few years.

Audio

The game is set in a pseudo-medieval, fantasy environment. This is reflected in both the music and sound design. The interface sounds feature a lot of physical wood and metal source, and the music is orchestral and fantasy-themed.

Mordi · Castle Siege (Beta Soundtrack)

Network programming

Online multiplayer has always been challenging to achieve as a solo or small-team developer. I decided to delve into it to learn about how it can be implemented.

At first, I implemented LiteNetLib, which is a nice and lightweight networking library. It lets you define packets, and then send them off using reliable UDP. While UDP is faster than TCP, it is also normally unreliable. LiteNetLib somehow works around that by employing it's own system. Being lightweight also means few features though, and I eventually ran into issues with packets not getting through router firewalls and the NAT.

Traversing the NAT

I spent a few months trying to implement my own NAT hole-punching system. By default, a networking router will reject any incoming packets from unknown sources. However, if the router has already tried to send a packet to another endpoint, it will accept any incoming packets from that endpoint. Therefore, we can "punch a hole" through or traverse the NAT by having all players send a packet to each other.

This technique requires players to exchange endpoint information, which is done by using a publically accessible master server. I rented a Linode running Linux to achieve this, which I later used to implement a bot for the Castle Siege Discord server.

Eventually, I was able to get NAT hole-punching working sporadically, but sometimes it would fail. In theory, it's a simple process, but in practice it turned out to be quite the challenge. I decided that I was on thin ice, and moved on to using a simpler networking solution.

Steam SDK networking

Implementing the Steam SDK was a breeze in comparison, and I was able to reuse a lot of the internal networking code so that it now works reliably. Steam handles all of the complexities of networking for you, including NAT traversal.

Multiplayer gameplay from 2021, with me playing as the attacker.

UI design

For me, one of the most enjoyable things in a game is designing and implementing the user interface. For some reason, I find making a menu very enjoyable. With this project, I've designed a whole UI aesthetic from scratch, which has been a lot of fun. I've tried to invoke a fantasy feel with diegetic elements; wood, paper, stone and metal. It should be reminiscent of late 90's or early 00's games like Warcraft 3.

UI assets are vector-based, using Affinity Designer to create and export them.

The main menu and flag customization in 2021, showing changes to the flag's colors, emblem and pattern.

Video from 2022.

Game design

This is definitely the biggest pain point of the project, and my achilles heel. I enjoy working on the technical and creative side of game development, but when it comes to game design, I'm just not very good. The game has major gameplay flaws, not least because of the asymmetric nature of tower defense vs offense.

Current state of the project

Castle Siege is on hold while I work on other projects. It's a personal project with no funding at the moment, so I return to it when time allows.

More articles

Explore the full portfolio