I’m planning out a project and I’m wondering how feasible this is and how to go about it.
First of all, I should say that I’ve only gently looked at UE4. I have a lot of experience with all the earlier versions of Unreal, but I’m still new to UE4.
So I want to make all of my game’s backgrounds move separately from the core gameplay elements; conceptually it’s going to be a lot easier to just move “the world” around the camera and everything else rather than the inverse.
But I’m wondering how this can be done properly. At least within the previous versions of Unreal, if I wanted to try something like this, I could build my background and world, add lights, render all the lighting, and I’d have my world. But if I wanted to make it move, all the lighting would fall apart. I would have to make the lights move with the geometry, which would tax the system incredibly.
I’m wondering if there is a way I could create all of my world geometry, render out my lighting, and then move all of that geometry without destroying the lighting data I applied to it.
There is virtually no difference between moving the camera or moving the world around the camera as far as end results go.
You will run into a ton of issues trying to move the map and the objects. All of them would need to be set to movable, and the light bake would mostly break just because of that.
You can try to move the Levels though with the level streaming. It may still not be good enough for run time usage.
The actual gameplay moves separately from the background. This is actually pretty common for certain types of space shooters, shmups, auto-scrollers, etc. The background or world moves to give the impression that the player is going somewhere, but all of the enemies and bullets and such are actually moving separately from that. Otherwise it throws the player off because when they shoot at something or dodge something they have to account for the motion of the world. How fast the player’s bullets go would change from one level to the next.
It’s most obvious with the more 2D shooters, but you can spot this happening in some games that try to look 3D too. Seriously, look closely at Star Fox, or even some Smash Bros levels. You can see moving objects don’t travel quite the way they should in 3D space, but rather they are constrained to a local field.
So the only way to handle this would be to either A: move everything through a static world but add the velocity of the path to everything, which could be a LOT of projectiles with today’s taste in shooters. Or B: keep all the gameplay constrained to a simple environment and have the background/world move around the play-field to make it look like everyone is moving. Or possibly C: have two cameras, one watching the gameplay and one running through the world and layer the two renders on top of each other; however this makes it more challenging to even have background elements that can interact with the gameplay (walls the pawns can run into) and would be very difficult if some elements overlap, like something in the background that moves past the gameplay area.
Between those three, I would wager that it would be easiest to just have the world move around the camera, assuming it can be done. Certainly it is possible in some degree, but the question would be what kind of sacrifices would I have to make to the lighting to do it. In the most extreme example I could have the background be an actor that receives no lighting and then have the lighting faked as part of the texture itself, but I don’t think I want to do that.
Generally speaking it’s always just fancy camera work.
Not sure if what you claim about starfox is even remotely true, but even if it were the game is what, 20 years old? Had no real lighting to speak of? Though rediculous one could easily achieve this idea today using the same graphical standards from then probably at 8k and 120fps too given the super low quality you would be dealing with.
Back to your point, in a side scroller like Mario the environment doesn’t move. The camera does.
usually it only does so if the player reaches a certain area on the screen, which keeps the movement somewhat fluid.
Because the camera is linked to the character you have absolutely no difference in movement speed when moving in the level vs when the camera moves along.
I wasn’t even remotely talking about platformers like Mario.
As I said, the issue isn’t about just the camera and the player, it’s about all the other gameplay elements. Every shot fired by the player or the enemies. These are what really needs to be consistent, whether the level is moving by quickly or has nearly stopped for a boss battle.