• Register
Post feature Report RSS Enemy Randomization in MicRogue

A summary explaining the logic behind enemy randomization.

Posted by on

Enemy randomization

So this is going to be an article about how I did the enemy selection in MicRogue.

Finding all the enemies

The first thing I do is look at the list of possible enemies. When the game starts the game has access to only 4 enemies.


After collecting treasure more and more enemies are added to the game so eventually the game will have a much larger range to choose from.


Character Rarity

Each character has a rarity number according to the floor. This is how often a monster can show up on a floor and also how often it shows up in the "Monster Bag" (More on that in a bit). Below you can see the rarity for the rat and skeleton across the first 4 floors



Rarity is also something that I can change as new monsters are unlocked, so as Rats are plentiful in the beginning of the game, they are much rarer after more monsters have been added.

Monster Bag

Next I create something I have been calling the "Monster Bag". Each monster is dumped into an array for its monster rarity. so for the Rat having a Rarity of 4, 4 Rats are dropped into the "Monster Bag". so here are some examples of the "Monster Bag" early game and late game.



Monster Selection

Next monsters are selected for the floor. So 4 Random Monsters are pulled from the bag, so even though there is an Eye in the bag, it might not show up, because there is only one in the bag.

Danger Value

The last thing I do is check the monsters that have been selected. Each monster has been assigned a Danger Value. The selected monsters must have a combined value over a base value, which I increase as the player goes through the game.


So if the combined value needs to be 5 or greater and 4 enemies are selected at least 1 rank 2 monster must be selected. and when a value 6 is needed you could have 2 rank 2 or 1 rank 3.

Well I think that is about it for now. Feel free to ask any questions.

Post comment Comments
AstronautChef
AstronautChef - - 38 comments

The enemies are so cute ^-^

Reply Good karma Bad karma+4 votes
Kuznetsovsky
Kuznetsovsky - - 284 comments

Interesting system. Nice game, really looking forward to playing it.

Reply Good karma Bad karma+3 votes
ind1
ind1 - - 177 comments

nice!

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: