Google+

Interactive Media Experimentation – 6DM06

Leave a comment

November 3, 2015 by jonmillymiles


Aim – to create a blueprint that procedurally generates a dungeon as a level for a game.

Procedurally generated content is created within the game engine at run time through the use of an algorithm rather than being designed by a level designer. In order to effect good game play from the level it is essential that the algorithm is tweaked to generate best effect for the game style that is intended.

Some modern games such as Sir, you are being hunted! (Big Robot, 2013) feature randomly generated landscapes for the player to explore and escape. Others, for example Pixel Dungeon (Retronic Games, 2015) place the player in a dungeon that they must then explore. Such roguelike games demand a different style of gameplay tactics which are independent of the level design, based around unit strengths and weaknesses and player choices.

Initial Experiment

To begin with I need to look at the generation of simple content within the game engine (Unreal Engine 4.9.2, Epic Games) and to use the Blueprint system to generate code that will create a floor plan.

To begin with I worked on individual components and attempt to join them together. As an initial test I have taken a simple tile and used the construction script to generate a room based on two loops, one to generate a line of tiles and a second to generate more lines until a defines width and length is created. This was relatively straight forward:

GenerateRoomThe function that places a tile creates a Static Mesh component with an offset of X and Y based on the indexes of the two loops, below.

PlaceTile-Function

This creates a rectangle of tiles that the user can control. To automate this, we simply set the width and length variables to be randomized within the construction script and the rooms will be procedurally generated each time they are created.

Random Room Generation

Now when we place these in our world the room size will vary with each change. If we want this to change each time the game is run we need to add them into the level blueprint activated by a Begin Play event. Like this:

Random Room PLacement

This gives the following result:

Conclusion:

There are some flaws with this methodology. The main one at present is that none of the rooms are connected up, nor is there a suitably controlled manner of their generation. As such, while this proves that rooms can be generated at random within the control of defined parameters, it shows that the algorithm is neither as refined as it needs to be nor as complex.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Blog Stats

  • 9,930 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 580 other followers

Archive

%d bloggers like this: