Auto Side Scroller

Hello!

I’m trying to figure out the best way to do a auto side scroller. Every tutorial I’ve seen shows character-driven camera movement, but what is the best way to have the environment/camera drive the movement?

Two examples of this are UN Squadron (an AMAZING SNES SHMUP) and the aero levels of Cuphead.

I thought about “forcing” the player forward with a constant velocity that can be added and subtracted from (not sure that would work). I would use two collision planes just outside of the camera to keep the player within bounds.

My second though was to move the entire landscape and its actors through the player, but that seems CRAZY inefficient and stress-inducing. (I actually think this is what they did in these two games, but they used flat planes with parallax motion.)

Also, to further clarify my dilemma, if there are enemies on the ground that could move (i.e. tanks and missile launchers) independently of the scroll, I’d have to ensure that they are moving ALONG with the landscape (and not that the landscape would slide underneath them), and that seems like a logistical annoyance, which is why I’m hoping there’s another way.

Heya @Leomerya12!

So yeah, character-based is the way to go- but keep in mind exactly what’s going on.
The camera can still be a sidescroll-at-specific-speed thing. You could do something like put the character’s scene node on a spline, and the ship moves within an x/y range of the scene node freely in local space while moving in worldspace with the node.

I know it works because I did it to build a starfox clone- you just have to wiggle some things around to make it a side view game. But building the level is where most of the issue is there- that’s a lot of ground to cover!

1 Like

So, if I’m understanding you correctly, I WILL put the LANDSCAPE/SCENE on a scroll/spline then?

I also thought about just having the ground enemies be pawns/characters so that they rest on the ground, but can still move independently.

Am I understanding you correctly?

No, no, sorry.

The character’s root would be a scene node center screen. That node will travel on a spline and take the camera, skeletal mesh (or don’t if it’s say mario but that’s another conversation) and ANYTHING the player owns along with the scene node. That scene node moves the way you make the spline- so you could even turn corners and stuff if you really wanted to, or turn and go straight up. The level stays still, the spline is a rail and the scene node (root) of the character is on said rail.

1 Like

Wait, what!?

You can do that?

I know animations can move away from a root component, but you can actually independently move a character away from its root component?

Do I have to choose a different class?

(By the way, speaking about twisting and turning with this method… I was racking my brain trying to figure out how to pull it off.)

Yeah, so let’s get clearer here-

Are we doing a runner type game or a shmup or Mario 3 type scroll level or what? Because those will all be separate cases.

It’s really just a matter of parenting, really.

Yes, it’s 100% a shmup, just like in the video. (Horizontal scrolling… again, exactly like in the video.)

Ok so you’ll use a pawn.

You’ll lower everything else to be below the scene node. Parent the camera directly to the scene node, and do that with the pawn as well- don’t parent the camera to the pawn.

All of your inputs, have them affect the highest point in your pawn (probably your collision) and it will move the rest of it. CLAMP that movement to whatever distance you want in X, Y(probably 0), and Z, and boom! (get this done before the spline part).

As far as movement along a spline, there are multitudes of videos for that, but to type it out would be a long process considering I know you know quite a bit of the steps involved already.

1 Like

Sister/Brother you have NO idea. Come a long way since you first helped.

Okay, I don’t 100% understand what you’ve said, but that’s because it’s abstract to me. When I start doing it, it’ll make sense.

Thank you!

I may revise this in the future, because it won’t be for at least a month before I start this (I need to build levels first).

You may want to go ahead and make the character- block it out! Just use a cube for your ship, and put a little sphere in the hierarchy as a sibling to the camera and the pawn at 0,0,0 so it stays centered and you can visually confirm the movement.

Levels come last! Always. You need to have your mechanics down first: ship speed, shooting, and basic enemies. Because then that will determine HOW you build your levels, as you build your levels around the capabilities of your player!

For instance- how would you build Super Mario Bros without knowing the player’s peak jump height/distance- when sprinting vs normal movement, where to place a fire flower and then a good wave of enemies to blast with it as a reward for not being hit, etc.

1 Like

AHHH!
Okay, GREAT point.

Very true. I had the same issue when I created a small racing project. The distances were too small, and I had to slow things down.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.