# SpaceChem

SpaceChem is a puzzle and indie game by Zachtronics Industries, based on principles of automation and chemical bonding. In the game, the player is tasked to produce one or more specific chemical molecules via an assembly line by programming two remote manipulators (called "waldos" in the game) that interact with atoms and molecules through a visual programming language. SpaceChem was the developer's first foray into a commercial title after a number of free Flash-based browser games that feature similar puzzle-based assembly problems.
The game was initially released for Microsoft Windows at the start of 2011 via Zachtronics' own website. Though it was initially rejected for sale on the Steam platform, Valve later offered to sell the game after it received high praise from game journalists; further attention came from the game's release alongside one of the Humble Indie Bundles. The game has since been ported to other computing platforms and mobile devices. Reviewers found the game's open-ended problem-solving nature as a highlight of the title. SpaceChem was incorporated into some academic institutions for teaching concepts related to both chemistry and programming.

## Gameplay

In SpaceChem, the player takes the role of a SpaceChem Reactor Engineer whose task is to create circuits through which atoms and molecules flow with the aid of waldos to produce particular batches of chemical shipments for each level.
The primary game mode of SpaceChem depicts the internal workings of a Reactor, mapped out to a 10 × 8 regular grid. Each reactor has up to two input and up to two output quadrants, and supports two waldos, red and blue, manipulated through command icons placed on the grid. The player adds commands from an array to direct each waldo independently through the grid. The commands direct the movement of the waldo, to pick up, rotate, and drop atoms and molecules, and to trigger reactor events such as chemical bond formation. The two waldos can also be synchronized, forcing one to wait for the other to reach a synchronization command. The reactors may support specific nodes, set by the player, that act where atomic bonds can be made or broken, where atoms can undergo fission or fusion, or where logic decisions based on atom type can be made. As such, the player is challenged to create a visual program to accept the given inputs, disassemble and reassemble them as necessary, and deliver them to the target output areas to match the required product. The product molecule does not need to match orientation or specific layout of the molecules as long as the molecule is topologically equivalent with respect to atoms, bonds, and bond types; however, in larger puzzles, these factors will influence the inputs to downstream reactors. While the two waldos can cross over each other without harm, collision of atoms with one another or with the walls of the reactor is not allowed; such collisions stop the program and force the player to re-evaluate their solution. Similarly, if a waldo delivers the wrong product, the player will need to check their program. The player successfully completes each puzzle by constructing a program capable of repeatedly generating the required output, meeting a certain quota.
In larger puzzles, the player can also guide the formation of chemicals through multiple reactors, which they place out on a larger rectangular grid representing the planet's surface. From here, the output from one reactor will become the input for another reactor; the player is often free to determine what intermediate products to produce to send to the next reactor. The player must not only program the individual reactors, often limited in functionality such as one that can only break bonds but not form them, but plan out the location and order of reactors to make the final product.
The game's puzzles are divided into groups set on different planets. Players generally must complete each puzzle in order to progress to the next one, but the game includes optional harder puzzles. Final boss levels, called out as defense levels, complete each planet; here, the player must efficiently create chemicals and deliver them in a timely manner, once the reactor systems have been started, to trigger defense systems to ward off attacking enemies before they destroy a control structure.
Upon completion of each puzzle, the player's performance is compared on a leaderboard based on the number of instructions placed in their reactors, the number of cycles it took to meet the quota, and the number of reactors required to meet the solution. The player also has an option to upload videos of their solution to YouTube. The player, once having cleared a puzzle, can return to previous puzzles to try to improve their solution by reducing the number of instructions, cycles taken, or reactors used. SpaceChem supports downloadable content created by the developers themselves, and user-submitted puzzles through its ResearchNet service. A later addition included an open-ended sandbox mode where players could simply explore the game's capabilities.

## Development

Prior to SpaceChem, Zach Barth, the designer behind Zachtronics Industries, had created several Flash-based browser games with automation puzzles, including The Codex of Alchemical Engineering where the player had to place and program manipulator arms to construct atoms and molecules following the rules of alchemy. Barth had wanted to expand the ideas in Codex to include more realistic aspects of chemistry, such as more complex molecules, but did not pursue the idea immediately afterwards. About a year after completing Codex, Barth was inspired by the disused chemical plant at Gas Works Park in Seattle, giving him the idea to incorporate pipelines into the basic mechanics of molecule-building from Codex.
SpaceChem took about a year with a team of seven people from around the globe to create: Barth was responsible for design and production, Collin Arnold and Keith Holman handled the programming, Ryan Sumo created the visuals, Evan Le Ny the music, Ken Bowen the sound and Hillary Field created the game's narrative. The development costs were around $4,000, with the team working on the game during their spare time on weekends. Barth considered this a risk-cutting measure; if the game did not succeed, the team still had their full-time jobs they could continue. The team used the C# language built on the Mono framework for the game which would allow for easy porting to other platforms beyond Microsoft Windows. Initially, they had considered using Microsoft XNA for ease of porting to the Xbox 360, but later opted to consider other release platforms, requiring them to switch to the more portable Mono framework.
In designing puzzles, Barth wanted to keep puzzles open-ended, allowing the player to come to a solution without funneling them in a specific direction. The team designed puzzles based on general chemistry concepts without envisioning the specific solution that the player would take. They brainstormed a number of puzzles and then eliminated those with similar solutions, and arranged the others into a reasonable learning curve for the game. Despite this, Barth reflected that the tutorials provided to explain the game's mechanics had mixed responses, from some players who took up the concept easily to others that remained baffled as to the puzzle's goal even when instructions were set out step by step. In some cases, Barth discovered that players made assumptions on limitations of the game from these tutorials such as the idea that the red and blue waldos must remain in the separate halves of the screen. Based on the feedback that players had made on sites that hosted his previous Flash-based games, Barth designed the global-based histograms to allow players to check their solution without feeling overwhelmed by the top players as would be normally listed on a leaderboard. He also devised the means of sharing solutions through YouTube videos due to similar comments and discussions on the previous games.
Barth had envisioned the game as his first commercial project, and based on feedback from Codex and other games, wanted to include a storyline along with the puzzles. The story missions included "defense" puzzles that typically were considered very hard to solve; Barth recognized after release that players would stall out at these puzzles and not attempt to complete the game, with only 2% of the players tracked having reached the final puzzle. Barth would have likely placed the harder puzzles at the end or as part of the ResearchNet add-on. He also tried too much to incorporate a theme based on scientific research, popularized at the time by the success of Portal. He instead found potential players were scared off by the chemistry aspect even though the game had little connection to real chemistry; a colleague had once suggested to Barth that if the game was named SpaceGems and modeled around alchemy, the game would have sold twice as many copies.
SpaceChem was released on January 1, 2011 via digital download from the Zachtronics website for Microsoft Windows, Mac OS X, and Linux computers. They had initially sought to get approval from Valve to sell the game through Steam, but Valve refused them, and thus opted for sale from their own website. Shortly after its release, the game received several positive reviews including one from Quintin Smith of the gaming website Rock Paper Shotgun. Zachtronics was contacted two days later by Valve with an interest to add it to Steam. The game was subsequently made available on Steam by March 4, 2011, and later on GamersGate on March 17, 2011. The inclusion of the game on Steam was considered by Barth to be the largest boost to sales of the game, outweighing any other distribution method they had.

### Post-release support

SpaceChem received a free update in late April 2011, which added several new features to the game as well as new puzzles. The patch included support for the ResearchNet puzzle creation and sharing system, and for the Steam-enabled version, support for achievements and leaderboards specific for Steam friends. The update for the Steam version also included a small set of puzzles tied in with Team Fortress 2, which upon completion would reward the player with a decorative item they could use within Team Fortress 2. The game was included in the Humble Frozen Synapse Bundle charitable sale in early October 2011.
SpaceChem was ported to the iPad in October 2011, using touch controls instead of mouse and keyboard to manipulate the visual program. An Android port was released in July 2012. Both mobile platforms include most of the full game excluding the defense puzzles. The sandbox mode was added at the request of a player who was trying to explore SpaceChem computational abilities. Alongside the sandbox mode, Zactronics offered a contest for the most interesting sandbox creation. This same user was able to demonstrate a brainfuck interpreter within SpaceChem, claiming that the visual programming language was Turing complete. Barth has mentioned the possibility of a sequel in an interview with IndieGamer.
Zachtronics Industries has encouraged the game to be used as a learning tool for programming and chemistry concepts, and offers discounts for schools, though briefly offered the game free-of-charge for educational institutions for a few months after the release of the sandbox mode addition. According to The Independent Games Developers Association, schools in the United Kingdom have started using SpaceChem to teach students fundamental programming concepts. The success of SpaceChem led to several companies contacting Zachtronics to develop educational titles; the company spent about two years working with Amplify to develop three "edutainment" games for their platform before they returned to work on more direct entertainment titles, but used the opportunity to improve on their in-game teaching mechanics.
On September 30, 2012, SpaceChem was the featured game on IndieGameStand, a site which features indie games with a pay-what-you-want model with a portion of the proceeds going to charity. Zachtronics Industries chose the Against Malaria Foundation as the charity to which 10% of the proceeds were donated.
On October 25, 2015, Zachtronics announced they have dropped all support for SpaceChem on the iOS and OS X platform. The reason they gave was due to the complexity of the Mono package for future support.

## Reception

Aggregate score :
| Aggregator | Score |
| Metacritic | 84/100 |
Review scores :
| Publication | Score |
| Eurogamer | 9/10 |
| PC Gamer (UK) | 89 |
SpaceChem was generally well received by critics, with an aggregate Metacritic score of 84 out of 100 from its Microsoft Windows release. Quintin Smith of Rock, Paper, Shotgun said "I think we might have just received one of the year's best indie games in the first week of 2011". Gamasutra's Margaret Robertson praised SpaceChem's gameplay, contrasting it with other open-ended activities as it offers the opportunity for the player to be as creative as they want to be within the minimal ruleset required of each puzzle. Robertson also found the game to be thrilling, having each puzzle initially appear "so astonishingly dispiriting" to what she had previously learned, but through trial and error coming to a solution that works and giving her the feeling of having "made a creative statement" in her solution. Eurogamer's John Teti praised the means through which the game introduced new mechanics without excessive reliance on tutorials; he commented that "the problems become more daunting" through the addition of new elements and commands, the game "is always more accessible than it looks". Edge said "The triumph of SpaceChem is that overcoming these situations is more a case of inventing a solution than discovering one."
Gamasutra named SpaceChem the best indie game of 2011. Though total sales of the game are unknown, at least 230,000 copies were purchases as part of the game's inclusion in the Humble Indie Bundle. Barth stated that with sales of SpaceChem, he was able to quit his job at Microsoft and run his development company full-time. Ryan Sumo, the freelance artist for the game, gained recognition in the industry and went on to help develop the art for Prison Architect.