Sculpting Side B: Generating the terrain of Alpha Periphery C2


Greetings surveyors!

In the upcoming free content expansion for Periphery Synthetic EP, you will scale the icy vistas of Alpha Periphery C2 to unlock new abilities and reach extraordinary heights. Continue reading for an in-depth look at how its terrain differs from the vast deserts of Alpha Periphery B, and how this impacts the EP’s approach to movement.

Enjoy!

Initial concept

With the release of Side B, I intend to fulfil my promise to faithfully remake my game E.X.O.. Created for No Video Jam 2, it was an ambitious attempt to create a procedurally-generated terrestrial world that could be accessibly explored in all three dimensions. It was also my first attempt at this—and rather rushed for a three-week game jam—therefore, I did not take many risks with its terrain generation.

I believe that a faithful remake should embrace verticality in its level design. By expanding the dynamic range of its terrain to deeper lows and towering heights, the included jetpack abilities receive renewed context and purpose. The result is the ultimate and intended experience of this icy world—which I was previously unable to deliver—until now.

Raising the mountains

The most exciting addition to the new terrain is its mountains. Reaching up to four kilometers in height, they provide surveyors quite a challenging platforming experience. Their rewards: a unique artifact to collect, a destination to revisit at any time, a view that nearly reaches outer space, and a satisfying leap back to the surface.

The mountain algorithm

While researching the best approach, I discarded several ideas like using an inverse fourier transform or the diamond-square algorithm, before landing on a surprising solution: a maze generation algorithm, specifically a modified Randomized Prim’s algorithm.

By using a maze to represent the topology of a mountain from above, it’s ensured that there are multiple random paths to reach its peak. And specifically, with the Randomized Prim’s algorithm, the mountain can be generated from any arbitrary origin with any shape and depth, not just a boring rectangle.

Here it is in pseudocode, transcribed from a note I scrawled late one night:

  1. Define a two-dimensional hash of cells.
  2. Keep a set of visited and unvisited cells.
  3. At the origin:
    1. Assign it an arbitrary depth such as 25.
    2. Mark it as a visited cell.
    3. Gather all adjacent cells and add them to unvisited.
  4. While there are unvisited cells:
    1. Pick a random unvisited cell.
    2. Pick a random visited adjacent cell.
    3. Assign it a depth of that visited cell minus 1.
    4. Mark it as a visited cell.
    5. If its depth is greater than 1, gather all adjacent unvisited cells and add them to unvisited.

To get the height of the mountain at any cell, we multiply its depth value by a scalar. I chose the number equal to its grid size so its slope remains a constant 45 degrees; however, this could be any arbitrary value. For example, a fractional value could be used for shallower terrain features like rolling hills, or negative values could be used to instead carve out canyons.

Here is the result, visualized from the top-down with special tooling I created to preview the terrain. It uses hue and value to represent elevation changes at various scales, and the results can be quite psychedelic:

Mountain heightmap, unsauced

The special sauce

Apparent from the checkered patterns on display, we’re missing a few ingredients that turn this grid of disconnected platforms into a more realistic and certifiably-walkable place:

  1. Interpolation. A combination of bilinear and bicubic interpolation was added to smooth the edges of grid cells into one another. To control the type of interpolation, a field of two-dimensional Simplex noise was used to make some areas more smooth or jagged than others.
  2. Bias. In steps 4.1 and 4.2 of the pseudocode, bias can be introduced in the random selections of cells. Similarly, in step 4.3 we can subtract random integers to create steeper areas (i.e. greater than 1) or flat areas for rest (i.e. 0). These choices have very interesting cascading effects that completely change the shape of the mountain.
  3. Peaks. Finally, in step 3 of the pseudocode, we can randomly generate multiple origins for the mountain. This allows them to have double summits and more, further increasing their diversity.

Here is the result, rendered with the same visualizer as before:

Mountain heightmap, sauced

And a different result, rendered in-engine and ready-to-climb:

Mountain, in-engine

Filling the lowlands

The areas between the mountains pull the terrain in the opposite direction, carving out a variety of frozen biomes which demonstrate the moon’s violent past. While the underlying techniques are largely identical to the deserts of Side A, the expectation that surveyors should have the jetpack unlocked allows it to take bigger risks.

At its flattest, in the absence of environmental weathering and erosion, the crystalized terrain exhibits some sharper edges. I’ve seen plenty of voxel-based games having terrain like this, and I felt it was most appropriate to give those blocky worlds a nod here:

Flats, in-engine
Fun Fact: The terrain of Periphery Synthetic EP is continuous, not voxel-based. This actually leads to a ton of interesting problems—and creative solutions—especially with its movement system.

The environments of Periphery Synthetic EP are carefully crafted to complement its story. This includes the frozen seas of Alpha Periphery C2, which indicate a warmer past that was abruptly upended. Also hinted here is one of ten new materials coming with the expansion:

Frozen sea, in-engine, with notification: Aluminum collected

The deepest of its canyons can extend up to a kilometer in depth, providing surveyors with even more platforming challenges to solve with their jetpacks:

Canyons, in-engine

Reconsidering movement

While building this terrain I’ve started to identify several core problems with the EP’s movement system that I intend to address in the Side B release:

  1. Grappling. A new ability will be introduced for on-foot movement which allows surveyors to grapple terrain as they collide with it. This solves issues with collision detection while jumping and being unable to control where they land. By holding the Left Bumper before colliding with a surface, they will always stick the landing. This will be unlocked by default, and includes a unique audio cue when activated.
  2. Walking. While turbo is disengaged on-foot, surveyors will always stick to the nearest surface unless they jump. This solves issues with traversing extremely steep slopes, like losing their footing, by allowing them to opt-in to more careful movement. However, for grappling to remain useful, this will not apply to mid-air collision detection.
  3. Jumping. When using vertical look, surveyors will now launch themselves more in that direction. This solves the unpredictability of jumping up or down steep slopes by giving them even more precise control over their jumps. For those who prefer to use the Lock Vertical Look setting, the behavior will remain mostly the same as before.

Please let me know if you have any feedback on these proposed changes. These will be part of the target for my next development sprint.

Coming soon

In addition to faithfully reimagining its graphics and terrain, there are many other tasks along the happy path toward full release. This includes remaking one of my proudest game soundtracks, all the new abilities and sounds to support them, and the nonlinear portals that connect these worlds.

Thank you so much for joining me on this wild journey. I’m excited to share more with you soon, including the official release date for Side B! Until then, the code won’t generate itself. ✌

Wishlist on Steam

Get Periphery Synthetic EP

Buy Now$3.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.