Code Hero: Programming players

Code Hero: Programming players

Code Hero is an FPS unlike any you’ve played before. Maybe we should call it an FPC – eschewing bullets for code, the game arms players with a gun that fires lines of Javascript and Unityscript.

Made by San Francisco-based indie Primer Labs, Code Hero is purpose-built to teach people how to code, exchanging power ups for its players' growing knowledge of Javascript, and ultimately make their own games.

If a platform is out of reach in most games, you instinctively look for the switch. But in Code Hero, firing the right line of code at other objects in the level will change their position, allowing you to build a bridge. Or perhaps a number of enemies need to be destroyed quickly before they reach you. With the right knowledge, you could include a rule in your customised code ammo that takes out identical objects rather than fire individual ‘destroy’ statements at each one. The ability to alter the environment directly allows for a dizzying number of solutions to each level, limited only by your coding proficiency.

Valve’s Portal did a great job of empowering players with the sense that they were manipulating an environment in ways its designers didn’t intend. Every glimpse behind the carefully constructed boundaries of GLaDOS’ rat run hinted at a wider world beyond the sterile white test chambers – one you just might be able to reach with a couple of portals and enough thought. But Code Hero explores what happens when you let the player go deeper and manipulate the actual code that defines the world around them.

Built in the Unity game engine, its guiding principle is to educate players in and democratise game development. The game breaks players in gently with a series of Portal-style spatial puzzles in which lines of code, and their effects, are introduced by AI mentors including computing pioneers such as Ada Lovelace, Charles Babbage and Alan Turing. “People often say, 'It's like Portal with the Matrix,' or, 'It's like Minecraft with guns',” laughs Primer Labs co-founder Alex Peake. “Yeah, exactly!”

Peake envisioned Code Hero as a gateway to using fully fledged development environments, helping kids access the resources they needed easily. Impressed by Unity’s platform early in its development, Peake gambled on the Danish company eventually releasing a free version of its software. “I was counting on that because I intend to teach kids how to use this and they need the free version',” Peake says.

“2.6 was the first free version, and at that moment I knew that, not only could I make my game with Unity, but that I could accomplish my real objective: To give people the power to code the game they wish to see.”

Code Hero preserves its FPS heritage in the fact you still aim with the mouse, but you interact with the world by bringing up a console (essentially your bullet chamber), either copy and pasting code from tutorial screens dotted around each level or by typing straight to the metal.

Cleverly, while levels can be completed with just the provided code, certain bonuses can only be reached by players willing to get their hands dirty: it’s only a small leap to realise that changing a value in a "transform.position" statement you just grabbed means objects can now be moved anywhere in space. Bosses are similarly open-ended in design, each battle testing the specific skills learned during the preceding levels, but open to any number of exploits if the player is shrewd enough.

Beyond the main levels, there’s a sandbox mode that allows for even greater tinkering under the bonnet, and provides the option to export the results directly to Unity’s development environment and continue working on your project. And it's woven deeply into the game's design.

“In Code Hero, the idea is to suck people into the rabbit hole of an adventure, and at the other end, they ship a game,” says Peake. That's right, beating Code Hero will require you to release your own game.

While Code Hero is already in beta, Primer Labs is hoping to complete the project using funds generated through Kickstarter. At the time of writing, the project has already raised $112,530 against its $100,000 goal with 42 hours to go. Unity CEO David Helgason has already pledged his support with a personal donation of $1,337. And two people have even backed the game for $10,000 or more, which will get them a position on the development team designing a custom game challenge as well as a part as a game character.

Portal proved it, The Sims proved it. Guitar Hero proved it,” says Peake. “These are games that made it safe to not be Call Of Duty and proved that there is a market for intelligent meaningful games where you get something out of it and it reflects on real life.”

Code Hero is undoubtedly ambitious, but still looks rough around the edges. Its open nature will make bug eradication a slow process, and the basic textures and gaudy colour scheme currently in place aren’t the most appealing we’ve seen – though new artist Gizmo, one of the people behind the Debris 95k engine demo, will hopefully create visuals to match the game's appealing concept. But crucially, the game’s structure feels solid and considered – just an hour with the code gun left us with some basic Javascript knowledge and a desire to delve deeper into the world of programming. As a game, Code Hero might be a little demanding for casual players, but as a feat of cleverly packaged education for those who want to do more with games than just play them, it’s a marvel.