Is is possible to turn a 2D event into 3D (and vice versa) in game?

This is probably very much a beginner’s question, but I’m working on a 2D sidescroller metroidvania and was wondering if it was possible to achieve this behavior for the music:

There’s a room where music plays 2D, non-diegetic. The next room is a transition room where the player walks towards this third room where the actual level begins, which has its own background music as well. I wanted both music events to play in that transition place but as they were coming from their respective rooms, and as the player walks away from the first one, they would hear less of that music (coming from the left) and would start hearing louder and louder the background music for the level (coming from the right). And as soon as the player crosses and enters the level, the music becomes 2D, non-diegetic like regular BG music.

I’ve managed to come up with a solution, but that only fits this specific situation and I’m now realizing that it may be more useful to create something that works more broadly. Since it is a Metroidvania and it has an interconnected world nature, several levels will be connected and the transitions will not only happen from left to right, but from right to left, up-down, etc. I don’t know if this is at all possible. Can I put a Spatializer on the events and “deactivate” them somehow when wanting it to go from 3D to 2D (and vice versa)? Any insight is truly appreciated. And I’m happy to clarify the question in case it got confusing.

Thanks a lot!

Hi, that’s a very interesting concept, Olivier Derivière does this (non diegetic music becomes diegetic spatialized music, and vice versa) in Harold, using Wwise, and applies a custom attenuation and spatialization to the BGM when the player character is off screen: After Bit - GK - 5 - Olivier Derivière, la musique interactive - YouTube

Before effect bypass automation is implemented, it’s not directly possible, but you could fake it with automation: put the spatializer on the music track (instead of the event master track), and send 0dB pre-fader to a return track (which will be the “non-spatialized” track). Then automate a cross-fade between those 2 tracks by a parameter called, say, “2D - 3D” (note that’s it’s a bit tricky to get it seamless, and the spatializer colors the sound even when the event is centered on the listener…). Then you’ll probably have to set checkpoints where your event should be relocated to the nearest level bound, before getting it back to 3D.

What kind of implementation did you use to make it work in one specific situation?

So sorry for the late reply @Alcibiade ! Got really sidetracked here lol

Thanks a lot for your suggestion, I’ll test it out here and try to make it work! Could you just clarify the “set checkpoints” part? Is it just setting where this effect would start and end inside the game?

As far as what I did, it was nothing fancy or elegant haha I basically set a global parameter that goes from 0 - 1 and automated volume, low pass, and more importantly, the panner to this parameter. 0 the player is inside the left-side room, 1 inside the right-side room. The further the player walks, the lower and further each music will sound. It works pretty well and seamlessly, but as I said, only for this specific situation.

If down the line, there’s a transition room to another area where the original BG music is on the left and the new room/area is on the right, this will not work anymore haha

I’ll definitely look into your suggestion, might be just what I’m looking for!

Thanks!

Yes, that’s what I mean, location inside the game map where you should update the location of the music event, before converting it to 3D.

But retrospectively, I now think that setting the behavior in the game code might be cleaner than my previous idea. Like, instead of your global parameter, use a local parameter automating volume and low pass, and another parameter automating panning, the game code will then automate all this at the right moment. And keep the event 2D. Simpler, cleaner, don’t you think so?