1
\$\begingroup\$

How can I achieve Streets of Rage type of perspective in UE4? By that, I mean having a 2D character that walks "into" the screen, but the character doesn't get smaller or angled in any way.

Example animation of Streets of Rage 4

Is there a camera setting that allows that? Or some kind of character setting?

Also, how would I set up the background? I'm pretty sure that it's just a static image that is put behind on a plane, but maybe there's a better way to do that?

I already created a game that attempted this with a friend during a game jam, but the camera view doesn't look the way we want.

\$\endgroup\$
  • 1
    \$\begingroup\$ That sounds like an orthographic camera projection. How have you tried setting up your camera and scene so far? \$\endgroup\$ – DMGregory Jul 7 at 1:13
  • \$\begingroup\$ Will the graphics also be 2D like in Streets of Rage? Also you can post an image of your game, to give people an idea of what you mean. Also what didn't work on your game? I'm tempted to write an answer, but I don't want to mention all the steps you already did on your first game. \$\endgroup\$ – TomTsagk Aug 6 at 9:04
  • \$\begingroup\$ @TomTsagk I want to point out that answer are not only for the person who asked. They are also for other people who has the same or a similar problem, search and find the already existing question. In fact, they are also for people who do not have the problem at all, yet can still learn from it. \$\endgroup\$ – Theraot Aug 6 at 9:31
  • \$\begingroup\$ @Theraot I'm aware of it, but to me it feels like the question is not clear currently, as the OP wants to do something, and has already tried one way that didn't work. From the post I can't tell which is the one that didn't work or if it should have worked but OP missed a step. \$\endgroup\$ – TomTsagk Aug 6 at 9:43
1
\$\begingroup\$

I mean having a 2D character that walks "inside" the screen, but the character doesn't get smaller or angled in any way. Is there a camera setting that allows that?

You want an orthographic projection mode.

Also, how would I set up the background? I'm pretty sure that it's just a static image that is put behind on a plane, but maybe there's a better way to do that?

There are two ways I can think of:

  • Easy: You can have the background be a plane behind, simple. It is basically using the 3D engine as a 2D engine, letting the depth only apply for occlusion (depth-test/z-order). See SHOVEL KNIGHT IS A 3D GAME?! Its Own Developer Explains - Boundary Break
  • Hard: you can use billboard sprites for the characters (that way the angle of the camera does not affect how they look※), make the scenario 3D, and angle the camera. Similar to making isometric games in 3D, except not in that angle, but something that suits better the game. See Can I use a 3d plane for a 2d game?

※: Alternatively you can use 3D models and apply a transformation on them corrects for the angle of the camera. See Zelda: A Link Between Worlds From a Brand New Angle - Boundary Break.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the answer. When I tried ortographic mode with my game, it fixed some problems but not all of them... you know how in the games i mentioned, going "inside" the screen also makes you go up? That's what I want to achieve. But for that I either have to make the player actually move upwards (along Z), and that messes up enemy pathfinding and many other things (like making floaty character). I also tried rotating the camera, but that of course messes up the whole perspective and stretches my sprites. \$\endgroup\$ – lilKriT Jul 7 at 2:17
  • \$\begingroup\$ @lilKriT it should be possible to fix the pathfinding. After all, the enemies would have to move the same way, so if the character has to "float", the enemies too. However, it can be hard, depending on how you have setup the scenario. On the other hand, if you are using orthographic, you are not using perspective. Try creating billboards for your sprites: Unreal Engine 4 Billboards. They always face the camera, that should solve the rotation problem. \$\endgroup\$ – Theraot Jul 7 at 2:30
  • 1
    \$\begingroup\$ You can also use an oblique projection matrix to capture some depth of your scene without stretching your sprites. \$\endgroup\$ – DMGregory Jul 7 at 2:49
  • \$\begingroup\$ @lilKriT I did forget about oblique projection, that should work for you. However, apparently it is not that easy to set up in Unreal (as Perspective and Orthographic are the only available projection modes). For what I have been able to gather, you override CalcSceneView and call UpdateProjectionMatrix. See PROJECTION MATRICES IN UNREAL ENGINE and Howto modify the projection matrix. \$\endgroup\$ – Theraot Jul 7 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.