Level Generator – Part IV
In the previous article, we saw how level were generated in Umbra, based on various parameters defined in an XML file. In this article, we will focus on the finishing touches, in order to make each level different from each other.
In order to bring more visual variety, decals will be placed randomly on the ground and on walls. Decals are texture usually projected on the ground, bringing more detail and complexity to the applied surface. In our case, using decals will allow us to not only bring visual variety, but also a better ambiance or even gameplay possibilities!
To achieve that, we have several parameters setup in the level design XML file that manage the decal placement:
For each decals, we also added the possibility of spawning a random Prefab. It basically means that we can add particle effects on top of them, or even use the random Decals placement in order to randomly spawn gameplay objects! It brings exciting possibilities for us, we will cover this part on our Devblog in the future.
For Walls, we also add a parameters to control the Z spawning of decals: For example, we may want blood to appear in the middle and bottom of walls, and some mossy decals on top.
When wall decal placement was first implemented, we noticed that decals were spawning everywhere on walls, even on side that could not been seen by the player. In order to fix that, we made sure that a walkable area was present in front of a wall in order to create decals. This simple solution allowed us to drastically reduce the amount of created objects.
The decal placement on a large level cost lot of resources, and sometime takes several seconds to generate. In order to optimize the loading time, we had to stream it during the game.
We now start to spawn decals on the entrance room of the levels, and progressively cover all the area, while the player is able to play.
We spent a lot of time to make sure that Umbra’s camera system will work with any orientation, for a simple reason: We want the player to discover the environment from any angle, and we want to play with camera angle to hide some treasure, or secret passages.
In Randomly generated levels, we also use camera rotation in order to bring some visual variety: Rooms and corridors are not symmetrically build. It will means that you won’t see the same scene on screen if you look at a Level Element from different point of view.
We ran some test and found out that having this random camera angle actually brings some very nice visual difference from a game to another. For that reason, in the beginning of each new level, we set a random angle for camera (multiple of 45).
That’s it! We finally cover the current implementation of Umbra’s level generator. Of course, this system is likely to evolve, but we wanted to share with you the way we build it. Remember that our focus was to get replayable levels and a work pipeline fitting a small team of developpers. We are pretty happy with the result and hope to extent its functionality more in the future!
We hope that you enjoy reading these articles and that you maybe learn something useful too!
See you soon in another devblog about different subject!
Created: 7 years, 11 months ago