Hopworld devlog 2
May 25, 2021
Two months into development now. The game changed quite a bit. Time for another devlog post.
Last month i discussed that i started using a combination of prefabs and procedural generated mazes. One of the problems i noticed was that the prefabs felt very confined. So i had to find a way to also create more open spaces.
After pondering about this for some time, i realised that walls didn't have to be solid. If you have two cels next to each other, that should have a wall, but instead you make it a gap that the player cannot jump, you have achieved the same effect. The player will need to find a way around it.
Here is an example of the kind of situation this can create.
On the left is the player on a ladder. On the right is a coin. He can't jump from below onto the platform and he can't drop from above because of the fall damage. Unless the player has got some kind of power-up, he will have to go for a long trip around the maze.
Check the route in a blue line on a screenshot of the minimap.
The code just generates these situations randomly and i got pretty excited when i saw this one. One of the things i want to achieve with this game, is that the game surprises me too.
The prefabs seem to work best, when they are as simple as possible. It gets boring when you see a recognisable prefab repeated multiple times. When they are simple they melt better into new shapes with other prefabs.
The melting is done by auto tiling scripts. The solid walls get edges and the one-sided platforms get extruded.
The central prefab in the previous screenshot looks like this in Tiled:
It's hard to recognise, because it is also mirrored. The mirroring is also done by a script, which saves me half the drawing work in Tiled.
This month i also worked on the music for a while. I wanted to have procedural generated music as well. While surfing around the web for some demo's and idea's, I found this music generator on codepen. One of it's features was that the music could be generated from a seed. A seed is a number that acts as a key to genrate numbers from. When using the same seed in random number generation, the sequence of random numbers will be the same each time.
I have been using
Math.random for almost 20 years now and it never crossed my mind that this was possible. Actually you need a library or extra function... but it just blew my mind.
One problem was that npm package generate-maze didn't have a seed option. But there was one open issue by @Onheiron requesting this feature, and i poked the issue and the maintainer @bestguy responded quickly and implemented it. So many thanks to them.
The local co-op is also implemented again. When you connect 2 gamepads, you get 2 characters to play with.
The previous implementation had a split screen. This was done with 2 scenes and not 2 cameras. So each player could be in another level at the same time. But this was not manageable in the end.
So i decided that one player should be followed by the camera. When the other falls outside the camera he turns into a ghost haunting the other player. When they touch again he returns to normal.
It is the only way you can fly in the game for the moment. So you can cheat quite a bit in open areas with this feature.
There were actually a lot more other ideas implemented this month, but i am not gonna spoil them all. I also added a gif recorder script to the game last weekend, so i will try to post some gifs on social networks in the coming weeks.
There is no rush in releasing the game, but at some point there will be a beta. I just don't know when, but it starts to fall into place.