Bitburner: Learning JavaScript Through Games

Learning through play


Author: CHayes Published on: November 18, 2024

What makes a good game? Is it graphics, voice acting, or responsive controls? The immersion provided by these factors is certainly an important part of modern game-experiences, but I posit the core of games is giving a player cycles of challenge and learning. Failing initial objectives provides an important buildup to the accomplishment of ruleset or controls being mastered and objectives met. When a game presents a challenge or objective to the player and that player must develop a strategy for success with the tools they’ve been given, this is the foundation of fun games. Particularly good games will layer a progression of challenges and learning that build off of and compliment each other.

Sometimes simply learning about the gameworld can satisfy these conditions, such as in the open-world games of Skyrim and Fallout. Sometimes learning the mechanics of play qualifies as this progression, such as in fighting/action games, or RTS games as Dota and Starcraft. The progression of learning is key to the satisfaction we feel when accomplishing or winning a game - if the entire experience is luck and chance, there is no personal component to the success conditions being met.

With these principles in mind, I tried my hand at the JavaScript-focused, text-based RPG of Bitburner. When possible I tried to develop my own solutions to the challenges presented, and use online resources (except official documentation) minimally. However when I did search forums for advice, I found an overwhelming quantity of code-dumps without comments or explanations to the thought processes these authors employed. This showcase is my response to these “guides” of unaccompanied code. I will try to isolate a sought objective and then explain my process of developing solutions for these challenges. To respect the game creator and to show my problem solving abilities, I will seek to present more than just “cheat codes,” but provide a blueprint to identifying problem variables and allocating resources appropriately.