Learning UE4 through simple projects

Hey all, my name is Jason Lavoie. By day I am a professional artist working at Ubisoft Toronto (currently chopping away on the ACU team) and by night / weekends / any free time I can find… I’m trying my best to learn UE4 and it’s awesome blueprint system with simple game projects.

The initial goal is to learn the in’s and out’s of visual scripting to create some simple game projects (like Pong etc.). Hopefully as I keep working on progressively “harder” projects, I can start prototyping some more original / personal ideas and see where that takes me.

So my first project I’m trying to complete is Pong. Nothing super fancy or super exciting, but I figured you gotta start somewhere… and as an artist with little background in coding, Pong has been a solid challenge so far :slight_smile:

Here is what I have so far… nothing to fancy:

https://dl.dropboxusercontent.com/u/1514937/ue4_pong_01.jpg

But here is where I have been having issues… more so just wrapping my head around the logic / calling out / referencing blueprints within other blueprints and here is where I’m hoping you talented people can help me out.

Issues:

Score System Updating

This has been the biggest hump I have faced so far and I’m sure I am doing something super wrong, so I apologize in advance for any weird / broken logic :stuck_out_tongue:

Right now I have created 2 functions (for Player 1 and Player 2) that checks to see when the “Pong Ball” is outside of play limits, if so it SHOULD add a point to the “winners” score… The problem is it’s not initializing when the event / function is called. Here is what I have so far:

https://dl.dropboxusercontent.com/u/1514937/Pong_BP_01.jpg

But when I set it up in the Level Blueprint (When F is pressed, trigger function ScoredP1) the score works properly…

Any idea why the CheckScoredP1 function isn’t working? I’m sure there is a better way of going about this too, so any and all suggestions are welcomed and appreciated.

Thanks, I’ll be updating this thread a whole bunch as time goes on.

Whoops, I haven’t updated this thread with progress, I’ll try and keep it more updated from now on.

So after awhile trying to get pong to work, I actually switched projects and kitbashed everything together to make a Breakout clone. There is a good couple of videos that helped me get started - https://www.youtube.com/watch?v=DH8HHqiMbWA&index=4&list=PLCWzG3zfTUPOMKrOw3MS6rrx4ACxbF6Kg, and from there I started to somewhat get the hang of blueprints.

Here is what I have so far - https://youtube.com/watch?v=Cf3bJc0ggaA

It’s not a very exciting video, but it is progress haha. If you watch it, you can see where the ball bugs out at certain points… I can’t tell if it’s due to framerate drops or if the way I handle the ball collision screws it up.

So some of the things I’ve done so far:

**

  • Points for the walls are based off location within the game space. Eg. If the walls are placed high within the level, they are automatically given a point value of 500, medium = 300, low = 100.

  • I can set certain blocks to “high point” blocks, which switches the material and also uses their location as point value (just doubled).

  • A new ball will get spawned after reaching certain score milestones.

**

I want to add a couple more “features” to this little project before I move onto the next (Invaders probably) -

**

  • Add a front end / end game to the project. Menu’s that allow you to go into game and an end game that will hopefully display your ending score and will also store / display your hi score.

  • I want to add some sort of secondary “power” to the extra ball. I was thinking of giving the player the option to explode the ball and if it’s around walls, taking out the walls and giving extra points to the player.

  • Creating a couple of different “levels” (brick layouts) to help create some progression.

**

I know it’s not too fancy, but I’m slowly starting to get the hang of at least the base function of blueprints. With a heavy background in arts (but always wanting to build prototypes for game ideas / tools) Blueprints has been a fantastic way to bridge the gap.

Thanks for checking this out :slight_smile: More updates to come!

Great Job JasonLavoie! I love seeing what new users work on and how they approach the Editor for their first projects. I am a fan of the old school “Brick Breaker” style games. Keep up the fantastic work!

Hello Jason!

As someone who’s learning UE4 myself as an amateur, it’s really inspiring to see people in the industry sharing their work. Your pong blueprint is a great example that will definitely help me learn how to use the blueprint system. Thanks for sharing, I hope to see more soon :slight_smile:

Hi

I’m also an amateur and i try to do a Tetris Like Game in C++. I finally manage to do something. And after that i wanted to do a Pong, but in C++. Your example will help me for sure.
Kepp it up the good work.

Hey all!

I have a quick question that has been bugging me for a couple hours now. I’ve been looking through Answerhub and the Blueprint tutorials and I don’t think I’ve found the answer.

https://dl.dropboxusercontent.com/u/1514937/2014-07-24%2016_20_40-BP_Breakout_Ball.jpg

Currently I have it set so that when the player reaches certain score milestones, an extra ball is spawned (based off the Breakout_Ball blueprint).

Question -
I want it so the newly spawned actor is given a new color (a material override) how would I go about doing that?

I’ve tried a couple of different ways of going about it, but it always changes the main static mesh ball (the main game ball) and does not affect the spawned ball.

Any and all help is greatly appreciated :slight_smile:

Thanks all!

Hi Jason!

I think you want to take a look at creating Dynamic Material Instances.
That way, you can control the material parameters (such as the color, if you set it in the shader) though Blueprint at runtime.

Take a look at these great tutorials from Zak (in the Unreal YouTube channel):
Introduction to Materials in UE4 - 9 - Dynamic Material Instances, Part 1
Introduction to Materials in UE4 - 10 - Dynamic Material Instances, Part 2
Fun with Blueprints : Spawning Dynamic Objects

Hope that helps! :wink: