The Collapse was a project done for the AICASF 2014 game jam, consisting of students and alumni from three different Art Institute of California schools using Unity. We had 24 continuous hours (sleep optional) to make a game with an ‘Apocalypse’ theme. This project was later adapted to a VR project you can find here.
The game takes place on a large platform that is slowly collapsing and falling into a glowing pit of lava (or something). The player has very limited visibility, the only light coming from the player them self, a helper drone robot, and collapsed floor tiles. The closer to a tile a player is, the faster it will break and fall. There are enemy security cannons that will shoot at the player, destroying any tiles hit. Players have an energy gun that can also destroy tiles and cannons. The goal is to find spaceship parts in the level and return to your own ship so you can escape.
Our team was two programmers and three artists. My duties were creating the collapsing floor mechanic and the enemy cannon behavior, as well as some minor miscellaneous scripting for stuff like switching levels and the item pickup system.
The game itself could use some polish, but I’m mainly proud of my floor collapsing mechanic. I used a heatmap-style approach to this. All tiles in a certain range of the player will have an increasing ‘break’ value that goes up faster the closer the player is. Because tiles all had variables to track, as well as neighboring tile information and lighting, I was very worried about efficiency. I came up with a system that ran very well and did not introduce any framerate issues.
Tiles are registered dynamically at the beginning of the level, meaning we were free to change level layout without any issues. Any collapsing tiles would activate their own light, as well as tell its neighboring tiles to run a second lighting check. If a broken tile ran this check and saw all surrounding tiles were broken, it would disable its own lighting and logic to keep it from crunching any more data that wasn’t needed anymore. You can see the heatmap working to the right represented as red boxes that increase in size, as well as red lines signifying a neighbor connection.
You can try out the game here. Controls are WASD to move, LMB to shoot, and RMB to move your helper robot. Some hard-to-see text dialogues pop up, so move slowly at first to make sure you don’t miss anything. Also, there was never a ‘win’ state implemented, so if you manage to get through the two levels and return to the spaceship in the starting area, you’ve beaten it.
You can also find the game code below. Tile.cs and TileManager.cs are the important ones, located in the Assets\Andrew\ folder, though I recommend checking out the source code linked on this page instead since it has been cleaned up a bit.