Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Game Development Projects with Unreal Engine

You're reading from  Game Development Projects with Unreal Engine

Product type Book
Published in Nov 2020
Publisher Packt
ISBN-13 9781800209220
Pages 822 pages
Edition 1st Edition
Languages
Authors (4):
Hammad Fozi Hammad Fozi
Profile icon Hammad Fozi
Gonçalo Marques Gonçalo Marques
Profile icon Gonçalo Marques
David Pereira David Pereira
Profile icon David Pereira
Devin Sherry Devin Sherry
Profile icon Devin Sherry
View More author details

Table of Contents (19) Chapters

Preface
1. Unreal Engine Introduction 2. Working with Unreal Engine 3. Character Class Components and Blueprint Setup 4. Player Input 5. Line Traces 6. Collision Objects 7. UE4 Utilities 8. User Interfaces 9. Audio-Visual Elements 10. Creating a SuperSideScroller Game 11. Blend Spaces 1D, Key Bindings, and State Machines 12. Animation Blending and Montages 13. Enemy Artificial Intelligence 14. Spawning the Player Projectile 15. Collectibles, Power-Ups, and Pickups 16. Multiplayer Basics 17. Remote Procedure Calls 18. Gameplay Framework Classes in Multiplayer

10. Creating a SuperSideScroller Game

Overview

In this chapter, we will set up the project for a new SuperSideScroller game. You will be introduced to the different aspects of a side-scroller game, including power-ups, collectibles, and enemy AI, all of which we will be using in our project. You will also learn about the Character animation pipeline in game development and see how to manipulate the movement of our game's Character.

By the end of this chapter, you will be able to create a side-scroller project, manipulate the default mannequin skeleton for our Character, import Characters and animations, and create Character and Animation Blueprints.

Introduction

So far, we have learned a lot about the Unreal Engine, C++ programming, and general game development techniques and strategies. In previous chapters, we covered topics such as collisions, tracing, how to use C++ with Unreal Engine 4, and even the Blueprint Visual Scripting system. On top of that, we gained crucial knowledge of Skeletons, animations, and Animation Blueprints that we will utilize in the upcoming project.

For our newest project, SuperSideScroller, we will use many of the same concepts and tools that we have used in previous chapters to develop our game features and systems. Concepts such as collision, input, and the HUD will be at the forefront of our project; however, we will also be diving into new concepts involving animation to recreate the mechanics of popular side-scrolling games. The final project will be a culmination of everything we have learned thus far in this book.

There are countless examples of side-scroller games out there that...

Project Breakdown

Let's consider the example of the famous Super Mario Bros, released on the Nintendo Entertainment System (NES) console in 1985. This game was created by Nintendo and designed by Shigeru Miyamoto. For those who are unfamiliar with the franchise, the general idea is this: the player takes control of Mario, who must traverse the many hazardous obstacles and creatures of the Mushroom Kingdom in the hope of rescuing Princess Peach from the sinister King Koopa, Bowser.

Note

To have an even better understanding of how the game works, feel free to play it online for free at https://supermariobros.io/. A more in-depth wiki of the entire Super Mario Brothers franchise can be found here: https://www.mariowiki.com/Super_Mario_Bros.

The following are the core features and mechanics of games in this genre:

  1. Two-Dimensional Movement: The player can only move in the x and y directions, using a 2D coordinate system. Refer to Figure 10.1 to see a comparison of...

The Player Character

Almost all of the functionality that we want for our Character is given to us by default when using the Side Scroller game project template in Unreal Engine 4.

Note

At the time of writing, we are using Unreal Engine version 4.24.2; using another version of the engine could result in some differences in the editor, the tools, and how your logic will work later on, so please keep this in mind.

For now, let's begin creating our project in the following exercise.

Exercise 10.01: Creating the Side-Scroller Project and Using the Character Movement Component

In this exercise, you will be setting up Unreal Engine 4 with the Side Scroller template. This exercise will help you get started with our game.

The following steps will help you complete the exercise:

  1. First, open the Epic Games Launcher, navigate to the Unreal Engine tab at the bottom of the options on the left-hand side, and select the Library option at the top.
  2. Next, you will...

Features of Our Side-Scroller Game

Let's now take some time to lay out the specifics of the game we'll be designing. Many of these features will be implemented in later chapters, but now is a good time to lay out the vision for the project.

Enemy Character

One thing you should have noticed while playing the SuperSideScroller project is that there is no enemy AI provided to you by default. So, let's discuss the type of enemies we will want to support and how they will work. Our SuperSideScroller project will support one enemy type.

The enemy will have a basic back-and-forth movement pattern and will not support any attacks; only by colliding with the player Character will they be able to inflict any damage. However, we need to set the two locations to move between for the enemy AI, and next, we will need to decide whether the AI should change locations. Should they constantly move between locations, or should there be a pause before selecting a new location to...

Steps in Animation

To be clear, this book is not going to cover animation. We will not discuss and learn how to make animations using 3D software tools such as 3D Studio Max, Maya, or Blender. However, we will learn how to import these assets into Unreal Engine, use animation assets inside the engine, and use the animation toolsets available to bring our Characters to life.

Character Animation Pipeline

For the purposes of this book, we will only be concerned with 3D animation and how animations work inside Unreal Engine 4; however, it's important to briefly discuss the pipeline used in many industries to create a Character and its animations.

The Concept Stage

The first stage is developing a concept of the Character that we want to create and later animate. This is almost always done in 2D, either by hand or through the use of a computer using programs such as Photoshop. It makes the job easier for the 3D modeler to have several references for how a Character looks, and the relative size of the Character, before starting the process of modeling. Below, we see a basic example of a stick figure Character in different poses. Notice how the Character is posed in different ways:

Figure 10.7: A very simple example of a 2D Character concept

The 3D Modeling Stage

Once the Character concepts are complete, the pipeline can...

Animations in Unreal Engine 4

Let's break down the main aspects of animations as they function inside Unreal Engine. More in-depth information about the topics in this section can be found in the documentation that is available directly from Epic Games: https://docs.unrealengine.com/en-US/Engine/Animation.

Skeletons

Skeletons are Unreal Engine's representation of the Character rig that was made in external 3D software; we saw this in Activity 10.02, Skeletal Bone Manipulation and Animations. There isn't much more to skeletons that we haven't discussed already, but the main takeaway is that once the Skeleton is in the engine, we can view the skeleton hierarchy, manipulate each individual bone, and add objects known as sockets. What sockets allow us to do is attach objects to the bones of our Character, and we can use these sockets to attach objects such as meshes and manipulate the transformation of the sockets without disrupting the bones' transformation...

Summary

With the player Character Skeleton, Skeletal Mesh, and animations imported into the engine, we can move on to the next chapter, where you will prepare the Character movement and UpdateAnimation Blueprint so that the Character can animate while moving around the level.

From the exercises and activities of this chapter, you learned about how the Skeleton and bones are used to animate and manipulate the Character. With first-hand experience of importing and applying animations into Unreal Engine 4, you now have a strong understanding of the animation pipeline, from the Character concept to the final assets being imported for your project.

Additionally, you have learned about topics that we will use in the next chapter, such as blend spaces for Character movement animation blending. With the SuperSideScroller project template created and the player Character ready, in the next chapter, let's move on to animating the Character with an Animation Blueprint.

...
lock icon The rest of the chapter is locked
You have been reading a chapter from
Game Development Projects with Unreal Engine
Published in: Nov 2020 Publisher: Packt ISBN-13: 9781800209220
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}