Follow us by email to recieve updates about WHY Games!

Gravity Ark's Procedural Generation: Using Chunks

Gravity Ark's Procedural Generation: Using Chunks

When designing Gravity Ark, we wanted each play through to be a unique challenge. Depending on the design goals for the game, you could either manually design enough levels that a player would never encounter the same one twice, or you could program the game in such a way to “design” its own unique level for each play through. This is where the concept of procedural generation comes in.

We are writing a multipart series on our design process using procedural generation:

Part one (You’re reading it). Other parts to come soon!

Basically, procedural generation allows unique levels to be automatically generated by the game’s code. At its most extreme procedural generation could allow for infinite variety. In one sense, infinite variety is a good thing, in that the experience should never get stale. There is a big risk in leaving everything up to the computer though, as it can dramatically swing how challenging a level can be and with it how fun the game is. As such, good use of procedural generation is always a balancing act between control over the experience and variety.

Based on the design of the project, we decided to use chunking. This means that we are hand crafting areas (chunks) and then attaching these hand crafted areas together.

A Chunk:

In Gravity Ark, chunks are created on an 8 tall by 10 wide grid.
This is one such chunk
However, each individual asteroid is not stored. We save a text file and a single asteroid, and then copy that asteroid as many times as needed while the game is being played.

An example character sheet
As far as procedural generations go, this is actually extremely straight forward. Which allows us to have a lot of creative control over what the player is experiencing, while still offering a lot of variation to the player.

Variation in the chunks:

When a player plays a game that uses chunking, they can start to remember individual chunks and that can hurt the experience. So we started using probabilistic tiles. For instance, when the character sheet has a 3, it means there MUST be an asteroid at that location, but when there's a 2, it means there MAY be an asteroid there.

At this point everything seemed to work great.

“Hurray! Let’s ship it.”

However, there was an issue we both missed. One of our play testers (Thanks! Chris Vento), realized that you could go through all the asteroids in a straight line indefinitely. For those that haven't played Gravity Ark, there are asteroids you are attempting to avoid. Mr. Vento realized you could line things up in such a way that you could never touch the controls and never loose. To fix this we decided to jostle the vertical position of the asteroids to give us a bit more positional variation.

When this is combined with a random rotation, we get:

That’s it for now. Check back in soon for more on how we used procedural generation in our game Gravity Ark.

This is Chris Ross with WHY Games Studio, hoping your day is out of this world! 

-WHY Games Studio
Next PostNewer Post Previous PostOlder Post Home


Post a Comment