Looking Glass Post-Mortem

Posted by (twitter: @SudoJess)
August 30th, 2014 5:44 am

This Ludum Dare was my 8th time. I’ve come a long way since then.

This time round, I made “Looking Glass”. I’ve been rewatching the Stargate series for the god knows how manyth time, and it’s struck me as just how good the Stargate itself is as a games design device. You get this big circular thing as a barrier between worlds, a “home base”, plenty of room for exploration of mechanics, completely different level and terrain design, so much storytelling potential, it’s why it works so well as a device in the show as well.

I knew I was going to enter the jam from the start, there’s no way I could make the assets needed to in time, so I was either going to find publically available assets or find a 3D artist with time to spare. I didn’t find an artist in time, so I just used some assets I found that were free to use.
I spent the first day making the actual gate effect, it’s a complicated system to be honest, since then I’ve been thinking of ways to simplify it, probably using Rendertextures than the current method.
The basics of it are this –
A custom shader on a material, attached to a plane. This material fills the Z buffer.
A system of 4 cameras
Camera 1 – parented to the outgoing gate (though gates are bidirectional here this is important). Moves relative to the camera relative to the gate direction. Some funky Quaternion Maths going on. Clears to skybox Depth of -4
Camera 2 – same as Camera 1 although it doesn’t clear at all. Depth -2 (so it’d override Cam1)
Camera 3 – Player camera, clears to depth buffer Depth -1, ignores the custom materials
Camera 4 РDirectly parented to player camera, Clears to depth, depth -3, culling mask ignores the incoming portal

So what happens is the cameras all move relative to the player, Cam 3+4 are directly, Cameras 1+2 move so they’re always offset by the portal position+rotation. The effect here is that Cameras 1+2 only get drawn onto that material (due to the clever depth shader), however there’s some overlapping with the incoming portal having 2 cameras draw on it, so camera 4 does some absolute magic to make the outgoing portals camera not draw on that. Honestly I can’t exactly explain how it works, I’m not a very good technical writer. We’re basically talking about a lack of something overlapping another lack of something so a something can draw on one lack of something rather than the other.

The effect, however, is rather amazing. We get an effect similar to the portal series of games.

View a video here.

Teleporting was rather easy. Attach a rather thin collider, make sure you grab the players rotation relative to the portal, and set the transform and rotation relative to the new portal. There’s still a rare glitch where the player will come out a bit too far back and be clipping through the portal, but it was a simple fix, I just didn’t have time.

As I spent day 2 and the morning of day 3 quite ill, I didn’t have much chance to implement any real gameplay. This was a real shame, I wanted to make the game about exploration, but with a bit more actual interactivity than I managed.

I made a bunch of different worlds, added an updating “database” with the new fancy Unity UI system, and plopped a few terminals in there to guide the player along a journey of different planets. I managed to add 2 hidden worlds too, dropping a few hints here and there as to their addresses. Someone’s already hacked the game to find them too!

Have some screenshots of the first 2 areas

7905-shot17905-shot2

 

And don’t forget to play ¬†+ rate! Any feedback is much appreciated!
Game link


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]