Skip to main content
The cover image for "Ten years of Capture The Flag"

Ten years of Capture The Flag

Sidebar

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](https://www.minetest.net/)'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.

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.

A Minetest GUI. There's two rows. The first says "red, peace", the second says "blue, war".
The diplomacy tab in the team GUI.

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.

Screenshot of a 2d sidescrolling game. On each side of the image, there's castles built out of stone. Red and blue players are approach each other from opposite sides, firing arrows and raising shields.
King Arthur's Gold (source: Steam page)

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.

Screenshot of a chest inventory GUI. The inventory is split in half. On the left, there's "Any player can take from here, including enemies." On the right, it says "You need more score (200+)"
The pro section in the team chest. An early version allowed enemies to take from the chest too, although this was changed later on.

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.

Screenshot of a voxel world. To the top and the bottom of the image are grassy hills. Between them are two lakes and sand.
Two Hills, Two Lakes: The classic CTF map. Photo by Shara.
Screenshot of a voxel world. A canyon with a river splits the terrain. There's a one meter wide bridge from one side to the other.
The Bridge: Very little cover and no apple trees. A river separates the two teams.
Screenshot of a voxel cavern light by torches. In the center, there's a blue flag.
Caverns: Each team has a cavern. Lots of ores and tunnelling.

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.

A Minetest GUI. There's four columns, one for each class. Knight, Sharp Shooter, Medic, and Rocketeer.
Players could change classes by right-clicking their team's flag. RIP Rocketeer.

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.

CTF’s player base is small if you compare it to other games, but that also means it’s much easier for devs to stay in touch with the community and listen to their feedback. Most people who play Minetest also have some experience programming too, and have access to CTF’s open-source code, so feedback is much higher quality than it is for most games.

It’s extremely helpful to have staff that can handle the day-to-day running of the server and social media platforms (ie: Discord) for you. I was semi-aware of the difficulties of running a server and community before taking over CTF but greatly underestimated it, and the ever-ongoing process of learning how to do/delegate that has probably been the most valuable experience I’ve gotten out of working on CTF.

In the future, I don’t plan to make many more big additions - like I already have with the cosmetics system, multiple modes system, or Elysium (A hub area outside of the main gameplay loop where players can hang out/ practice PvP after capturing the flag) and hope to get to a point where I’m just playing the game, polishing/improving existing things, and adding new modes, which most of my remaining ideas revolve around.

—LandarVargan

Conclusion #

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.

A Minetest GUI. There's four columns, one for each class. Knight, Sharp Shooter, Medic, and Rocketeer.
Fireworks will spawn in treasure chests. You can get an Anniversary Hat by launching a rocket into the sky. Screenshot by LandarVargan.
rubenwardy's profile picture, the letter R

Hi, I'm Andrew Ward. I'm a software developer, an open source contributor, and a graduate from the University of Bristol. I’m a core developer for Minetest, an open source voxel game engine.

Comments

Leave comment

Shown publicly next to your comment. Leave blank to show as "Anonymous".
Optional, to notify you if rubenwardy replies. Not shown publicly.
Max 1800 characters. You may use plain text, HTML, or Markdown.

Wow, ten whole years of CaptureTheFlag, and more! It is lovely to see the development of it and how it has grown over the years. Although it may have not been what you expected it to turn out to be, what you laid down went far ahead along with the audience it covered. My heartfelt gratitude to you and the developers, fellow staff, players, and everyone in the community who made a positive change and made CTF as great as it is today. Happy anniversary to CTF! 🎉

AlexiosTheSixth u/AlexiosTheSixth

Dang I remember playing this game on a school small laptop computer on free time back in like 2016-2017ish when I was still in school. I distinctly remember how I also sometimes played it with a custom starwars texturepack that made one team stormtroopers and the other team rebel troopers with guns made into blasters and swords made into lightsabers etc.

Dang the memories, the map with the forest and the jungle and the sandy watery area in the middle is so nostalgic at this point. I remember making gunner trenches there with ladders to pop up and back down in around 2017-2018ish.