Of Openworlds and Post-apocalypses
Technical planning, and small details matter. (1.28.2022)
When you're making a sandbox post-apocalyptic open world game (thats a mouthful) the size of the u.s, it takes some consideration about how you're going to do it before you even begin. This is the understatement of the decade.
Vast vistas, the pine topped peaks of a postman-esque wasteland, the mountainous *western-like* terrain of nuclear colorado, the deep woods of the ozarks. America has it all.
NeoScav was my first and major inspiration. The entire time I played it I thought "post apocalypse michigan is big and cool and all, but what if I could explore *the rest of the u.s.?"
Like dorothy longing for strange new lands, I yearned to see what lay beyond the conveniently placed barrier-like "great swamp" on the southern edge of michigan.
Neoscav in all its grunge, 90s glory.
(also, neoscav devs, what the hell happened the upper half of the michigan map?)
Tantalizing, how big the map could have been, isn't it?
The map in the aptly-named Neo Scavenger is something like 100x100 or 120x120, or in that range.
I wanted something bigger for an open world survival strategy game. Something truly grand.
Having the resources to represent it was half the fight. I quickly found something that works and cobbled them together in game to see if they looked nice.
I can’t say its pretty, but its early days.
Eh, a little scaling to give it the proper 3/4ths view, and it could work.
But thats a far cry from a whole playable map of the united states.
This was obviously going to take some elbow grease and ingenuity.
A few approaches out of the box
1. focus on one state at a time
That kind of defeats the purpose of an open world doesn't it? And its certainly not the selling point that a whole open map of the united states is.
2. focus on one region.
That could work. Start in the rocky mountains, or south east region. But lets work through some others
3. Mass automate the process.
4. Don't start with a full map. Start with a random map "somewhere out there".
5. Some combination of the previous options.
Being a "programmer" in only the loosest senses of the word, I immediately opted for the laziest route possible.
What if we, I don't know, take a map of the united states and convert it to tiles?
“Yes but how?” I asked myself.
Well, in most images and maps, theres a LOT of pixels.
Look at the palette on that bad boy. Theres got to be a hundred thousand colors. (though graphics gale reports "only" 201634 colors).
I don't have enough time, or tile types, to assign a tile type to each of those colors. My wellspring of focus, patience, and human lifespan is not sufficient for the task.
But maybe I could squeeze down the color space into a nice useable set of colors, say, somewhere below 100 unique values?
This is definitely possible.
Obviously this isn't going to solve everything. For one, many major features, such as cities, forests, terrain height, mountains, aren't all easily represented or deduced from colors here. And many mountains are gonna have forests on them or around them even if it isn't always apparent on the map.
But just getting the raw shape and layout of the map? If we're doing a map as big as neoscavs (or larger), but for every state, then we're gonna need some help.
And it starts with laying down broad strokes.
Python for the win
The first thing to recognize is we'll need to squeeze down the palette, as I mentioned.
But also, I'm going to have to decide how locations are represented still. What tiles correspond to what pixels on the map.
And this doesn't save me from having to do manual finicky tile placement for things like cities, smaller rivers, some bodies of water, and non-descript elements on the map, like forests and hills.
Neoscav gets away with it by randomizing most of the map and setting a density for different features. Essentially they say to the map generator "thar be hills!" and let the game do its thing, and poof, you have hills. Thats part of the fun. A different map every time. Maybe we can get away with that by having broad egoregions, and assigning densities of different tiles to each specific type of area.
The first thing I think about is, okay so what do I have in my toolbelt that can turn pixels into tile ids?
In comes my favorite: Python for the win.
The everymans tool: non-specific in all the wrong ways, overly general, and just useful enough to be dangerous.
Python has an Image library aptly titled PIL, short for...python image library.
By first paletizing a map of the u.s. in Graphics Gale, and assuming I've decided on a colorX=tileId scheme, then its trivial to extract these pixels, and dump them to something like CSV, or json.
But what then? I still need to place all the other things, like forests, cities, major roads, and non-specific hills.
Those darn non-specific hills!
In GameMaker (because I don't envy people who have to reinvent the wheel), there is no hex support out of the box, but you can set the *instance* grid so you can still lay down instances to your liking, in a hex grid.
Tiles? Not so much.
Just as well, instances are more, eh, lively? They allow you to do more, like dynamically loading and unloading them as their position comes close to the camera, so by the time they ARE on the camera, their instance data has already streamed from say, disk.
Also, another issue, customizing that many instances is exhausting.
And it doesn't let me set those regions I mentioned before. Sure I could use some bounding box, but its nothing like the skill of bob ross painting happy little trees.
The ozarks and appalachia don't fit into a neat little box. Neither does the pacific north west, or the rockies. And even if they did, any random generator doing fill-in work would produces results that would look ugly.
To roll your own or keep on rolling
I could just suffer with it, and scrimp by, using scripts to fill in bounding boxes that roughly correspond to different areas.
or I could roll my own map builder, limited to JUST those instances I chose, allowing import and export as I needed em.
I could of course also go the pixel route and paint results with pixels. It would not be fun, but it would be easier to display and hold in game memory, and while crude, simpler than building a full blown map editor.
I could even add special layers, that override layers below them, so I could add rivers manually or from other palettized maps, like forest cover maps, and major and minor river atlases, or urban zones, etc. I could even do things like write alife-style scripts to dynamically place things like fallout or nuclear blast zones, or earthquake destroyed areas e.x. the road.
And speaking of I'd also have to do roads! Well maybe just major highways. I'm not totally crazy.
But still, assuming neo-scav michigan-sized maps, I'd still be looking at a million or so tiles, thankfully the bulk of which I wouldn't have to place.
Russian Nesting Doll Hellscape
This still leaves places that would have to be manually entered into the system.
A million landmarks, paper towns, curiosities, and the highlights and attractions, both natural, and man-made, in every state. And worse, the repeatability rapidly causes both a massive creation of new tasks to be done, labor intensive, and all of them a veritable collection of Potemkin villages. One line locations, with no one home, and nothing interesting.
Neoscav got away with a dozen. Fallout 3 and 4 got away with what, a couple hundred?
This isn't a trivial problem. Neoscav mostly compensated by having a lot of "decrepit" and abandoned places, much in the same way a survivor without a map, might wander around and look at abandoned places, without name or habitation, lost in the wasteland for want of roadsigns (because punks had all stole them for body armor, naturally).
What would be needed is a russian nesting doll hellscape of information; lists inside of lists inside of lists.
Top 100 towns in each state? Major and minor tourist attractions? Whats the history of the state? What kind of people live there? What are all the major and minor rivers? Mountains? Other landscape features?
And then the decisions? Ok was this place hit with a nuke? How about fallout? How about industrial sabotage by stay-behind units when ww3 started? Is there a toxic swamp? Of course there is. Neoscav understood that. All hail the prophets of industrial society and its polluted future. Neoscav.
Of course thats all questions for later but the broader point was that I would need information. I was starting to see this was going to be no roadside picnic.
Design isn't about what you can add, it's what you can take away
So we took away the handles on the faucets. And now we have automated faucets that shut off when you still have soap on your hands.
Musing of first-world problems aside, the first sign something has gone wrong is kitchen-sinking, the act of adding *more* features, because it's "a good idea" or "cool", or more commonly, to avoid having to make some decision you've been putting off.
The general theme here had already begun to emerge and formulate itself, in my mind, into a question. This question took shape as I was calculating just how dense the map should be for our purposes.
"Is this really all that necessary?"
Yeah of course, no one had done it before, made a sandbox game the size of the united states (scaled), but maybe there was a reason for it.
Well, Risk had already done it on a table top, but thats sort of like taking a napkin and writing "one billion dollars on it" and trying to pass that off as an actual bill. Risk doesn't count.
What would I even do with a map that size? What would the players do?
In a certain sense, players expect new content to come at them, at regular intervals. There is a sense, depending on the player and genre, that each game should have an appropriate length. I didn't know what that length was at the time, and really, I still don't.
So it was really a question of density.
If players play for five hours, how much content can they expect to encounter? What about ten? Twenty? Forty? Fifteen hundred hours? What kind of content? How does that translate into work-items I'll have to do, descriptions, images, sprites, animations, that I'll have to make? Systems and effects I'll have to code and test and play balance?
An old study by the developers of World Of Warcraft, said that the ideal balance between content and space in a games physical layout was 70/30%. Seventy percent content to thirty percent space. I couldn't tell you if thats right or not, but it said nothing about the pacing of story, random events, new locations discovered, new items found, new NPCs encountered.
Theres some information on human attention cycles, how our attention has peaks and troughs in 15, 30, and 90 minute intervals, but do you deliver content at the end of those cycles, in the middle, or at the start of it? These are open questions.
You could say what I'm driving at is: what is the pacing of the content, rewards, and emotional beats of the game?
And critically, did it even make sense to be considering these issues, when the game was an open world sandbox?
Granted, games like Rimworld answered them, and it was a sandbox too. Sandbox doesn't necessarily mean "unstructured", it only means "open ended". Open world on the other hand does imply something unstructured.
In fact today we see rampant abuse of the very term, in linearly driven story based games.
Games that have story but are open world, like Breath of The Wild, primarily let the player decide the pace of the games narrative, letting the player choose to skip right to the end fight (with great difficulty), or approach each point in the story at their discretion, when they're prepared.
How would you go about structuring delivery of content when players can discover it in any order they want? How would you go about balancing it?
Or maybe you wouldn't at all. Maybe you would take a tact from any good roguelike, and let any sort of event happen out of the box, coming across rare weapons, and important characters at any moment, even from the start. Anything can happen and it often does.
Perfidious Design Choices
Design is by its nature, a perfidious animal, full of blind corridors, and subtle traps that at first appear alluring, but quickly turn into dead ends long after you've committed great resources to them. They are the shifting sandbars of the beaches that put up warning signs that exclaim "danger - no swimming - rip tides".
Whatever, you, as a designer choose, or you as a player or playtester convey as feedback, has an impact on these decisions and design choices.
Obviously some things only work with effort (large scale open maps), others, the effort is difficult to estimate (making good content and delivering it in a fun and timely way), and others still are nigh unknowable before having sunk time into them, they may be glorious, or terrible, or require a lot of playtesting and balancing, but you don't know until you try.
And in design, thats all you can do.