Switching Between Two Identical Maps with Different Lighting

Hello, all!

I’m working on prototyping a game. In this game the player is in a multi-floor, multi-room building. In the game I want the player to be able to jump back and forth between two versions of the same building; one version is very well lit and organized, and the other version is very dark and scattered with debris. Besides the lighting and debris, the two buildings are identical (same floor layout, same walls, floors and boundaries). The switches between these two “maps” wouldn’t happen very often, but can happen on demand from the player (with a built in cool-down). The point is it’s not switching every few seconds, just at spaced out points in time.

I am trying to determine the best way of achieving this. I have a few ideas but I am looking for recommendations on which way (if any) would be best in your guys’/girls’ opinion and what holes if any exist in the different ideas I had.

[Idea 1]
I would have one map/building with all of the lighting and debris included. Upon switching between the two versions, all of the light gameobjects would be disabled and all of the debris objects would be enabled (and vice versa for switching back). My only concern with this method is the lighting - ideally in a game environment I feel like lightmapping is a great optimization method, however if I’m enabling and disabling lights on the fly it kind of invalidates the Lightmap. I considered maybe having two lightmaps (one for the light version of the building and one for the dark version of the building) and swapping them dynamically on the fly but I don’t know if this is possible and/or practical.

[Idea 2]
I could have two of the same buildings side by side (I’m not worried about the player being able to see the other because I don’t plan on having transparent windows or views out of the building). The layout of both buildings would be the exact same as I intend but each one would be set up with the lighting and assets I desire. Upon the call to “switch” the world, I would have a system in place to “teleport” the player to the corresponding location in the other building. This way I suppose could work but is prone to some bugs if the teleportation doesn’t happen exactly as it needs to (the player could somehow find themselves stuck or outside the map while teleporting). With this method only one Lightmap would be needed BUT the map would have twice as many asssts.

[Idea 3]
Two separate scenes, each with the same building set up with its two versions. It’d work the same as Idea 2 but instead of teleporting the player there would be a scene load during the switches. This is my least preferred way at a glance because the game is not very long and I feel like the constant loading would take away from the playing experience.

Ultimately I’m just wondering what you all think would be the best way to achieve this. I’m open to any discussions, recommendations, etc. to help me arrive at an answer.

Thank you!

I actually think idea 3 is the best because you can bake lightmapc etc. and can create really overlaping buildings without a really teleport
But I would do it slightly different:

Create two scenes with a root gameobject holding all objects:

SceneNormal
RootNormal (GameObject)

SceneDebris
RootDebris

Both scenes are loaded at the same time additive (so when changing scenes no more load time occur.)
When playing in the normal world: Set SceneNormal as Active Scene and set RootNormal Active and RootDebis inactive.
When playing in the debris world: Just the other way.

You could even create a third additive scene holding each objects which are really always the same between all scenes for example the player. So you dont even have to bother to put the player in the correct scene when changing:

SceneInstances
Player
Other Stuff…
SceneNormal
SceneDebris

I actually didn’t even know it was possible to have multiple scenes loaded at the same time. The biggest turn-off for that idea was that I wasn’t willing to have a delay for loading/unloading scenes during the transitions between the two maps. I want the transition to happen in a way that’s very fluid and transparent to the player.

That being said what you suggested sounds like an idea with great potential. I’m going to have to dig through reference material to figure out how to efficiently do it but you’ve given me a good start. Thank you!

Dang I actually saw a tutorial for this on YouTube like a year ago, they were recreating some game that had a looking glass that showed the past while you’re in present time and you could shift between them to get past obstacles.

Sorry I can’t find the video in this moment but I believe he just had the levels stacked on top of each other in the same scene and would teleport the player, there was no lag or loading screen though.

The video would be super interesting to see for sure. If by chance you find it (I don’t expect you to look haha) it’d be awesome if you posted it.

1 Like

If I could just remember the game they wanted to remake I’m sure I could find it, I’m still looking and did plan to come back here if I find it.

This is the video you’re talking about. :slight_smile:

1 Like

I personally would go the two separate areas and teleportation route.

1 Like

That’s the exact one! lol

What you could do is have them side by side with a skybox in both.
The teleportation mechanic would turn a bool on and another off; when doing so, it will turn off the previous lighting and light the new one. The “teleportation” should freeze or slow time, fade the main screen to black momentarily and move the character on the X or Z axis for a certain distance value. This way you load 1 scene once and if you need quick interactions within the same scene, it can be done instantly.

1 Like

expecting your game;)