Seamless

Let’s talk about procedural map generation for a bit. I’ve always considered procedurally generated maps one of the most important features for Xenos; but it wasn’t working out all that good.

The problem with procedural generation is that it’s hard to create interesting places. Scattering trees around, placing roads and random buildings is pretty easy, but the resulting levels are pretty bland. On the other hand, my system is flexible enough to create, say, a village house with a yard and a garden and outbuildings etc – but it requires a lot of effort. Enough effort to create several such houses by hand, actually; and while this system can then generate any number of houses, they would all feel the same. And many houses that feel the same is, again, bland.

Now, this is hardly a problem unique to Xenos. Generating lots of really different stuff (whatever “stuff” means – levels, textures, tunes, stories) is, first, really hard, and second, requires great artistic taste. I believe  can manage hard, but the “artistic taste” part always gets me in the end. So, procedural content being bland is probably a given for Xenos… how can I still make it useful?

To get this beauty in Minecraft, you have to specifically select your generation seed.

To get this beauty in Minecraft, you have to specifically select your generation seed.

Most games that use procedurally generated maps out there actually manage to do just that. For example, Minecraft terrain is mostly bland and same-y, but every so often some fluke of the generator produces a beautiful cliff, waterfall or something. However, this works because Minecraft is 3D and first-person: we humans are engineered to find beauty in this perspective. Take strategy game like Civilization, for example: while they look nice, no one expects to find any special beautiful place on a Civilization map. Since Xenos is, like Civilization, mostly 2D, with top-down perspective, I don’t think I can rely on random generator producing something nice and pleasant to look at.

How does Civilization use procedural generation to its advantage then? In Civilization, (and Minecraft too!) random maps are not interesting by themselves, but they become interesting as a result of player actions. One stretch of grasslands, hills and jungle is not that different from any other. However, when cities are founded on it and military forces fight for supremacy, every hill becomes meaningful. This is basically what I was shooting at with Xenos; but it seems like it’s not really working out. Xenos’ maps are huge, and there’s just one player-controlled unit; you can build sort of a “base” (theoretically: there’s no building functionality in-game yet), but you wouldn’t spend much time in it. I suppose I could turn Xenos into a strategy game, but that’s not a direction I like.

This hill is only important when it gets in the way of attacking knights.

This hill is only important when it gets in the way of attacking knights.

What else can I do? What if take advice from Terraria and focus more on exploration and finding special, interesting places? This might work: I can create a number of interesting places by hand, using the level editor (and spice them up with some random generation, so that they’re not identical every time you play). Then, I’d use more generic “bland” random generation to fill up the map, scattering these interesting places around.

This idea immediately seems bad, though: why would I want to have bland content in between interesting? Give me all interesting, all the time! Of course, games don’t actually work that way: the player needs some “downtime” to appreciate the interesting content. On the other hand, I certainly don’t want to bore players into leaving the game before they even reach this “interesting place”.

To improve this balance, I had an idea that is sort of out-of-place for a survival rogue-like game, but seemed really interesting. Add cars. Seriously, driving a car is interesting in and of itself, especially if there are obstacles and/or time is of the essence. Driving works pretty good in a top-down or any birds-eye perspective (remember GTA? The original, from 1997?). And to top it off, cars come with a large set of potentially interesting mechanics: finding fuel, breaking/repairs, tuning and modifications… and, if I add cars, I can probably add a tank to drive right in the middle of alien base, destroying everything in your path – how awesome is that?

However, with cars came one “slight” technical problem. Up until now, Xenos map were organized into distinct locations, with loading-screen transitions between them. It works OK for walking, but driving straight into a loading screen is definitely a bad idea. So, before adding cars, I’d have to change all the game code to work with continuous background loading, and make the whole map seamless.

I’m proud to say that, even though this was really painful, last week I did just that. Xenos game world is now a single seamless level 2084 tiles on a side (which is to say, it’s LARGE!). And there’s a car that you can drive around this map, too!

Car

Car driving in Xenos

One response on “Seamless

Leave a Reply

Your email address will not be published. Required fields are marked *