Introduction

CodeCombat is a 2D HTML5 role-playing strategy game, set in a medieval fantasy environment. The goal is to use coding techniques to guide your character through a series of areas and levels that are made to advance in difficulty as your programming skills improve. The intended outcome of CodeCombat is for the user to become familar and practiced with an array of valiable programming essentials.

Below is a detailed analysis of this game roughly following Brian Winn's1 Design/Play/Experience framework, including:

Learning

CodeCombat was designed as a tool to teach players the fundamentals of the programming language of their choice. In its current state, CodeCombat offers the game experience in Python, JavaScript, CoffeeScript, Clojure, Lua and Io with the goals of:

Storytelling

CodeCombat takes place in a medieval type fantasy setting initially following Captain Anya Weston or Sir Tharin Thunderfist; other characters can later be unlocked. The game does not have cutscenes or story narration. Instead, the narrative is driven by the player avatar's current location and the text description of the various levels in each area. The player starts in Kithgard Dungeon while learning how to navigate and defeat enemies. Through the goals of the levels and the direction of the player's progress across the map, it soon becomes obvious that the overall objective of this area is to escape to the outside world.



Regardless of which character the player chooses to play, they take on the role of the hero of the land. They must defeat legions of ogres and other foes as they flee the first dungeon, and later find themselves defending towns and protecting villagers. Even without much in the way of a narrated story, the various ways that the game progresses the character, the levels and the difficulty gives a strong feel of depth and development to the game.

Gameplay

The gameplay in CodeCombat mainly involves using code to control the avatars actions in order to meet the goals and pass the level. Since it is an open-source game, players can also create and edit different levels by themselves. CodeCombat combines the features of a role-playing game with the functions of a built-in code editor and methods to make typing code an interesting task for everybody.

The basic rules of the game are simple: the player’s avatar must traverse levels and do combat with various enemies guided entirely by commands written in code. In order to complete the goal of each level, the player must equip the hero with the right gear and items that are capable of performing the necessary functions for that level.



When the player begins, he can follow the tips and hints to type simple code, and then run it to see whether or not that code completes the level goal. As the code runs, the player can see real-time feedback about how the code is affecting the avatar’s actions, which also makes debugging easier and more intuitive. In later levels, the player may need to manually operate the avatar in-game instead of just watching and waiting for the result, which improves upon the playing experience.

The player receives rewards each time they complete the level goal. The rewards are often gems and experience points, and occasionally a new item. With enough gems and experience, the player can buy additional items to upgrade the avatar, unlock new avatars, and open up extra levels to gain more rewards.



There are three tutorial levels to teach people how to operate the avatar, how to pass the levels by typing code, how to run and submit the programs, how to search for help in each level, and how to buy and equip items. This scaffolding is gradually faded during the course of the game, with new support being offered only once new items or new functions are introduced.

Before entering the game, players can choose to play single-player mode or multi-player mode. In multiplayer mode, the player can choose to play as humans or as ogres. Unlike traditional multiplayer games, the players in CodeCombat must communicate with code instead of talking directly to their teammates. The objective is to build their own combat code and challenge the code written by other players. There are also rankings among the players, so players can see their progress each time they revise their offensive code. This is a great way to motivate players to improve their coding strategies.

User Experience

CodeCombat is a 2D game with various top-down maps in several different chapters. Each level is displayed as a red circle on the map. A level that the player has completed successfully is marked with a red flag. A gray flag means that the player tried and failed in that level. Levels marked with a star can only be unlocked by paying real-world money or in-game gems. The player can see the game's progress and also choose different routes by clicking on different points on the map. The player can also review what knowledge points they have learned by clicking the red circles they have visited. The design of the map inspires the player to keep playing the game, and also review the former knowledge points so that they can tackle more difficult challenges. However, sometimes simply listing the knowledge points on the map is not enough. Often, the player will need to review not only the functions that they have learned, but also the code they have previously written. It might improve the user experience if the design allowed the player to collect their previous code in a notebook, instead of needing to replay the older levels over and over again.



The interface also includes several buttons on the bottom of the map, with which the player can change their hero and buy and equip different items without entering a level. A pull down menu in the hero’s inventory interface allows the player to change the coding language that they are using to play the game.



When the player starts a level, they can type the code they need to control the avatar on the right side of the screen. If the code is stuck somewhere, a warning will show up and give the player some tips about the necessary code required to complete the level.

Technology

CodeCombat is a html5-based game that is played in an internet browser. The game can be expensive when it comes to memory and is slow or jumpy on certain machines. However, the designers are regularly taking steps to optimize the game, switching from raster sprites to vector images and adopting new code (sometimes from their own users) to improve the performance.



I believe the use of an online browser based game was the best choice for this kind of project. It allows for quick and easy access to the content without a download, multiplayer server based games, and the easy addition of player-made levels. It also puts the players only a single click away from both the blog and the forums so that they can see the news and get help with coding problems quickly from the community.

Assessment

We could not find any formal assessment for CodeCombat, either from an academic paper or from the CodeCombat team. CodeCombat has a feedback advantage over many other Serious Games because it is an open-source project. People who often use Github or another similar open-source platform will likely take notice of such an interesting project once the alpha version has been published. With players taking part in the discussion on the forum of Github and CodeCombat's official forum, or publishing recommendations for the game on their personal blogs, more players and level editors will play and comment on the game, thus forming an active community for feedback. We can get a sense of assessment from some of the comments. Most of the comments and discussions are focused more on how to pass the levels rather than assessing the design or instructional efficiency of the game, but they demonstrate player knowledge of the code required and an additional form of teaching that this kind of community can provide.



However, user comments are uncontrolled and are often too vague to come to a conclusion about the efficiency of the game. Without a pre-test, we cannot know the code background, the age, or the job of a player, or even truly judge the player's understanding of the game itself. As a consequence, we cannot know whether the player’s coding progress can be totally attributed to CodeCombat. It would be better if the game provided a simple pre-test at the very beginning to gain an understanding of the player's initial skill set.

Conclusion

CodeCombat presents a fun and friendly game engine, and a helpful community in which the developers are frequently active. The game does a good job of teaching many of the fundamentals of coding, especially concerning scripting purposes, and the emphasis on strategy during the game results in the player needing to use smart coding techniques to build efficient algorithms. It would be nice to see CodeCombat expanded in the future to teach even more of the skills that are important in programming, such as arrays, exception handling, recursion and more. It would also be nice to see more languages included, like Java, C++, C# and others.

References

  1. Winn, Brian. The Design, Play and Experience Framework. In R. Ferdig (Ed.), Handbook of Research on Effective Electronic Gaming in Education. Hershey, PA: IGI Global, 2009, pp. 388-401.
  2. Iuppa, Nick & Borst, Terry. End-To-End Game Development.
  3. http://blog.codecombat.com/hacking-our-way-to-vector-artwork-in-html5
  4. http://blog.codecombat.com/beat-this-level-get-a-programming-job