Introduction to Level Design - Page 1
We will be creating character skeletal animations and rigid body animations in UE4.
- Part 1 - Setting up
- Part 2 - Creating The Grey Block
- Part 3 - Adding Materials to Map
What you will need?
- If you are a student of mine in class you will have get a link on Moodle of this same repository and will view the invitation and press the Accept this Assignment button. Once this process is complete open Github Desktop and press File | Clone Repository and clone the
- If you are not part of the class you can login into github with your personal account and navigate to https://github.com/maubanel/UE4Blank and in the top right corner press the fork button:
- Navigate to the directory where you installed it. You will have a Source Files folder with all the files you need. There is a hidden .git folder that contains the database for all your files. There is a LICENSE file that declares the copyright and licensing terms. You can look at this if you like. The README.md file has temporary text that you need to keep updated. You should fill it in with relevant content as you progress through this walk through. You will only see the
.gitfolder if you have hidden folders turned on. All the rest of the files and folders are a default Unreal project.
- What you are getting is Unreal’s default third person template. It would have been the same as running Epic Launcher and starting a New Project with Third Person selected.
- Now double click on LSU_Third_Person to open the editor. Now your screen should look like this:
- Fill in the Description tab info in Project Settings while we are at it:
- Press play and lets see what we get? Run around using the WASD keys on the keyboard.
Tuning Default Settings
Now we want to tune the default settings of this template on the Third Person Character blueprint. We will make it more like a platform game.
- Now open the ThirdPersonCharacter blueprint that you find in Content | ThirdPersonBP | Blueprints | ThirdPersonCharacter.uasset. Make sure you are in the Viewport tab. Now click on the Camera Boom component. It is the parent of the camera. This acts as a spring so that when the camera collides with geometry it acts as a spring to keep the camera from going into geometry. This is represented with the red line in the editor.
- Select the Camera Boom component. Change the Target Arm Length to a number like
750. Then adjust the Target Offset Z value to a value like
218. Now the camera is above and further away but is not rotated facing the player. Lets fix that.
- Now select the FollowCamera component and adjust the Rotation Y to
345. This will pitch the camera down 15 degrees pointing towards the back of the player’s head.
- Run the game and run into the back wall to see that the spring arm stops (and the player sort of disappears). We will fix that in a later lesson when we dig more into blueprints.
- Run the game again and look how the arrow keys for left and right differ from the a and d key in the game. The AWSD moves the player and on the arrow keys left and right move the camera. Lets make them the same.
- The controls are defined in the project settings. Select the Settings button and go to Project Settings. Go to Engine | Input and open up the arrow next to Axis Mappings. Go to Left and Right under TurnRate and press the X to delete both of them.
- Now press the + (plus symbol) button twice to add controls for left and right. Add a Right keypress and set the Scale to
1.0and aLeft keypress with a Scale of
- Run the game again and now the arrow keys act just like the WASD keys and we are at parity. Try plugging in a controller to play it as well!
- Open up the ThirdPersonCharacter blueprint and select the CharacterMovement component. This is where all the adjustments for player physics is held. Let’s first change the gravity. We want a bit of moon like physics for Gravity. If you hover the cursor over Gravity Scale you will get a description of what it does. The most common type of setting normalizes between a range of 0 and 1. In this case 0 would be no gravity, 1 is earth gravity and anything larger than 1 will apply a greater gravitational force. Let’s make it more like the moon and set it to
- Press the Compile button on the blueprint and run the game. Now look at how the player’s gravity changes and he float more.
- Lets make a few more changes. Lets make our character run a bit faster. In the blueprint chnage the Character Movement: Walking | Max Walk Speed to
800. Play the game and tune the numbers to your liking.
- Now lets make the player jump higher and give the ability for the player to adjust his direction mid flight. In Character Movement: Jumping / Falling change Jump Z Velocity to
600.0and Air Control to
0.5. Play the game and tune the numbers to your liking.
- We will make one final change and have very snappy turning speed. We will adjust the Character Movement (Rotation Settings) | Rotation Rate Z to
1000. Play the game and tune the numbers to your liking.
- Play the game and make any changes to what I suggested. Get the player to move the way you envision a player should move in an arcady third person game.
Clean Up Content Folder
Lets organize the content folder for our project.
- We have two Meshes (geometry) folders. One in the Third Person folder and the other in the Geometry folder. Lets move the meshes from Third Person to the Geometry Meshes folder. Then delete the Third Person meshes folder. Force the delete if needed.
- Move the Blueprints and Maps folder from ThirdPerson to the roon Content folder. Then delete all the contents of the Third Person folder.
- Before we start a gray block level we need to create a test level to understand how our player moves and how high and far to make jumps. We also want to create ramps for players to run up and down. To do this we will create a test level just meant to test physics so we can get an understanding of how the player moves. Select the Maps folder and press File | New Level:
- Call it
- So we should end up with the PhysicsTestLevel in the Maps folder.
- Press Settings | Project Settings:
- Change the Editor Startup Map and Game Startup Map to
- Now press play and we should have the character controls we had previously with all of its logic. Press Save All and update Github by committing and pushing all the changes made. Next up we will start to figure out platform distances.