PlayStation VR

Oct 17

Oct 17

The Tech That Powers Megaton Rainfall, Launching Today on PS VR

Learn about the tech that powers this staggering superhero sim.

Alfonso del Cerro Aguilar's Avatar Posted by Designer and Programmer, Pentadimensional Games

Holiday 2012. I was sitting on my coach with my laptop warming my legs, playing around with a very early version of Megaton Rainfall (although it wasn’t named at that time). On screen I had a simulation of buildings collapsing depending on where you shoot them. It was looking fantastic. I remember thinking “Oh my god, this is cool,” and I decided I would finish this game until the end (which involved quitting my job).
 

Like everyone else, I like Hollywood blockbusters with a lot of explosions. And there’s one thing explosions in films do well and games don’t.

Most explosions you see in games are not procedural, and do the following. Let’s say a house receives a hit from a RPG and explodes. At the time of the explosion, they replace the “house” mesh by a “wrecked house”, and at the same time they add a particle effect (fire, smoke and debris). The problem is discontinuity. You notice the cut, an abrupt change in the first frame of the explosion, so you don’t feel the house is what exploded. Besides, the “wrecked house” doesn’t have a hole in the exact location of the RPG (because it was modelled by an artist who didn’t know where it would come from).

A solution could be to have a “chopped house” in memory, partitioned in a myriad pieces, and on exploding switch to that mesh and start moving only the pieces near the center of the explosion, but… What if the designer is a nonconformist and wants massive explosions of massive skyscrapers in massive cities 200 square miles in size? That would exhaust memory in one fell swoop.

So here are the two “bright” ideas that make all of this possible procedurally in Megaton Rainfall.

(By the way, I wish I could send this blog to myself back in time — it would have saved me a lot of failed experiments).
 

First idea: at the time of the explosion, the engine takes a snapshot of the house just as it’s seen from the camera. Yes, a snapshot. A bitmap. Next it generates a particle effect that fills the space of the exploded zone, and apply the snapshot to the particles as a texture, so that from the camera, the first frame of the explosion is seen exactly the same. Continuity achieved! You can follow every detail with your eyes during the explosion until they disperse. Besides the particles are GPU-accelerated 2D billboards. The PS4 can handle bazillions easily. The feeling is phenomenal and no other game handles the explosions this way as far as I know.
 

Second idea: given a building and the position of an explosion, how do we generate the wrecked version of the building, including thick inner walls? The trick is to keep a “paper” version of the building (with walls with no thickness), that the player doesn’t see, and an “inflated version” with thick walls that’s displayed on screen. The engine has the feature to “inflate walls” of a “paper” mesh very fast. When a new explosion takes place, we discard the inflated version, we remove the triangles of the “paper” mesh near the explosion (updating the paper version), and we regenerate the inflated version based on the paper version.
 

Then we add fire, smoke, sparks, expansive wave, unfortunate people and furniture, and voilĂ . Procedural explosion ready to serve. There are plenty of other types of explosions in the game, but this post might have a word limit. But the gifs are not limited, so here’s another one:
 

Add Your Own

BlueFrog007 said:

October 17th, 8:41 am

Wow, that’s a really cool way to approach the problem, and the end result is a more believable destructive terrain. Awesome work!

GunnerFCm said:

October 17th, 10:08 am

Very cool inside look that has now put this game on my radar! Thanks for sharing!

Sanador62 said:

October 17th, 10:13 am

Wow! That looks incredible. The tech behind it is fascinating…nice blog post. I will definitely pick this up this week for my PSVR!! :)

SuNnYBoI said:

October 17th, 2:33 pm

BOUGHT! I’ve been looking for an open-world PSVR game to just explore around in. This looks amazing AND the tech behind it is genius!

I can’t wait to see this tech be put in something bigger!

SuNnYBoI said:

October 17th, 2:33 pm

BOUGHT! I’ve been looking for an open-world PSVR game to just explore around in. This looks amazing AND the tech behind it is genius!

I can’t wait to see this tech be put in something bigger!

JadeNepia said:

October 17th, 9:11 pm

Is there a way to play along side the aliens and destroy stuff? I finished the game and found all the shinny things. Now i want to be able to enjoy watching my gigaton blast cave in the city lol

whereymyconary said:

October 17th, 11:52 pm

Damn you psvr why do you have to be such a fun toy. I’ll have to pick this up this week when I get paid. Looks like a lot of fun to break things and maybe save a planet or two.

Dudeman_162 said:

October 22nd, 4:53 pm

All it needs is a sandbox mode

Logan22 said:

October 23rd, 2:33 pm

Alfonso if you read this, I’d like you to know this was one of the finest VR experiences I’ve ever played.

boflover1278 said:

October 27th, 3:50 am

Wow Alfonso, this is amazing. And I assume you must be into the cosmos. . . I have dreamed of a game like this for a very long time. I am in awe. And the way you changed the game for all of the creators, nobody has an excuse anymore for rendering. This proves it can be done. That is what I want to know. .. . how did you fit such a huge game into 1.1GB?!!! That is the question everyone should be asking! How did you do it??? There are some 40GB behemoths out there which don’t need to be. You are a legend in your own time, you will be famous for this.

boflover1278 said:

October 29th, 5:51 am

Alfonso, idk where to post this, so I’ll post it here at the risk of you not even seeing it. . . the 1.03 update, it crashed just as the credits were finished rolling. I’m going to try and beat it again and see what happens.

Comments are closed. We close the comments for posts after 30 days

PlayStation Blog