Training Stream - Creating a 2D Side-Scroller, Part 2 - June 9th, 2015

WHAT
Developer Relations Technical Artist continues showing you the basics of building a side-scroller, using Paper 2D. You’ll cover creating sprites, flipbooks, tilemaps, basic movement/abilities, creating obstacles, and a simple UI using the UMG UI Designer.

Part 1

[DOWNLOAD](Source.zip (25.1 KB)&d=1430225685)

WHEN
Tuesday, June 9th @ 2:00PM-3:00PM ET - Countdown]

WHERE
www.twitch.tv/unrealengine

WHO

  • Developer Relations Technical Artist

Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer everyone’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!

Edit: The YouTube archive is now available here](Blueprint Creating a 2D Side-Scroller | 02 | Live Training | Unreal Engine - YouTube)

Great news :smiley:

wasn’t this explained in Part 1? ^^

That was also pretty awesome! If it’s possible can we get another chapter, maybe involving enemies/AI and simple combat?

Thank you again for the awesome videos!

Great Tutorial and my first with 2D! Even got the flashing effect going myself.

Noticed if i walk into the spikes (collision box) the added force works fine but if i jump into it, its very variable. Any ideas?

Don’t worry, will be continuing this series. :slight_smile:

I got it flashing too!

I’m guessing that because the character itself has variable force when falling from the jump, that variable force is being added or removed to the force applied on hit. For example, if the character is falling with Z force 3000, and you’re applying -5000 Z force, the the resulting force is only -2000. But on another jump, he might be falling differently and the force itself is different. There’s probably some function to get the character velocity/forc and you can probably use it to add/remove the difference between character fall and the force applied to AddForce, but like I said, I’m guessing… I’ll check it out if I can, and I’m sorry if I didn’t make much sense!

That’s great! Thank you guys!

Hey all, thanks for watching the stream.

Here’s the graph from my master project. I’ll have to go back to the replay and see what I missed during the heat of the Livestream moment, but you’ll notice a couple things:

1.) This is the working blink effect. (That I’ve used a dozen times in various projects!)
2.) I added “Stop Movement Immediately” to zero out any velocities on the Character Movement Component. That works, though I still get curious results. Sometimes a knockback force of X will throw me back Y units, and then other times it will throw me back 100*Y units. It kinda seems like a bug, as the variability in knockback is consistent when it randomly switches. I’ll be speaking with our physics people shortly.

For kicks, I might try testing and setting the “IsHit” boolean in order to mitigate the possibility that the hit event is being triggered multiple times on the overlap.

Following this series with interest. Very good one!

I missed the stream :frowning: , when will the vod will be uploaded ?

Thanks Voradorpt/Alan - Ill give that a go. It did seem to work randomly when i made the trigger box bigger but only when travelling right to left! All very odd.

I got the flicker working using a flip/flop between hidden and not hidden which seemed to work well too.

Looking forward to the next one!

UPDATE.

Slight change to the hit function. I think I got to the bottom of knockback issue. Replace “Add Force” with “Add Impulse”

After discussion with our people in charge of Physics and Character Movement, I learned that “Add Impulse” is what we actually want. Apparently the Character Movement component has some amount of custom code that enables it to do what it does and “Add Impulse” is designed to work with that system, rather than the Physics system directly.

I’ve done a bit of testing with this new config and thus far is reliable. In addition, the values we can now use for the knockback forces are more comprehensible for those of us that don’t like to deal in big numbers.

My forces are:
Impulse X: -12500
Impulse Y: 0.0
Impulse Z: 40000

Nice! I’m going to try that when I get home. Thank you!

EDIT: That worked great!

@AlanNoon When will the stream VOD will be uploaded to youtube ??

Thanks Alan! Ill give that a shot in a bit.

Hope we don’t have to wait tooo long for part 3 - especially now 4.8 is out.

Quick question, how would you go about using two different flipbooks for standing, running, shooting, etc., if you have an asymmetrical character. As it stands your using the same flipbook animation for the left and right, because the sprite is symmetrical.

An example being, if the character has a blaster on their left arm. When looking to the right side of the screen, the left arm would be behind the character, and when looking to the left side, the left arm would be in front of the character.

In the character we’re using in the stream, you’ll see there’s a test on the values coming out of the “Right” axis to determine which direction the player is pushing. After deciding whether or not it is < or > zero, the sprite is flipped and the same running animation is played.

You would pick a different running animation to play off of one of the directions. You’d do the same for all of the animations that had a Left/Right version.

Before all that though, you may want to ask yourself if doubling the art size, the authoring effort, and the implementation time is really worth it!

Thanks for the reply Alan. I’m loving the series so far. Keep it up.

As someone whose just trying to learn the engine, with no time or budget constraints, I would say it’s definitely worth it.

Also I’m wondering if you’ll cover some of the new features in 4.8, since it just released?

Thanks for the feedback. I’m happy to keep going with this project for as long as you all find it worth while.

Fair enough! Actually, that probably is a good learning exercise.

I wanted to get into tilemaps last time, but encountered a couple of issues right before the stream. I need to speak with some folks over here about them before I start sharing practices.

Alan, I was curious if you could help me out. I’ve managed to get the blinking under control (I shrunk the Timer time to .02 seconds and the Delay to .2 seconds) and knockback never seemed to give me trouble, but, trying to stop the character from moving after they get hit doesn’t seem to work – it seems to nullify my sitting animation. Do you know what might be causing this or how I can fix it?

P.S.: Thank you, I’ve been learning a lot from this series.