• Register
Post news Report RSS Adding Breakable Walls to the game with Voronoi Generation

Added secret passages to the game by creating breakable walls

Posted by on

Its been a long time coming but I finally put in breakable walls (and possibly later on, floors) to the game.

I've had a tiny bit of experience in the past with a feature like this in my last game Dungeon Nightmares II and the results were satisfactory.



However, for this new game I wanted to get away from the neat brick work that made the walls stand out too easily for the player to find, without the need of using the map to reveal hidden chambers.

Voronoi Algorithm

I stumbled across something in my search for better fracturing and its called Voronoi generation (http://alexbeutel.com/webgl/voronoi.html).

Since I use Blender, there were also plugins that made use of this algorithm so I decided to venture down this route to find a better smashable walls that also hides it well in the scenery.

Blender

First Test


The first test is shown above. Whilst this worked ok, I wanted to try and minimise the chunky look at the shards.

I decided to rework the wall and break it down to the size of the bricks rather than punching a hole through it.

New Wall

This was quickly followed by creating the breakable piece.

Wall Piece

Screen Shot 2018 02 10 at 10 00 2

Once I was happy with the above, it was time to get it into Unity.

Unity

For Unity, each shard needed a rigidbody that is disabled at launch.

Wall in Unity with Rigidbodies


Each piece can be poked and prodded in the game and depending on what threshold I choose, the rest of the wall will fall under its own weight.

Gameplay

Here is the final wall in the game.

A slightly longer look of the wall with sound can be seen in the following video clip too.

VIDEO CLIP

Post a comment

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