Imagine someone was digging through an old attic and found a crumbling and yellowed scrap of paper that held these cryptic lines with no date or name:

The king of the amorous peerage,

You, with tearless on the twain;

The falchion death — approached the forth assay,

With mickle lord with evil and duke with choice,

Upon that the crystal warrior cried, seized,

which caused his arm to be scanned by his sleight,

Renewed the shall none imprest, misjudging for a day

That I ever were.

There would be something captivating about it. The lines don’t really mean anything but they sound like they should. Phrases like “The king of the amorous peerage” and “tearless on the twain” have a nice bounce when read aloud. Throwing the lines into a plagiarism checker comes up 100% unique, and Google offers no answers. Even if the discoverer decided the poem was nonsense, it would be hard to dismiss: some long-dead person had to come up with these words and feel they were worth writing down. Even without any context, the humanity grants it an importance.

Now imagine that those lines were written by a Java program that builds text by knowing which letter is most likely to come next based on a statistical analysis of the frequency of letters in a 16th century epic poem (Orlando Furioso) that I copy-and-pasted into the program straight from Project Gutenberg. The gnawing mystery of the first scenario is replaced by an “oh, neat.”

Where the discoverer of the hypothetical attic note might have been driven to madness, bidding thousands in an auction to win an unearthed volume of poems by The Tearless Twain Poet, I doubt anyone would really be interested in sitting down and reading the hundreds, thousands, or millions of stanzas the Java program could churn out. It can produce so many words the amount becomes irrelevant. The semi-coherent sentences and sonorous turns of phrase become amusing coincidences, interesting to us humans but really only a temporary accident the computer made in while completing its calculations. It’s the same principle behind why things like the Voynich manuscript still earn public attention six centuries after its creation, while the equally mysterious and contextless creations of a computer, well, don’t.

And this is why I wasn’t surprised when the No Man’s Sky hype train slowly chugged into the station of ambivalent and middling reviews. When people excitedly talked about the game’s eighteen quintillion planets, I thought, oh no, they’re expecting eighteen quintillion Skyrims. I knew it’d quickly gain the “what’d the computer make this time?” aspect that reading eighteen quintillion stanzas of the Java-created poem would. Sure enough, the people speak: “A mile wide but [an] inch deep” (Steam review, Squirrely1337). “The planets are mostly identical and have an empty sterile feeling to them so what’s the point of having millions of them. [I’d] rather have 3 interesting ones.” (Metacritic review, Bortx) “Every planet is a different shade of rocks … it’s like driving in the suburbs … it’s completely desolate.” (Rich Evans)

Not that I wanted No Man’s Sky to fail—I’m not a monster. I got as excited as anyone when a game (with colors) based on random generation was showcased and stole hearts at E3 2014. I don’t believe any popular video game has fully tapped into the allure of endless content and true surprise that random generation can provide, but there’s an important problem with random generation—how do you get attached to it? How do you stop looking at random generation as a tech demo (“what it’d make this time…”) and more like a game? When it comes to nostalgic ingrained attachment, can an algorithm’s temporary creation ever create a Bob-Omb Battlefield or a Hyrule Field?

When wanting to create meaningful random generation, there are decades of video games to take inspiration (and warning) from. Random generation has been a part of video games from their earliest years, where it meshed with early games’ abstracted graphics and limited memory. Even though modern video games don’t have the space restrictions they once did (AAA games regularly balloon up to 20–30GB, while some games like Grand Theft Auto V are over 60GB), modern games have continued to find new and varied uses for random generation’s capabilities. No Man’s Sky held its random generation as its innovative selling point, yet eight years before, Spore had a comparable variety of random planets, aliens, vehicles, and music. However, it remains best known for its genre-hopping gameplay and emphasis on player design. In Spore, the random generation was a tool to flesh out the background of what was a fun game, not the game. The randomization-heavy “roguelike” genre has also had a modern renaissance since Rogue, the genre’s namesake, was released in 1980. Roguelike and roguelike-inspired games like The Binding of Isaac and FTL: Faster Than Light use randomized levels and rewards to maintain the feeling of a fresh start and not knowing what lies ahead of you and requiring the player to prepare accordingly. (As opposed to the Dark Souls games where the reward comes on the fifth replay when all the challenges that frustrated you on the first play are left right where you remembered them.)

But every now and then a game earns attention for its randomness alone, especially when discussing the size of overworlds in video games. Before No Man’s Sky’s trailer made headlines, Minecraft was famous for having the enormous video game overworld. Its in-game map stretches thirty million blocks in each direction, which, if one assumes a block is a meter, is several times bigger than the surface of the Earth. Yet for all that terrain, exploring it leads to a familiarity with the game’s algorithm. “This is where that biome ends and another begins,” “this biome has ground blocks of sand,” “this one has steeper hills,” etc. In single-player Minecraft, the terrain becomes mere resources, an unsoiled canvas upon which to build your favorite SNES sprite or a calculator or what have you. Even though exploring the terrain has limited entertainment value, the terrain nonetheless succeeds in creating the feeling that the Minecraft overworld is genuinely enormous and full of resource and potential.

A desert biome births a wintry biome across the water.

In 1996, the second Elder Scrolls game Daggerfall used random generation in a similar way. The game’s square mileage is difficult to calculate, but estimates lie between the square mileage of Britain or mainland Europe, depending on the method used. Is that ambitious awe-inspiringly huge overworld fun to explore? No. The land between cities and dungeons is filled with literal miles of bumps and front-facing bitmaps of plant-life, and its monotony is extremely apparent in time-lapses (here’s one covering the length of a small region in the game’s continent). But like Minecraft, this giant world serves a subconscious purpose. When the fast travel estimates two days to fast travel to a dungeon four pixels away on the world map, you believe it. When an NPC gives you twenty days to find mummy wrappings, you don’t snicker about how in real life it only takes ten minutes to walk to the dungeon like it would in a modern RPG—you skip on resting in inns so you can give yourself enough wiggle room to get back in time before you’re thought dead. When a queen worries about her kingdom, you’ve seen the expanses of land and crowds of NPC’s she rules over, not the thirteen named NPC’s that somehow produced a castle and a surplus of guards to protect it. You’re never going to spend actual hours to walk from city to city when playing Daggerfall, but there’s an honestness about the size, and something empowering about the fact that you can make the trek. (See how a minute into the time-lapse video you break out of the snowy woods to find a city that happened to be in the way and you can travel over it and back into the terrain it sprung from.) While it all made an effective backdrop for the story and freedom-oriented gameplay philosophy of The Elder Scrolls, it was still more backdrop and intriguing-ambition than fun-gameplay-element. [It was for the better that the third Elder Scrolls game, Morrowind, had a small hand-crafted overworld, but it’s disappointing that Bethesda has apparently given up on the dream of a giant life-size continent even though technology has advanced two decades. How are there only two games between Daggerfall and Skyrim? Anyway.]

What path is there then for a game that tries to showcase random generation as a central core to its game, something more than a backdrop or a level freshen-upper, but without the pitfalls of predictability and shallowness that No Man’s Sky fell to? There’s no set checklist, because there’s no set style of video game. What works for a narrative-focused RPG will be different than an open-world survival horror game, what works for a single-player game will be different from an MMO, what works for a sprawling Tolkien-esque fantasy world will be different from an explorable galaxy and space colony. But even across all these different styles of games, there are measures to ensure the random generation adds to the experience, rather than fill the space around and behind the experience.

For one, random generation will gain immediate importance to the player when it becomes the destination, not the things between destinations. This could be as simple as removing some expected modern features like coordinates, pinpoint quest markers, or go-anywhere fast travel. Let NPC’s give the player directions now and then, let MMO players give each other local landmarks to follow, anything to stop the player from barreling over lakes and mountains in a straight line to the floating arrow or the correct X,Y numbers. (Mountains and lakes shouldn’t be nuisances! They should be pretty!) Walking with the plains, following roads and rivers, turning at distant mountains and geological features, counting futuristic city blocks from a tall skyscraper, these are all ways to engage the player with the environment that the game has made…provided the algorithm is advanced enough to provide all these easily identifiable features. It could also mean having to use the environment to your advantage. In a survival game, you could scope out jungles and dense locations certain animals would be attracted to. In an MMO, you could use difficult rocky terrains other players are unlikely to venture in as a safe place to hide your stash, or you could know what convenient parts of the world will draw easy-to-ambush players. In a Minecraft-esque crafting game, resources could be made scarce creating “deforestation,” forcing players to find new areas of the map. The developers don’t even have to dream up every use and strategy, just create a goal, an algorithm to build a world with enough variation and opportunities for interaction, and the players will take off from there.

No matter how good the algorithm appears at first, if given enough access to its results, it can become predictable. Some initial No Man’s Sky reviewers (such as Polygon’s) were surprised with the survival and collection aspects of the gameplay, assuming the game would offer a more relaxed free-exploration vibe. However, I saw this as one of the smarter design decisions on the developers’ part. Giving the player full Google Earth-like freedom to zip around planets’ surfaces at top speed would’ve been liberating, but would’ve quickly cheapened the value and uniqueness of the random creations. Scarcity is always valued. The rock-collecting tasks and temperature management forced the player to slow down and delay the inevitable realization about the game’s limitations. How fun those gameplay aspects were is another story. The trick is not making it feel like the player’s purposely being deprived, even if it’s for their long-term pleasure. No easy task.

I can speak from some experience here. Over the past few years I’ve dipped into a JavaScript program to create randomized overworlds for a video game I daydream about making now and then. You can see a barebones (but stable) version here if you like. (Click on the cities!) This may be a result of my attachment to it, but when I look at it the little shores and windy roads it makes (that I never would’ve planned on my own), I can imagine a game’s world, what traveling on a zoomed-in level might look and feel like, and what kinds of characters each region could hold. But when I would work on it again, I would have to refresh the page repeatedly to debug changes to the code. All the shores and roads would become stale, not sparking any imagination or warm attachment like the first initial reloads did. The fact that I wrote all the Math.random()’s had little to do with that feeling, overexposure to the results did.

A Lands-generated overworld, complete with travel information for three cities.

I’m the developer in this instance and my ruining it for myself is all part of the process of making a better algorithm, but I learned why it’s so important to hold back that feeling from the player in a completed game. If a snippet of a world (much more advanced than my little project) inspires any kind of awe or imagination (like, say, the first No Man’s Sky trailer did), it’s natural to want to see everything that game can make. And you can show players that big world, but don’t let them kill it for themselves by letting them mash the refresh button as fast as they can.

Another danger to showing too much too quickly is a feeling of temporariness, the feeling that this is what the computer made for you and only you for this point in time. While that feeling can be interesting and surprising in some instances, if the entire game is temporary, why keep playing if every future discovery is just as fleeting and inconsequential as the previous ones? Give players some time to project value and build attachment to the world (best achieved by having things to do within that random environment that are fun). There’s a social aspect lost in temporariness as well. MMO’s have a built-in social element by definition, but single-player games have a less-appreciated social aspect that’s essential to the full experience. Whether in school or on forums or the Twitterverse, a new popular game always comes with a fun window of everyone talking about their in-game experiences, groaning about that same hard boss (and that one guy who keeps saying he beat everything on first try), forwarding the webcomics around, sharing details on the unpatched infinite money exploits, talking about how bad the ending is, and the other things that take the single-player experience to a new heightened level. Even if the player avoids the game’s fandom (a necessary step to enjoy certain games), there’s an importance granted onto the game knowing that thousands or millions of other people have had the same experience that you could be participating in if the fandom weren’t so cringey. Even little things, like recollecting dungeons and fights years down the road in a nostalgic haze to help out your late-to-the-party friend, it all helps build the social element that’s difficult to recreate with a game focused on random generation. There may be a different kind of social interaction that comes out of sharing unique personal adventures without the strong reference point that non-randomized games provide, but it’s important to recognize and fight any possible feelings of inconsequentiality and solitude the randomization may make. [One possible idea: Create a single-player game whose randomization is seeded by real-world time, so while not an MMO, every player shares the same experience and sees all the surprises together and can share where to find them. Players could reminisce down the road, “Remember that time that plain with all the traders got flooded and turned into a lake? And when the volcano erupted and turned the grassy dungeon into a fire dungeon?” Etc. You could even “time travel” to certain times and the overworlds they seeded. I’d love to play this game.]

