1
\$\begingroup\$

Levels like A Crack In The Slab from Dishonored 2 allow you to jump back and forth between 2 time periods at the 'same' location.

The blending is not just a case of toggling map objects on and off, as the Timepiece in this instance gives you a view into an alternate time period, whilst the player is in a separate time period.

The drawn bounds of this Timepiece lens view are not axis aligned to x and y either, meaning you not only have to render the two time periods concurrently, but have to slice into game objects to partially occlude them (shader magic? post processing?).

I was wondering what strategies you might use to achieve such a transition/mixing of two views of the 'same' map effectively and efficiently? Maybe there is an existing library for a game engine like Unity?

Many thanks

(originally posted this question on Reddit but had no luck)

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

I can think of two strategies off hand, both require two (or more depending on effect) cameras. Both essentially have a camera that is rendering different content, and then map that content to a texture on an object.

So for the effect at: https://youtu.be/j4pmhvUtjic?t=434 It'd map the second camera as the texture for the shards.

That's the core concept.

How you relate or store the content is the difference, and is based on what you want the gameplay to be like.

  1. Duplicate content with positional tracking
  2. Rendering layers/settings per object

Duplicate Content

Imagine an entirely separate copy of your game world, perhaps offset on one of the axis such that the two copies don't intersect. For example, Timeline 1 is z=0, timeline 2 is z=1000, timeline n is z=(n-1) * 1000.

Then when the character moves you update all cameras, with those offsets.

When the player transitions between timelines, you move their model by the offset.

Rendering Layers / Settings

Each timeline is still a separate camera, however just with different rendering settings. Every object in your game would then have a set of rendering data per timeline.

This could be as simple as just textures to give them old, dilapidated feel. Or different meshes that could be rendered. You could give them translations (chandelier on the ceiling in one timeline, translated to the floor in another). It'd also be possible to essentially turn off an object in one timeline so it no longer exists (like the NPCs).

When the player shifts, you also need to update any physics objects, AI, audio, however you want for effect.

Summary

The trick is really to create two sets of content and have a camera looking at each set. Then you render the "off" camera to a texture for an object.

Notes

Keep in mind level of detail as well. If you're experiencing performance issues rendering two scenes at once, you could create a really scaled down rendering on the off camera. So, for 2 timelines, maybe 4 copies or sets of render data, one for active rendering, and one for quick low quality, distorted rendering.

For a simpler effect, it should be possible to overlay a portion of the second camera on top of the render of the first camera. Possibly building an alpha map to describe transparency. So it would blend the two renders, only including some portions of the second camera with varying levels of transparency.

How it was actually done

Here's a video about how they manage this: https://youtu.be/P_JKT2rHg50?t=229

\$\endgroup\$
4
  • \$\begingroup\$ Just adding this as an interesting example of multiple cameras to create unique perspective in a game: youtu.be/X8G3z1dwwto \$\endgroup\$
    – CLo
    Commented Jun 5, 2017 at 16:42
  • \$\begingroup\$ Wow thanks! I was thinking along the same lines that you suggest but the performance tips are most appreciated, as that was bugging me about it. Need to try out a rough prototype now. And that video, how did I not find that! Many thanks \$\endgroup\$
    – Darius
    Commented Jun 5, 2017 at 16:58
  • \$\begingroup\$ @ComethTheNerd Welcome, comment back here, or update the answer when you get a prototype going. I'd like to see it, and it'd be helpful to others I'm sure. I've been out of Unity for a while so I don't know how the technical stuff would work, otherwise I'd have more details in that regard. \$\endgroup\$
    – CLo
    Commented Jun 5, 2017 at 17:05
  • \$\begingroup\$ I'll note that you can also use Stencil Masks for this sort of effect as well. It's how Anti-Chamber does those weird cubes you can look into, but if you think about the one side of the cube being the timeperiod you're in and the other side being the looking-glass view, then you've got the right idea. \$\endgroup\$ Commented Jun 5, 2017 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .