• Register
Post news RSS Development Update - IndieCade East, Integrating Portals

Relativity will be one of the games at a Show & Tell session at IndieCade later this week! Here are some of the last minute problems I'm dealing with as I try to get a build ready.

Posted by on

So, I have some pretty exciting news. I learned a few days ago that I'll be demoing Relativity at one of the Show & Tell sessions at IndieCade East next week. The session I'm scheduled for is Sunday, February 16th 1:30 PM - 3:30 PM. I'll have a playable version for people try out. So if any of you will be in NYC for IndieCade East, come say hi! (Itay Keren's Mushroom 11 will also be at the same timespot, so be sure to check out that game as well. It looks super sweet) It'll be the first time I'm having the game playtested publicly in over 3 months, so I'm really looking forward to getting some feedback.

Also, if you stop by, you'll get one of these sweet business cards, which I just got in the mail:

Integrating Portals

I've placed myself in a self-imposed crunch to try to get a mac build ready these few days before heading off to New York. My goal is to integrate portals into the main gameplay, and have the first several levels be able to smoothly transition between one another. This is probably the biggest change to the game since the last stable build, and I'd really like to see if it works well.

Here's a shot of a portal integrated into the actual game:

You can see that the lighting between the two scenes is not consistent - there are no shadows in the scene inside the portal. However, this is something that's going to have to wait for now. More important problems to tackle at the moment.

Mesh Collider vs Primitive Collider

Everything in Relativity is constructed out of boxes. This is mainly so that you any surface would fall explicity under one of six gravitational fields (if I had a slope at 45 degrees, it would have to be in 2 gravitational fields), and also because I have limited resources, it's a minimalist style that I can do well. To try to optimize my scenes, I started to merge all the primitives into meshes, in order to reduce draw calls.

However, I soon started to have all these weird problems with collision. It turns out, while having a single mesh over many primitives may be preferable for rendering, it is not for so for collision. Thanksfully, I still had my original primitives saved. The current set up is I created a giant mesh with the primitives, but the mesh only has a renderer and no collider. I keep all the primitives, but turn off their renderers, so that only colliders remain.

It took a while to figure this out, but I'm glad things are working now.

Mac Build

Also, I finally went ahead and put together a build for Mac. And everything works great, except the camera is inverted along the Y-Axis...

I think I know what the culprit is though. I had written a shader that uses the depth buffer a few months ago, and it was outputting the image inverted, so I had added this line of code:

csharp code:
screenPosition.y = 1 - screenPosition.y

I'm guessing that was a PC-specific problem, so on Mac, it's inverting the image in the game.

Comments
Methodias
Methodias - - 7 comments

Have a nice time at IndieCade, those business cards look nice, and how could anybody turn down some added QR codes? :P Nice job with the portals (and design in general), it's looking slicker and slicker, although that just may be the art style drawing me in whenever I see new pictures.

You mentioned there were no shadows in the scene inside portals. Now I know you said how this isn't top priority, understandably, but I am curious about it (if you don't mind me asking). Are shadows disabled from a scene when you're viewing it through a portal only, or are the shadows still disabled when you enter the portal?

Good luck with the project Will, it's looking very fancy, and I can't wait to see how it all ends up. ^^

Reply Good karma Bad karma+2 votes
williamchyr Author
williamchyr - - 38 comments

Hey Methodias,

Regarding the issues with the shadows, I'm not sure exactly what's going on, though I do have some theories.

Shadows are only not visible when you're viewing it through a portal. As soon as you step through it, the shadows are visible again.

My guess is it could have something to do with shadow distance in the rendering settings. Basically, because both scenes are loaded at the same time, I simply place them very far apart to prevent overlap. For example, scene A would be at (0, 0, 0), while Scene B would be at (1000, 1000, 1000).

I'm wondering if Unity only draws shadows for things that are within a certain distance from the camera. And so, when the portal is showing you a room in Scene B, the shadows aren't being drawn there, because the room is actually very far away from the camera.

The other place that could be causing the problem could be the reflection shader. I think it doesn't account for shadows and lighting, so those aren't being shown when you're looking through the shader.

Reply Good karma+3 votes
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.