After all, surprise is one of the best aspects of random generation. Not just for the players, but the developers as well. An unrestrained algorithm will create designs and situations the developers never imagined and create more content than they had the man-hours or imagination to make on their own. (Another lesson I’ve learned from my JavaScript overworld generator.) But in turn, developers have to allow some imperfection. A dungeon might be cruel, a grassy steppe might be uninteresting, some architecture might be silly, but it’s that same freedom that creates those bad situations that creates the memorable surprising ones. The more one tries to force randomization into a box of what they think is ideal, the less power that randomization has to truly surprise. It may be a false dichotomy to pick between surprise and Bob-Omb Battlefield-esque perfection (maybe some intense neural network could create smart, creative level designs when trained on decades of video games), but until that happens a decision has to be made. If a developer has a concrete image of what the final game’s environment, levels, and playthrough will look like—they should make that game. A planet covered in barely altered Bob-Omb Battlefield’s doesn’t offer anything a single polished Bob-Omb Battlefield provides. There’s no point using random generation for things that a hand-crafted level couldn’t do better anyway.

When taking advantage of random generation’s unpredictability, a “cold hard world” needs to be anticipated. The game Dwarf Fortress (with its official motto “Losing is fun”) is a masterclass of this philosophy in action. The game uses text-based graphics like the early roguelikes, and that abstraction allows it to use extensive randomization and simulation of real-world phenomena to create emergent behavior. One account of emergent behavior was described in a New York Times feature about the game:

“Initially, the sewers appeared as an illogical tangle of blue gashes, but line by line, Tarn worked them into coherence. At about 1:30 a.m., a family of hippos, represented by light gray H’s, swam into the tunnels from a nearby river. Their arrival was an unintended development born entirely of the game’s internal logic. Tarn was pleased. ‘The hippos like the sewers!’ he said.”

There couldn’t be a better example of the joy of new behaviors and events emerging naturally and unexpectedly from a good algorithm. Dwarf Fortress has no programmed “win,” yet it has developed an intense cult following centered around the fun (and often morbidly dark) situations the game spawns. There is a blog (Dwarf Fortress Stories) dedicated to sharing stories of things that happened in campaigns before they “lost,” as well as a lengthy TVTropes page. Dwarf Fortress may be a very niche game with an infamous learning curve, but it shows that “losing” can be as fun, rewarding, memorable, and surprising as “standard” video games goals.

A new file, I think. “Captain, what should we do? He’s not on the list.” “Forget the list. He goes to the block.”

For developers who don’t want to create a game as intimidating as Dwarf Fortress, there are still options to integrate unexpected or difficult scenarios into a typically structured game without infuriating players. It could be as simple as offering emulator-save-state-like saves, or offering limited items and abilities to teleport or levitate out of unfavorable areas. A game could get creative with this, even letting your character permanently die but shifting control to other characters, like the 1999 game Omikron: The Nomad Soul did, or give you Sims or Pikmin-like control over a large swath of people like Dwarf Fortress did. [It should be noted Pikmin 2 did use random generation for its underground levels.]

Another consideration for games that want to use random generation to build immense overworlds specifically (like Minecraft or Daggerfall) is to use macro-level variation on top of all the more immediate variation. Daggerfall actually gave a whack at this by having a few different climates: playing in the south would give you sandy ground with desert flora, playing in the north would give you snowy trees, along with corresponding enemy, architecture, and dungeon variation, and so on. Even though you could only really appreciate it through fast travel, it was still a nice way to change up the game. If you got tired getting the same snowy surroundings, a trip to the desert could freshen up gameplay, until you get tired of the desert dungeons having scorpions with paralysis attacks, then you could pack up and head off to give another region a shot.

A Daggerfall environment sampler.

Minecraft, however, doesn’t have any differences between the corners of its massive map. The land changes on a micro-scale of course, alternating between the different biomes, but there’s no variation in the way those biomes start and stop as you travel hours across the map. If you were dropped into a random-place in the map Dude, You’re Screwed-style, it might as well be the map’s dead center from what the surroundings tell you. Take a look at a biome map released by Mojang:

It looks like an even uglier map of the Holy Roman Empire. There is change throughout the map, but in a consistent blotchy way. Compare this to a World Wildlife Fund map of Earth’s ecoregions:

There is a variation within the variation. Some ecoregions are small, some follow along mountain ranges, some sprawl across the width of continents. Some ecoregions can only be found on one continent. Not that a game’s goal should be recreating Earth—realism rarely implies fun, but a shallow predictability can take you out of a game and start thinking about its code. With macro-variations, travel has a new reward. Regions have a character—every three square miles isn’t a bundled desert, plain, mountain, and tundra region that repeats over the surface of the planet like an old tiled Windows desktop. When you travel a substantial distance, you should be rewarded with things you’ve never seen before, not just a different iteration of the same world you walked from. It means developers will have to hide a good chunk of their hard work from the player when they first start, but it’s in the name of long-term enjoyment. Traveling across that giant world won’t give the player the sad realization that they’ve already seen everything and are wasting their time, it’ll give the feeling they haven’t seen anything yet and more could be out there.

A Minecraft biome sampler.

These suggestions so far have been loose to remain useful to the many different kinds of games one could make centered around random generation. There is, however, one absolute rule that no video game should break: it has to be fun to actually play. An interesting world only benefits a game when there’s a game to benefit. No Man’s Sky’s biggest sin wasn’t that its random generation was boring, it was that it wasn’t very fun. No improvements to its random generation would have saved it if the gameplay didn’t expand beyond slowly walking between rocks and upgrade stations, with the vague end goal of flying to a white screen and New Game Plus file. Even games with memorable worlds that were simply fun to hang around in are anchored by a fun gameplay or rewarding sense of achievement. To use Mario as an example, the relaxing resort vibes of Super Mario Sunshine or otherworldly physics and grand scale of Super Mario Galaxy would mean nothing if not for the simple joyous pleasure of running and jumping and flying around in a free 3D environment at the center of it all. In a combat or strategy-oriented game, there is the underlying feeling of personal growth as you learn to outmaneuver enemies and hone your tactics. In an RPG, there is the feeling of working your way to the top as your character gains experience, advancement, and copious loot and tackles on harder and harder enemies. Without these elements to keep you playing, an interesting world or interesting use of random generation is like an ornate painting in the lobby of a doctor’s office—the painting’s still interesting, but you’re not going to hang around the lobby a minute longer than you have to.

Even though many games with random generation came with caveats or only used it as window-dressing, I don’t see this as a knock against random generation, but a call to action to create a game that truly taps into the potential given by wide-scale random generation these games have only hinted at. The fact that random generation continues to allure us and make us dream of giant surprising worlds makes me think that it can be done right one day. Even though No Man’s Sky is not shaping out to be the awe-inspiring hundred-hour sinkhole people hoped for, it has reopened the gaming public’s eyes to see random generation as a tool to build endless worlds, and hopefully through No Man’s Sky’s mixed reception a new wave of developers will step up to fulfill the promise it made.

This article originally appeared on Gaming Reinvented.