Ten years ago today, I uploaded the first version of Capture The Flag. Capture The Flag is a multiplayer game where two teams of players battle to claim the other team’s flag whilst defending their own. Capture The Flag is played in a destructible voxel environment, allowing players to build defences and place traps.
Capture The Flag started life as a persistent kingdoms game but quickly pivoted to a match-based team game. It was developed iteratively, taking into account player feedback. I hosted a server for the game for many years and a community formed around it. In 2021, I handed over the reins to CTF to very capable hands; it remains Minetest’s most popular server to this day.
This article covers the history of CTF, the lessons I learned, and the changes I made along the way.
2013: City vs City game #
I originally created Capture The Flag to be used on a persistent map, where teams were countries and players worked together to defend castles. Any player could create a new country and place flags. Flags were placed at the top of castles and allowed a country to claim ownership of the surrounding land.
There was a diplomacy system that allowed countries to declare war and peace, and form alliances. Players could place turrets that automatically attacked enemy players. If an enemy country claimed a flag, it would gain ownership of the surrounding land - including any turrets.
I created a private server to test the game with friends. I hosted this at home, so it wasn’t online that much. I implemented the basics - countries, flags, land ownership, and turrets - but never really got to the point where I felt like it was ready to host publicly.
When I first started working on the game, I knew it would be running on a server and didn’t want it to crash. I added a lot of if-statements for things that should never happen, and in the process caused a lot of bugs to become subtle behaviour issues rather than crashes. The lesson I learned here is that it’s better to crash than to obscure a bug or end up in an unknown state.
From the start, I wanted the core mods to support being used in any team-based
games, even without flags. A lot of features were added in additional mods, for
example, flags were added by
ctf_flags. There were also a lot of configuration
options that were never really needed. I learned the principle of
You Aren’t Gonna Need It (YAGNI)
the hard way.
2015: Switch to match-based Capture The Flag #
In July 2015, after a while of not working on the game, I decided to pivot to making a match-based game instead. I still planned to work on a persistent kingdoms game eventually, but doing a match-based game first would allow me to develop the core code and test it. I split the game into a reusable mod pack called CTF PvP Engine and a game called Capture The Flag.
Around this time, I played King Arthur’s Gold - a 2d sidescrolling capture-the-flag game where players build castles and then attack each other. The game’s structural integrity mechanic made sieges pretty awesome. I quite liked the defensive building part of the game and felt that a voxel world was especially well-suited for this kind of gameplay. King Arthur’s Gold was Capture The Flag’s main inspiration.
2015: Public server #
In September 2015, I started the official Capture The Flag server, hosted on DigitalOcean. The server was mostly dead for a few months but then suddenly become popular - I guess it had reached the critical number of players that allowed the game to become fun.
By this point, I had been making mods for Minetest for a couple of years but hadn’t created a public server before. One thing I learned was just how good running a server is at finding bugs - players do a lot of things that you don’t expect. One example is when players discovered that dropping sand on flags caused them to be dropped as items, allowing players to place multiple flags for their team. This made it much harder for the other team to win as they would have needed to capture all the flags.
I found that another benefit of running a public server is getting access to a community of players and feedback. From this point onwards, I was able to iteratively develop the game based on how the players played it and what feedback they gave. For example, the game contained team chests that allowed players to share weapons and items. I discovered that a lot of team members were intentionally destroying unused weapons rather than placing them in the team chest, to prevent newbie players from picking them up, dying, and delivering the weapons to the enemy team. To fix this issue, I made it so part of the chest was restricted to players who had at least a certain amount of in-game experience.
I delegated the day-to-day running of the server to moderators. I wasn’t interested in being a moderator or server owner, for me the fun was in creating an experience and seeing how the players react, rather than enforcing rules. I chose new moderators based on the recommendation of existing moderators - I felt that the existing moderators were better placed to judge character. A lot of people asked to become a moderator, but I rarely granted this as asking to become a moderator is a red flag.
The DigitalOcean server I was using was quite underpowered. In April 2016, a community member called Calinou offered to host the server and did so until they stopped it in November 2016.
2017: Restarted the server and development #
In October 2017, I decided to restart the server and development on Capture the Flag due to popular demand. This time, I hosted the server using a dedicated machine on Kimsufi - a brand owned by OVH. With hindsight, hosting on a cheap dedicated server wasn’t good value for money, but it was faster than the DigitalOcean VPS.
My aim for development at this point was to improve the variety of matches, increase strategy, and incentivise co-op. It was too easy for a match to be won by a lone hero.
2018: Multiple maps #
After months of work in secret, I released support for multiple maps. Instead of always playing on the same map, the map was now different for each match. Players could use a dedicated tool to create new maps and then submit them for inclusion.
The feature shipped with three maps - Two Hills and Two Lakes (the previous map used), The Bridge, and Caverns. Caverns was my favourite map. It’s set underground, with three caverns and a small dungeon to explore. All of these were disconnected; players needed to tunnel to reach the enemy team. I liked how this added a stealth aspect to the game.
Notice how none of these maps came with prebuilt structures. The aim was still to encourage players to build their own defences and use the destructible environment to their advantage. But that doesn’t mean I was against it completely - some of the new maps contributed after the feature was released included entire towns.
2019: Apple cheating and medkits #
Apples were used to heal the player in CTF. Someone made a cheat that would eat apples automatically when they took damage, by emulating player input.
The cheat was programmed quite poorly and was vulnerable to a Remote Code Execution (RCE) bug. This could have allowed the server and other players to run non-sandboxed shell commands, taking over the cheater’s computer. I didn’t exploit this for obvious reasons.
I wrote a mod to detect the use of this cheat. At the end of each match, a GUI window is shown with the match results. I dealt damage to all players when this window was shown and then listened to key presses using a hidden text field. If a bunch of numbers were pressed (ie: 3333331), then I’d know that they were using the apple cheat. The anti-cheat mod would wait a random period, 5-10 minutes, and then ban them with an anti-cheat message.
This anti-cheat wasn’t a permanent solution but was enough to catch and frustrate the cheat writer, which was the main goal. We eventually replaced apples with medkits and bandages. Players can use medkits to heal themselves but have to remain still whilst it acts, leaving them vulnerable. Players can use bandages to instantly heal their teammates but not themselves.
2020: Classes and CTF 2.0 #
In 2020, the COVID pandemic meant that I was able to find time again for the game. I worked on a classes feature inspired by King Arthur’s Gold. It allowed players to select a class at their team’s flag. Classes come with different abilities and initial items. The aim was to increase variety and allow other styles of play to become more viable, as to this point the most successful tactic was to spam with a steel sword.
I also refactored a lot of the code to remove unused features left over from the City vs City days. I released this and classes as Capture The Flag 2.0.
2021+: Handover to LandarVargan #
By 2021, I had fully lost interest in working on Capture The Flag. I had limited time and there were many other projects I wanted to be working on. I chose LandarVargan to become the new project lead as he had been significantly contributing to CTF for a while.
After taking over, LandarVargan added savilli to the development team. They worked together on Capture the Flag 3.0, a rewrite to get rid of eight years of technical debt. Many new gameplay features have been added to 3.0 including support for multiple game modes. These game modes are another way of increasing variety.
During a testing session for the 3.0 rewrite, some players got ahold of near-infinite stacks of grenades. This formed the inspiration for the Nade Fight game mode added by savilli. In this mode, players fight with an unlimited supply of 3 different grenades. Each one has a unique use and a cooldown after throwing. Void grenades trap players, firecrackers damage them, and yellow grenades allow the player to move quickly through the air.
Unlike me, LandarVargan plays existing competitive PvP games in his own time, including Albion Online and Brawlhalla. He was interested in what about those games and CTF was fun and attracted their player base. In studying them, he got a lot of ideas for how he could improve CTF.
I never ended up continuing my City vs City game, but someone else used the CTF PvP Engine to make a similar game called Persistent Kingdoms.
Capture The Flag feels slightly bittersweet to me. Whilst it has been popular and liked by a lot of players, I feel like it never became the game I wanted it to be. I was never that interested in first-person shooters; I wanted it to be a game of strategy and castle building and sieging. To get it to that I probably would have had to implement some difficult features like structural integrity and pivot the game’s features more to that goal. Not sure whether the player base would have wanted this. Capture The Flag was ultimately developed by watching how it was played.
Whilst I am no longer interested in continuing CTF myself, I am glad that the community grew to a point where it was able to attract contributors and survive without me. I think this is the best indicator of the project’s success.
Join the celebrations #
The 8th anniversary of the server will be the 1st of September. Fancy celebrating? From today until the 1st of September, there will be fireworks and party hats on the server. You can play Capture The Flag by joining ctf.rubenwardy.com:30001 using a Minetest client.