How Nyamakop designed Semblance's spongy, deformable terrain
Making a 2D platformer in Unity is usually a relatively straightforward process. But that’s not always the case for some developers.
While working on their debut game Semblance, available for Nintendo Switch and PC, the South African studio Nyamakop struggled both technically and in terms of its design, on account of the game’s deformable terrain.
Every platform you come across in the game can be altered from its natural state. This meant that they had number of important decisions to make, including when and where to place restrictions and how to design puzzles around the unique gameplay mechanic.
To achieve this, the team employed a number of interesting solutions. They took an iterative approach to the game’s design and were open to incorporating and working around bugs, if they happened to improve the overall experience.
In Semblance, you play as a playdough-like character in a soft and spongy world that has been infected with a crystalline virus. The goal of the game is to play through the different stages, deforming terrain and solving puzzles, while avoiding jagged crystals and collecting the hidden life essences in each level.
It’s a feature, not a bug
"A lot of people think for me that deforming the platform was like, the technical part. The hardest part was actually the player and making the player contour to the surface."
What’s perhaps most spectacular about the development of Semblance is that it didn’t necessarily begin with the deformation mechanic in mind.
Instead, Ben Myres, co-founder of Nyamakop, initially envisioned the game as a simple project about a shape-shifting protagonist in a spongy world. It was only while working on this concept that the team discovered a bug that led them to the idea of terrain deformation.
“We started adding sort of impressions to the platforms, so kind of like the platforms would […] sag a little bit and you could kind of control that,” says Myres. “That just made the world feel a bit soft as well. But then we had this bug where every time you touched the platform it would sink down lower. So, if you like dashed down into the platform fast enough, you could lower it down quite far.”
After posting a gif of the bug on Twitter, the clip garnered tons of interest, giving Myres the confidence to alter the game’s direction. How it works is that all the platforms are made up of vertices. By hitting a platform, the spring value offsets the vertices with a physics simulation, causing it to move to its target position. This is what allows players to shape the environment.
Making the platforms work with a character
Changing the direction of the game in this way introduced some new challenges however. One of the biggest was getting the character to look right while moving along the terrain. For this, the developers couldn’t use a standard sprite, as they would then have to handcraft an infinite number of animations to go with all the ways the terrain could deform.
So instead they used a procedural mesh, created using Bézeir curves (essentially the pen tool in photoshop with two anchor points and two control points), with one vertex in the middle of the triangle that all the tris point towards. This meant they didn’t need to constantly retriangulate every frame of animation.
“A lot of people think for me that deforming the platform was like, the technical part,” argues Cukia “Sugar” Kumani, Nyamakop co-founder and the lead programmer on the game. “The hardest part was actually the player and making the player contour to the surface.” Here the team used spring simulations on the control points of each curve of the procedural mesh to animate the character. This helped them to create a more versatile character suited for their needs.
“Having a procedural mesh made it easier to contour to the ground because it was just a matter of setting the bottom vertices to the shape of the ground,” says Kimani. “What was difficult was finding out as accurately as possible the shape of the ground. There’s literally so many edge cases because of how different the ground could be.”
Setting parameters for the player
Another huge issue was deciding how far the player could deform the environment. The team knew that they had to place some limitations, otherwise the player could break the puzzles or mess up the visual aesthetic by going beyond what the artists and programmers had envisioned.
Therefore, they capped the value of the impressions player could make and limited the amount of directions you could deform platforms from. For instance, you can only hit a platform from above and below. You can’t hit it diagonally. This was all in order to better control the player’s interactions.
“Technically when you’re moving the platform it kind of gets skinny on the sides,” explains Kimani. “That’s just because we’re not adding more area to this platform […] so making it get to a limit is just like after a while it would just start to look off. That’s kind of where it was a good place to go okay this is where it should stop.”
With that being said, the team doesn’t necessarily keep these values consistent throughout, as a way of cheating some puzzles.
“We don’t actually keep distances that you can deform platforms the same on every platform,” Myres tells me. “If for a puzzle, we needed to deform a bit further, we’ll just change the value so that you can move that platform a bit further. And we try keeping it in a relatively small range so it is not super inconsistent.” This neat little trick helped them while they were designing puzzles, allowing them to not worry too much about the specific layout and spacing of platforms, as they could always alter them to their requirements.
Experimenting with attaching level elements
In the game, there are also a number of level elements that are attached to deformable terrain, such as spikes and lasers. Here players are able to deform platforms from above or beneath to create a safe route to a collectible past the obstacle.
Normally, something like this would be quite the task to code, but in the case of Semblance the team discovered that they had accidentally already came up with a way of making this work prior to the idea’s conception.
For all the flowers in the game, Kimani created an individual script that attached them to the terrain. It was while experimenting with this script that the team wondered what would happen if they attached the script to a level element and found that it worked perfectly. This allowed them to attach lasers and spikes to deformable platforms and now forms a substantial part of the level design.
“It seems kind of crazy, but we never thought for like six to eight months to ever think about attaching […] one of those scripts to a level element,” says Myres. “Then one day we were just like, I wonder what would happen if you attach the script on a spike and then made this whole series of spikes so it just looked like a bed of spikes on top of a deforming platform. Then we kind of realized because of the way the scenes work with individual spikes you could kind of dent the platforms up so two spikes would be on each side of a mound and you’d have something to land on in the middle.”
Tutorializing mechanics through visuals
As well as spikes and lasers, some stages also feature another level element that is called a reset beam. These are beams of light that return a platform to normal when a piece of terrain hits them, hoisting the player high into the air.
Reset beams were added to provide more variety in the puzzle design, but they also came with a new challenge for the team as they had to differentiate it from the standard reset function that players could use to return a platform to normal. This is because the standard reset doesn’t cause the player to jump up and therefore could cause confusion for the player.
“The problem we had with that was […] if you’re on a platform that you’ve deformed down really deeply and you reset it, how do we make it clear to the player that they won’t or shouldn’t get flung up,” explains Myres. “That was a really hard problem to solve, and we didn’t solve that until four months before the game was finished.
In the end, the solution to this was fairly simple. All they did was change the values they were sending into the spring algorithm, so that the regular reset would rise more slowly, cradling the player up as opposed to snapping. This created a clear visual contrast between the two functions, teaching the player without the need for text.
And teaching without text
There are also some other cases of this throughout the game. While making Semblance, Kimani challenged Myres to create the game without the use of dialogue, with text being reserved solely for the menu screen. This shows in the design of many of the levels.
You can see an example of this, for instance, at the beginning of the game when you are taught how to deform platforms. The player is initially told how to dash with a series of breakable platforms. Myres therefore sneakily added a deformable platform below one of these so that the player’s momentum would carry them through and they would accidentally dent the ground below. This was a subtle way of introducing the player to the mechanic and doesn’t necessarily feel like handholding.
“We had to figure out how to teach players with just level design,” explains Myres. “So pretty much when I thought about a puzzle and a level, I was thinking how does this fit into the learning model of the player? That was the whole high-level concept of designing the game. What is the player learning here? What have they learned before? And so on.”
Semblance takes the simple concept of the 2D platformer and turns it on its head. So much so, the team are jokingly referring to it as the first real platformer, as it is one of the few to focus on the act of physically changing the properties of platforms to succeed.
“I think we could have spent five or ten years on this game,” says Myres, in closing. “There’s really enough interesting stuff there that you can build on top of the core deforming terrain. But I think one of the aspects that was important for us as well from a production standpoint is as it is our debut game, we thought it was really important to get it out and make this experimental, interesting, polished thing, but not take a long time.”