Hack to save the world from nuclear Armageddon!
Updated: Oct 7, 2023
This next prototype, no 3D or 2D world this time, but only uses a terminal simulator to hack into an Imperial nation for the rebels (this includes you!).
Your job as a hacker is to shut down three facilities to prevent the dictator’s mad scheme to launch nuclear Armageddon and make it difficult for the dictator’s military to fight back against the rebels.
This was an easy project to do, however, I learned some new programming tricks (more below) that gives me better ideas on how to use them. Unlike the other practice prototypes, I have done alone, I only programmed one script which is “terminal” which controls level selection, menu, and jumbled passwords to guess, and commands to type. The rest of the scripts, 2D assets, and sfx are provided by Gamedev.tv since it was based on a tutorial from them.
WHAT I LEARNED:
On some occasions, changing variables to const’s will allow the game to run faster and heavily reduce it causing an error.
Using Enum’s to determine on which screen the player should be in: e.g. Main menu, password, and win screen while working with a level int that also determines if it’s part of level 1, 2, or 3.
Using a string to determine the player's inputs if the player types of things like “menu”, “exit” “quit” or “close”, easter egg numbers and levels (both for main menu only) “1”, “2”, and “3”.
Using switch statements to determine which level input (meaning which level the player has typed) and each case level value that contains a string array of passwords that will be jumbled ready for the player. Each of the 3 groups has a collection of passwords that the player must guess the password by typing the password name to match with the jumbled password to win the level.
Using a default case if the player types an invalid level number that is higher than 3 or less than 1.
Using an int parse for a level value to pass it into a string to activate levels depending on which of the valid level the player has chosen.
During gameplay of the levels, using if statements to determine if the player has typed the valid password (string) and will display win screen, else restart the level.
Using one function to add terminal line of "you can type menu at any time". Meaning don’t repeat yourself if you can. Same goes with functions like clear screen (clears all text on screen and brings in new text), and display win screen.
Using a function with a switch case with the level passed value from int to string to determine which level was completed and matching the appropriate win screens with ASCII text. So, if player completes level 1 = ASCII win screen of tank and completes level 2 = ASCII win screen of lock.
Organising the code to be clean, easy to read and not too jumbled for myself and other people to read the code.
Giving people want they want from menus and Ui save’s surprises for the narrative and the story in the game itself to be found by players later.
How consistent are switches compared to if statements for using different logic in blocks of code. They can also be used to compare other values like ints, floats, strings, etc.
Deleting the library folder in the unity project will reduce half the size of the project before zipping. The library will be rebuilt once the project is open.
Variables that are built in unity have a lowercase and are called primitives (e.g., int or float).
length is a property in an array.
Expressions: which evaluates to the same thing of type of code e.g "Hello world" and "Hello" + "world".
The difference between local variables which are inside functions and member variables which are outside functions and available to all other functions.
How effective Enum’s can be used for menu items because its organised like a file directory.
WHAT WENT WRONG? WHAT COULD HAVE I DONE BETTER?
I couldn’t make a build of this game so people play the game, it might have been because I shared different game assets in one project which may have conflicted with other files. I did try to export the dependencies to a new separate project so I could make a build, but I got strange errors that certain datatypes were missing. It was very difficult and confusing so I didn’t bother going through all that trouble, but I definitely should make separate projects for each game next time.
I got someone to test my game, she easily got past the 1st level because the words were easy as intended, but she couldn’t get past the 2nd and 3rd levels which are medium and hard difficulty respectfully. I had to tone down the words. I got her to test my game again, but she still had no luck with 2nd or 3rd level.
I could have spent more time testing the difficulty with people, but I had to let it go because the project was not a commercial game, but a practice project and I wanted to work more time on more important projects that I have more faith that will do commercially. I don’t know how popular or niche those hacking sim games are in the market.
OVERALL:
It was a decent project to exercise the basic coding I knew, but in a new different, and efficient way. I’m happy that I gave it a go, learned some new tricks, and built myself up with more coding and game design knowledge.
Normally those hacker sim games are not my cup of tea, but it was something different and set itself apart from my other prototypes on my portfolio since I have a lot of first-person shooters, minigames, 3D models, UI work, and misc.
It was good to warm up my game design and testing session before I find more work for clients, but I will need more experience in toning the right difficulty for players.
Comments