

The result is that we end up with a square grid of differently sized cells, all perfectly packed together.ĥ. We fill in any gaps with 1x1 sized cells. This technique ensures that the cells are not overlapping, yet in general remain as tightly packed together as possible.Ĥ. Next we use simple separation steering behaviour to separate out all of the rectangles so that none are overlapping. At this point we have 150 random cells in a small area, most are overlapping. In addition to this I ensure that the ratio between the width and length of each cell is not too large, we don't want perfectly square rooms but neither do we want really skinny ones, but somewhere in between.ģ. The reason for this will be explained later! This skews the size of the cells so that they are more likely to be of a small size (more smaller cells, less larger cells).
#Tinykeep game generator#
Instead of using uniformly distributed random numbers (the default Math.random generator in most languages), I'm using Park-Miller Normal Distribution. Again the radius doesn't matter too much, but it should probably be proportionate to the number of cells.

For each "cell" I spawn a Rectangle of random width and length within some radius. This is an arbitrary amount really, but the higher the number the larger the dungeon and in general more complexity.Ģ. First I set the number of cells I want to generate, say 150. The interactive demo can be found here: Dungeon Generation Demoġ. It's pretty over-engineered, but hopefully will give anyone interested some ideas on generating dungeon layouts for their own games.

There are 17 days to go before its Kickstarter campaign comes to an end.So today I'm going to be a little different and talk about one technical aspect of my game TinyKeep, that is random procedural dungeon generation. The game is currently at £6,813 in contributions, with the goal set at £22,162.
#Tinykeep game Pc#
TinyKeep is in development for PC and MAC. You can read more about TinyKeep and its goals on the game’s Kickstarter page. Suddenly the doors slam shut, the torches are lit and a firing squad of Orc Archers appear in front of you. You give chase and eventually follow the Orc into a darkened room. The Orc spots you from a distance, but decides to flee as it knows it will probably lose a 1-on-1 battle. In a long winding corridor you come across a lone Orc on patrol. Dinh provides three examples of what he means by intelligent enemies. We’ve heard plenty of developers make claims of intelligent enemy AI in the past. When all hope seems lost, one day you wake up and find the door to your prison cell unlocked, and begin your escape from the confines of the keep. You play as a prisoner who has been jailed for many a year and left to rot. The game is inspired by games such as Ultima IV, Rogue, NetHack, and boardgames like Hero Quest. TinyKeep is being developed by a programmer named Phi Dinh. Persistent characters that you can customize and build up across harder dungeons. TinyKeep is an action RPG being funded via Kickstarter with three major goals:
