Inspiration

The inspiration for this game primarily came from the series called "Welcome To The Game." These games had a unique way of implementing elements of computer science and programming into the mechanics of the game through randomly generated minigames in real time. The source of inspiration for the multiple choice section came from basic trivia style video games.

What it does

The basic rundown of the program starts with the reading functions that implement all the necessary variables to run the game and trivia from txt.files. This is run in the background and the user will not notice unless a txt.file is missing or corrupted. Then it displays the first menu options: Start a new game, Continue from a save file, Read the rules, or quit. The program is able to handle both starting from a new game and reading saved data from a save file and continuing from that savepoint. If you select a new game, you can select the difficulty, which determines the number of rounds to play. For each round, the game randomly selects a minigame and pulls a question from the database. Minigame one is Programmer, where the user is asked to type in the displayed code as shown and is rewarded points for full accuracy. Minigame two is Pop Quiz, which asks multiple choice questions on basic cybersecurity concepts.

How I built it

Every program starts with a concept, outline, and/or pseudocode. I start with determining what are the end goals of the program and what variables are needed throughout the function. Since I wanted to develop the functions for reading and writing save files, I had to design multiple functions and an organized system to handle and store the necessary variables to be accessed or changed at any time. Then, I started with the implementation of a class to organize and run all the functions and the driver to start the game running process. Afterward, I slowly worked each function associated with a different section of the game mechanics and rigorously tested every new function before proceeding to the next.

Challenges I ran into

I had 3 main challenges to overcome during the project. The first was both using the getline functions to read in the data from the txt.files correctly. I'm not sure how it's possible to get a stoi error from a getline function, but I did that unintentionally, multiple times. Even when getline was working, then I had issues afterward storing the data in the right locations.

The second was linked list implementation for the data of multiple choice minigame. It was either a linked list or some form of a 3D array, which I can only assume would cause more disasters than I experienced with the linked list. It was primarily syntax and segfaults errors when trying to access the data from the linked lists that ultimately lead to a restructure of the minigame functions.

The last problem was my getter and setter functions for the minigame questions. The intention of these functions was to store the question string or it's index number after it was already answered as a way of avoiding duplicates in the same game. Despite my best efforts and multiple versions of these functions, if you play the game enough times, every now then you'll still see a duplicate question in the same playthrough. It occurs with a higher chance when the player continues from a saved file.

Accomplishments that I'm proud of

Despite some minor imperfections, I'm proud that I achieved creating a working demo of a game I designed on a solo team. I'm happy with the organization and planning that went into it so that my time could be more focused on troubleshooting and debugging.

What I learned

While ambition is great, I learned to not be too ambitious and know my limitations. There were ideas for more minigames, a surplus of trivia questions, even implementing some version of a real-time coding section where the player had to code the displayed text within a certain frame of time. Time was most certainly the biggest factor and at times, while I would have liked to program more complex functions and game mechanics, I did have to settle for simplicity for the sake of moving forward and finishing a working demo. Lastly, a couple last minor lessons were converting integers into strings and re-learning how to cin a string that counts spaces.

What's next for CyberHack (Demo)

Well, the first step would be to look back at those getter and setter functions for the minigame questions and work out a new solution that fixes the issues mentioned above. Afterward, I would consider what other minigames I can implement that kids would enjoy while also educating them on cybersecurity. Lastly, I would most likely modify this code to run into some sort of game engine or user interface program to make it visually appealing as opposing to just staring text in a terminal screen the whole time. I've been told by a friend that the Unreal Engine runs on C++, so that's worth investigating for future projects.

Built With

Share this project:

Updates