1. Pick your battles
"Don't expect to simply pick a section of the game design and make it procedurally-generated. Adapt the game mechanics, theme and the procedural generation to each other to make it work as effectively as possible, and try to focus on high bang for low buck. In Cargo Commander, we made the uniquely generated levels fit well with the lonely space exploration theme: this time you really go where no man has gone before! At the same time, the theme is not too serious, so that generated levels that are a bit odd don't seem out of place. Also, the generation really impacts the gameplay and is not just a backdrop. The selection of objects (enemies, explosives, burners, items) and features (gravity, layout) differs for each container, creating ingredients that the player can combine in various cool improvised ways.In other areas, I tried to steer away from features of procedural generation that wouldn't be effective. For instance, a notoriously hard thing with level generation is to ensure that levels can be solved - 'can that ledge with the key be reached, using the items that are available?'. Though there are a few checks to minimize impossible situations, the level destructibility and space navigation make sure that the player almost always can create a route somewhere, and because containers can be skipped, it's not a big problem if one cargo item is unreachable. For the sector pass containers, that are more like a puzzle and do need to be solvable, I kept the randomization to features that wouldn't influence this, and relied on handmade levels for the rest."
2. Remember that randomness is random
"The levels of Cargo Commander are randomly generated. The sector name (that players can pick from a list or type freely) determines the random seed, and all levels in that sector are generated from random values based on that seed. However, it's important to take the attributes of randomness into account when deciding how to use the random values for generation. The usual way to look at randomness is by using statistics. For instance 'the container size picks a value between 3 and 9, so on average containers have a size of 6', or 'each container has a 25 percent chance to spawn a medkit, so on average they're encountered once each 4 container'. However, unless the population that they say something about is large enough, in reality such numbers are less useful than they seem. Just like rolling 1s in a row may cause a barbarian to be defeated by an angry hobbit cook despite the barbarian's level 10 and Loincloth of Awesomeness, the player may encounter only really tiny containers in a sector, with an average far below 6. In many cases this is not a problem and may cause nice variation, but when game balance is involved, this can become a problem. If despite the 25 percent, the first 20 generated containers don't have medkits at all, the game gets harder or more unfair than intended. In that case it may be better to use the randomness in a way that can't affect game balance too much, like randomly dividing 5 medkits over the 20 containers, or randomly vary the number of containers between the first medkit and the next."3. Try anything to add 'life'
"In my opinion, the hardest part of procedural generation is to avoid getting randomly thrown together objects that feel lifeless. When a level designer crafts levels, (s)he adds personality to it with unique features or things with an extra meaning above the mere components. I've tried several things to improve this: Use introspection. If you quickly draw a map on paper, why do you choose the features that you choose? Even simple things help here; I noticed that I often use symmetry, or base designs on general patterns, and incorporating that in the generation code helped a lot.
4. Prepare for tough testing
"When I built the generation system after some first prototypes, I created a rather complex layered system, with the sector randomizing boundaries in which the rest of the generation worked, further influenced by such properties as the selected container theme, the container size and the wave number. I had no idea if it would work and be balanced, and then I encountered a problem: I couldn't test that either. When I'd try out a sector and encountered five containers that are full with enemies, did that mean that too many enemies get spawned? Or was this sector one of which the enemy count was randomly set very high, combined with the specific container sizes? Or did a few random rolls just came up with a lot of sixes? For most parameters I tested the average value and a theoretical min and max, but because many parameters influence each other, this was not definitive. After playing many games, some balance problems can become apparent, but it's easy to conclude some issue based on one playthrough, while a next playthrough shows nothing of the sort at all. Knowing what effect a property adjustment has is even harder. In the end setting/tweaking the properties was mostly done on gut feeling. Having a beta with a lot of people was essential as well.