Capture the Flag (CTF) - The legendary event that never happened

 This blog is gonna be short. Ironically, this was supposed to be the first blog on this platform😓. But here we are still. This process started at the beginning of my second semester (almost September - October of the year 2023), was scrapped multiple times( you'll know why with the story), and stretched along to a faint completion to the end of the year 2024. This was a bittersweet trauma to me personally. which is why- I almost have no media documentation in any form of the process. All I got were some reels I got made for Makers' Unfiltered by the end of this wretched process.


What is Capture The Flag

Capture The Flag is a traditional outdoor game played by kids, scouts, and even the military for training. This is majorly played in the anglosphere countries- like the US, UK, Canada, Australia, and countries in the Europe etc. The core concept of the game is this: Two teams each protect a flag in their territory. The goal is to sneak into the opponent’s side, capture their flag, and return it safely without being tagged. I became exposed to the game via a Minecraft server called- "The Hive" https://playhive.com/ (If my memory serves). I played the game so much, I did get pretty good at it- at the expense, unfortunately, of my JEE score 😖.  




Origin Story


When I first Joined JUMakerspace, I was so into this game, and Also, so damn desperate to create something I love out of the metal of the makerspace, this idea came very naturally to me. This was something I was so massively into(at the time of course)- This was something I was sure would attract a lot of people, AND the senior members there were planning the makers' carnival for that year- they needed events that would gather crowds- Time couldn't have been better for me to jump right in. I proposed my original idea- it went something like this: I conceived of the players as FPV helicopters(knowing not the first thing about any type of rotors and/or flying machines), So, I pictured it as teams of 2-2 human players, armed with their FPV drones trying to take the opponents' drones down and meanwhile flags that may attach to the rear end of these drones. But... y'know, I met a man named: Tilak Aggarwal. And this person almost changed the entire course of my, gonna be trajectory into robots. The beginning, though, wasn't much fancy- he knocked my original idea to the ground and gave me some reality checks. his exact words were: "pehle zameen par tho karwa le 😑". So, I did...From that point on, every step of the way, all the approach I took, was flowing from his design methodologies and his genius. With him, we first figured out n approach- he basically brought me a laser light detection sensor. which, slightly different from an LDR, gave a binary indicator of the presence of a laser beam. 



But this presented a problem- how do we make sure that the laser shot from all directions were fell on this tiny acrylic covered MOSFET? Tilak bhaiya came up with the solution, AND the original issue. He came up with the concept of designing a mirror structure that made sure, via multiple reflections, that somehow, the laser fell on this. He gave me the task of designing the said structure. During the process of formulating such design, I met another person named Lalit, who happened to stick with me throughout this process and with another one of our projects too(the RC boat). We eventually designed and 3D-printed this structure, got some square mirrors and stuck it on the structure, ran some tests. Although, we were surprisingly successful at what we wanted to achieve, we later scraped that idea because of how clumsy it all turned. He then suggested AND implemented another idea- He cut out a circle out of an acrylic sheet and put 9 smaller, circular holes into it, he gave it to us, and instructed to glue some LDRs into the smaller circles. we later understood the idea, if the laser ray fell on any side of the larger circle's edge, it spread evenly all over the acrylic, as long as the laser light was on the same horizontal level as the acrylic circle, and we got a fair reading of the whether the laser was shot or not. The logic went like this- if the bot was shot 3 times, it would shut down for 5 seconds, and, if it were holding a flag, it'd drop it. For the flag capture, our initial idea of using an electromagnetic was shot down on account of electromagnets drawing too much power by Tilak Bhaiya, where he himself came up, yet again, with the solution involving some neodymium magnets stuck to a servo arm, which, when turned downwards, caught the flag, and when turned up, released it because of a physical restraint.


 

Parallelly, he instructed me to design a body for the bot's chassis on a 3D design platform- I used the same one I did for the mirror structure- Fusion 360.  My initial design looked much like a UFO. Although we did not print it on account on not being very feasible to print, we did make similar bodies out of MDF wood.

                
                                                                                                                                               

Initial 3D Design for the bot

the 3D printed laser gun

For the bot design we had one more constraint- we had to make sure that, for the same team bots, the receiver and the LASER gun lie on the same level, and on exactly swapped levels for the opposing team. 

Representational image

Where it All Went South

We were, somehow,  able to get everything together before the time of the carnival that year- makers' Carnival 2023. which happened at the end of November. As a matter of fact, I wrote and tested the code of  the shooting logic the whole night before the last day of preparation for the carnival. Everything was fine - except for one thing - NOTHING FUCKING WORKED. This was what was happening right from the beginning, It worked, until it didn't, until it did, until it didn't again. And this was the reason the CTF project earned its cursed reputation. The seeds of this tragedy was sown by the very people who headed this ship. Tilak bhaiya, right in the beginning, declared the module we were to use for wireless communications in these bots- the nRF module by nordic semiconductors. Don't get me wrong now, once I got to know this, this is THE best wireless module by far- easily programmable, can swap out the antennas in some versions... but there is just one issue- doesn't work right- especially if you are a newbie (which I was). This was what led me to- 

  • Study all kinds of basic communication protocols thoroughly (even though nRF just uses i2c)
  • Study all kinds of noise in wireless circuits
  • Watch all kinds of videos on YouTube that even remotely mentioned the nRF module.
nRF module

We changed all the variables that we could conceive of to be related to this issue. We soldered all this onto a zero-pcb to shorten the wires, we swapped the module to the built-in antenna one, and whatnot. The mania that went on for almost one year including this project being scrapped multiple times. 

The conclusion

This finally came to conclusion when I decided to swap out nRF with esp8266. This was the final zero PCB I came down to: 


The final zero-PCB - we even used the l298n IC for the motor-driver instead of the module

I got my final closure with the nRF module when I finally sat down one day and actually perused through its documentation.The nRF module functioned in different modes of data transfer, we can configure it to transfer various amounts of data.  I found out what the actual issue was- the default amount was less than what we were sending from the remote to the bot. So, bandwidth < payload. which was why the data was getting lost midway through. Hence the "sometimes works sometimes doesn't issue". I used the nRF successfully in the boat project finally. 

This is a reel we shot as the final working scenes of these. The actual event never came to be because of various reasons I would not like to go into right now. But if this actually ever happens, I shall make sure to post an update on this. reel link: https://www.instagram.com/reel/DDaKRP7hfOX/?utm_source=ig_web_copy_link&igsh=MWZ6aXJua2VxeHBvdQ==.  This is the complete code on my GitHub: https://github.com/Darrumaa/Capture_The_Flag.






Comments

Popular posts from this blog

Lines of Code, Miles of Autonomy: The Autonomous car Project - Phase I

Someone Else's sunlight