Procedural Work in Unity (C# and Javascript)

A little while back (late July) I posted up a screenshot of a top down view of a dungeon, with little more explanation than that, well here’s a bit more…

I’ve been working on a dungeon runner game in Unity with a colleague over the Summer. The basic premise of the game is that you play as the hapless hero who is terrified of pretty much everything in the dungeons; you have no weapons, no attacks and no courage 🙂 You have no choice but to run, dodge and scream your way through the levels, desperately trying to avoid the ever-increasing number of enemies who will start chasing you.

The little trick-some part of the design comes in with the procedural nature of the dungeons I’ve created. Each run through of the game is different – seeded randomised values control everything from the number of rooms, to the windiness of corridors to whether there is a flame on the lamp on that wall three corridors down on the left after the scary monster with the six eyes.

Multi Coloured Corridors

Levels are constructed some a mixture of corridor tile pieces that work a bit like Scalextric, slotting together in different ways to produce complex and vastly different layouts. Each tile piece can have many different variations of it too, maybe one in standard condition, another in a state of disrepair and another with swinging axes and Dave the unfriendly goblin waiting for you. Within each tile piece there is controlled randomisation too, props etc are all interchangeable and can be placed at runtime.

The above image shows a series of junctions with some simple proxy tile sections to test the linking of the rooms.

Speaking of rooms, the system supports bespoke room designs (consider them like really large tiles, that you can put in as much hand-crafted detail or rely on the procedural generation to whatever degree you wish) to give artists/designers the ability to have as much control as required.

Over the Shoulder (far):

Over Shoulder Test

An in-progress example. You can still see the proxy tiles in the centre of the level and some of the yet-to-be-created rooms where the corridors lead to a void.

Full Level Test


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s