Sponsored By

Designing Baba is You's delightfully innovative rule-writing system

Arvi Teikari, aka Hempuli, the creator behind the brilliant IGF Award-winning Baba is You, tells us about the process of designing a game that puts rule-making in the hands of players.

John Harris, Contributor

May 8, 2019

11 Min Read

Baba Is You is amazing. Start with a sightly more lenient version of block-based puzzle game Sokoban, but make some of the blocks into words, like ROCK, PUSH, WALL, FLAG, or WIN. When three blocks in a row make a sentence, like "ROCK IS PUSH," it creates a rule that immediately takes effect in-game: rocks in the stage become pushable. If you push one of the words in a ruleset out of line, that effect instantly ceases.

One of the rules on every screen states that something "is you." That thing (or things) you can control; if you break that rule, though, you make the level unsolvable, and will have to either undo or restart to continue. But more than that, there’s a ton of other words, with clever, and sometime hilarious, interactions. And later on, some very strange things can be observed...

Arvi Teikari, aka Hempuli, created the original version of Baba Is You for a game jam back in 2017, and it’s now available for PC, Mac, and Linux on itch.io and Steam, and on Switch, where it has dominated my TV for weeks now. Here's what Hempuli had to say about creating this gem of a game.

Lightly edited for length and clarity.

The soul of Baba Is You is its rule detection and implementation. Would you mind going through the process the game goes through in maintaining the rule table from turn to turn?

The game only updates the rules if it needs to; there's a variable that tracks if some of the words in a level move or change, and upon detecting that tells the system about the need to re-write the rules. Consequently, the game initiates the actual rule-writing process, which is divided into various subprocesses. The previous rules are removed entirely, and words that could potentially start rule sentences are detected on the level.

For example, the word "Baba" is needed to write the sentence "Baba Is You," so a "Baba" with other words below or to the right from it is picked here. Once these "first words" are gathered, the game checks for other words near them and does several rudimentary checks for these word jumbles.

For example, these checks make sure that the sentences contain enough words and in such configurations that they abide to the game's syntax (this is a fairly complicated process since the rule system is very dynamic). After these checks, the rules get restructured into a format more fit for storing and sent to a function that actually adds the rules to their relevant lists.

Finally, once everything is (hopefully) set, the game goes through the final set of rules and adjusts them if needed. (For example, if the rule "Baba Is Not You" exists, "Baba Is You" is marked as being not valid.)

One of the joys of Baba Is You is in finding a new word, like PULL, EMPTY, FALL, and MORE, and finding out what it does and all its implications. How did you come up with so many clever words?

Some of these words, such as SINK and PULL, imitate classic puzzle game behavior, and were thus somewhat obvious. Others originated from me trying to think of effects that could be interesting or that could look amusing; MORE and conditional worlds such as LONELY are good examples of these.

Lastly, as the development went on, I started seeing more and more opportunities for more 'meta' words, ones that somehow affect the game's rule system itself. TEXT, a word that allows the player to apply rules to the words themselves, showcases this category well.

Following up from that last question, once you have the words, you then have to build puzzles around them...What was your brainstorming process like? What kinds of ideas did you have to leave on the cutting room floor?

Usually once I implemented a new word, I immediately spent some time going through the most obvious level ideas that came from it. At times there didn't turn out to be many, and there's at least one word I ultimately left out due to this. After this initial level brainstorming, most levels came to me over time from considering the words and systems I had and trying to figure out surprising/amusing interactions between them.

Once I thought I had found one, I reverse-engineered a level that required the use of that interaction, and determined that way whether the idea was any good. Of course multiple levels were also based on suggestions from others, or came to me out of the blue without any explicit brainstorming. The "variant" levels (replay levels where the trick that worked last time has been disabled) especially were often based on tester-found alternative solutions that I didn't want to keep in the original level but wanted to otherwise have around.

Sometimes it turned out that designing a level that showcased the word interaction in my mind without the player being able to ignore and solve the level via other means turned out to be too tough, though, and the level had to be cut. Another reason for cutting levels was the setup for the intended solution turning out to be overly specific and needing too many supporting rules -- one of the biggest puzzle design limitations in the game has been that the levels very easily become overwhelming as the number of initially-active rules increases.

The game exhibits a lot of subtle decisions that make the game a lot more playable...Are there any particular juicy implementation details you'd like to point out, to show other devs the kinds of things you had to consider?

...At one point during development I quite suddenly realized that in certain cases the player would be able to stack words on top of each other. This hadn't crossed my mind at all previously. (Although a tester had made a level suggestion that would've required this, without me realizing, heh.)

The entire rule system had been built under the assumption that there'd always be only one word on a given space, and under these rules if a space had two words, the selection for which one of them to actually use in a rule would be arbitrary. Reworking the rule system to properly take these stacked words into account turned out to be one of the larger undertakings over the game's development, because the stacking adds the need to go through all the possible permutations a rule could have, potentially with only some of these permutations being valid.

Of course, most of this system is never seen in the game itself, but it felt very important to take the possibility of the player doing something utterly surprising into account.

Baba Is You got its start as a game jam entry... What's your thoughts on game jams, and what direction do you see them going?

Game jams are excellent for prototyping ideas that have been bobbing in your head that you don't know whether they'd work or be completely unfeasible. Being able to spend a limited amount of time to flesh out the basics of a concept, without having to worry about finishing or polishing it, helps a lot with figuring out how much potential it has, if it has surprising looming design obstacles, and so on.

Additionally, game jams can be good for getting new perspective by interacting with other devs and (in the case of physical jams) working in a new environment. Game jams have been a very fundamental part of the indie scene for a long time now, and I can't see that situation changing much in either direction.

A potential danger is, though, that an overly competitive/intensive approach to jamming can lead to overworking and crunch, neither of which healthy, and can reinforce these kinds of behaviors in other game development work. It's very important not to overdo it, and to be honest for me a big part of game jams is just walking around the venue and appreciating the atmosphere. I've had some of my favorite design ideas when taking walks during game jams, and spending a weekend doing literally nothing but sleeping and watching the monitor hardly leaves one in a good shape.

One awesome thing about Baba Is You is that, with add-ons, it's made in Multimedia Fusion 2. How did you find that experience? Did it make porting to Switch easier or harder?

I've been using tools of the Clickteam product family for at least 14 years, I'd say. I'm very accustomed to MMF2's quirks, and thus find it a comfortable tool to use. In fact, before a developer friend introduced me to a Lua plug-in for MMF2 in 2016, I didn't really have any substantial knowledge of programming languages.

Thus the decision to use MMF2 for Baba Is You was borne more out of habit (or should that be called "necessity" in this case?) than anything else. Lua allowed me to implement the game logic in ways MMF2's base "event system" couldn't have done without a lot of hassle, while MMF2 made things like rendering graphical assets very easy.

This approach did make porting significantly harder -- MMF2 has a couple of official exporting tools, but they have their own rules to follow and require additional work to support plug-ins. Luckily for me, the company MP2 Games had built an engine specifically for porting Fusion-made games; without it the Switch port would probably have been outright impossible without a rewrite from scratch, and ports to e.g. Mac and Linux would have had to be significantly more limited.

Baba Is You is a fairly difficult game, after a fairly easy beginning it throws a few pretty tricky situations at the player. The game is pretty lenient in letting the player open new regions though, so there's almost always another puzzle to try. Were you afraid that completionist players would fail to take the hint and try to completely solve every level before moving on?

I was aware of that risk, but before release didn't think there'd be much I could do beyond what the game already does. It made a lot of sense to divide the areas by words they introduce, and once that structure was chosen, it felt like a good idea to have also the harder levels incorporating a given word in the same area but try to nudge the player to look elsewhere when needed by some means.

In hindsight it has seemed that the "Extra" markers have been reasonably successful in preventing players from tackling overly tough levels too early on, but the incremental numbering definitely works against this "return here later"-design mindset. After release I've promoted a couple levels from normal ones to extras to make it clearer that they're way harder than other levels in their area, and even moved levels to different, later areas when it has seemed necessary, but the structure could definitely still be improved.

Baba Is You has some pretty dang huge secrets, and unique ways to unlock them! Is there any way you could talk a bit about what inspired them without giving them away?

Spoilers!

Quite early in the game's development, I knew that I'd make a huge mistake if I didn't include some kind of a meta structure into the game -- the game's mechanics were already on a sort of a metalevel due to the you-change-the-rules behavior, and I felt that the system would lend itself well to some kind of a deeper surprise. However, at first I had no idea what this would be.

The earliest ideas were e.g. having the final level include the rule "Game Is Win" or "You Is You" which would lead the player to a cutscene happening "outside" the game, or adding words that affect the game's UI directly ("Right Is Defeat" making pressing to the right deadly, and so on); these were interesting but quite shallow and more one-off gimmicks than full-depth explorations of the game's mechanics.

Another one of these early ideas was some kind of a secret world, or a new version of the world map. When getting this idea the world map was an entirely separate screen outside of the game's logic, and it took quite some time and suggestions from other indie developers to get to the idea of the map being a level like any other. Yet more time was required to figure out how the player would interact with the implications of this, and I actually can't remember if the idea came to me independently or based on someone's suggestion.

Nonetheless, I was very happy when I finally got the codebase to the point where I could implement this meta system in full. (A tester actually convinced me to make the meta structure go one level deeper than what I had initially intended, hehe.)

About the Author(s)

John Harris

Contributor

John Harris writes the column @Play for GameSetWatch, and the series Game Design Essentials for Gamasutra. He has written computer games since the days of the Commodore 64. He also maintains the comics blog Roasted Peanuts.

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like