One thing to be aware of when using procedural generation for levels is that the end layout must be interesting to the player. Now, “interesting” can be a vague term and a level can be interesting on several accounts, but one of the most straightforward interpretations is that exploration must be rewarding in itself.
When a map is generated by hand it is easy to scatter interesting features evenly across the level. But there are some tricks that can be used also with random generation.
A possible approach is to use a function to evaluate the “interest-level” of each cell of the map. A good way do to this is to calculate a Dijkstra map of the level from start to end. Essentially we can assign an high interest level to the shortest path between the start and end cell, then we proceed assigning decreasing interest levels the further we are from the shortest path. This application of the Dijkstra algorithm using distance as a metric will create a sort of heatmap of the interest level.
We can then loop over the coldest areas (the ones away from the shortest path) and place there interesting features, like loot or special events, thus guaranteeing that even if a player follows a “wrong” path he will always be rewarded with something interesting to do.
This is a simple yet effective way to ensure that the maps, especially larger ones, do not become boring and to reward players that like to fully explore all the level before moving to the next one.
In the case of Wizards’ Duel it may actually be even more simple due to the way our maps are created. We can set up some “Areas of Interest” to be generated at least once or twice per level and then make sure that they only have a single entry point. This will automatically create at least some “dead ends” with something interesting in it.
We will talk about what we plan to place in these areas at length in the future.
Also I think it should be good to note that interesting does not equate only to loot but it depends a lot on the tone of the game. Nowadays it is customary to fill games with collectibles to artificially increase the length of the game and appeal to the basic instinct of humans for gathering. While it can be the case I think that, sometimes, “interesting” could be simply that: a grand vista in a game like Skyrim or a unique character not really related to any specific quest like some in The Witcher 3.
Thanks for reading.