Amerigo Moscaroli - Game Programmer
  • Home
  • University Projects
    • Eye-Snipe
    • Airport Mayhem
    • Star-Buck
    • HLSL Demos
  • Professional Work
    • Race Yourself - Glass (Beta)
    • Race Yourself - Mobile (Beta)
    • Race Yourself - Gear
    • Crazy Slots Adventure
    • Cops 'n' Robbers: World Tour
  • Tutorials
    • OpenGL ES Video Tutorials
    • Creating Cross Platform Games with Xamarin
    • Creating a 2D Platformer
    • Create and Monetize your C# Games on iOS and Android
  • Personal Projects
    • A Crack in Time - Dev Blog
    • Time Runner

Changing Character

2/26/2019

0 Comments

 
So I managed to get the character moving around, but now I need to get a character to attack with a sword. To do this, I've had to switch characters - so I'll show how I did that!

The model that I used came from a Patreon named Quaternius, he has some great low poly models that you can check out here.

First I imported the model into Unreal, drag the model in and in the dialog ensure that you select Import Animations under the animation tab:
Picture
Once the process is complete, the model should be available in Unreal.

The next thing I needed to do was to rework the animation blueprint for the new character. I decided to create a new blueprint rather than rework the existing one as it would be simpler to work it that way. However, I did base it on the previous one. For the run animation, I used a BlendSpace between the Idle, Walk & Run animations so that as the player's speed increases, it will change the animation as seen below.
Picture
Next I made the blueprint for the animation - this is essentially a copy of the other animation blueprint but with the new character's animations. 
Finally, in the character blueprint on the mesh component I changed the skeletal mesh and selected my new animation blueprint as seen below:
Picture
Now, if I play the game we can see the new character!
Picture
The next target for the project will be an attack system.
0 Comments

Character Movement

2/25/2019

1 Comment

 
Fresh start on a new project - it's always exciting! I'm going to use this blog post to detail how I set up the project & getting the character to move in the way that I want.

I created the project using the Unreal template for a top down game with C++. This gave me a bit of a head-start on the project, however the movement isn't how I planned it - the demo works by clicking where you want the player to move! I'll show how I switched it to keyboard & GamePad movement.

First, I'll need to add the input bindings for the movement. Go to Settings -> Project Settings, then scroll down the left tab to Input under the Engine heading. You should see something like this:
Picture
In here you can add the bindings for any input in the game. Action Mappings are used for input without a scaling value, such as a button press on a keypad, whereas Axis Mapping will provide you with a scaling value between 0 and 1 that can be used to scale the movement speed for example. I've added a new Action Mapping first for a Jump method which is triggered by the space bar or with the bottom face button on a GamePad - on an Xbox controller this translates to the A button. 
Picture
Next I added some Axis Mappings - these are used for character movement as I want my character to move slower if the analog stick is only slightly pressed. There were already some keyboard bindings in here, so I added a couple of bindings for the thumbsticks like so:
Picture
Now onto the fun bit - the code! The standard PlayerController that comes with the test project has a lot of redundant code that I didn't really need for my game, so I created a new one. It's quite a simple class, all it does is bind the input for the mappings defined above. Luckily the Pawn and Character classes have the functionality that I need, so when MoveForward/MoveRight are called I call GetPawn()->AddMovementInput and pass in the direction and the scale value. For the Jump method, I just need to call Jump on the character being controlled - the final class looks like this:
Picture
Now there's some basic movement working! However there were still some tweaks that I needed to do as the movement didn't feel right. First, the character looked like he was sliding around - to fix this, in the custom character class I set the ground friction to 300. This seemed to do the trick, however it may need tweaking in the future.

Next, I wanted a bit of movement in the air so that if the player tries to change direction while jumping it'll move slightly - this was another easy fix, on the character I set AirControl to 1.

Finally, the camera angle wasn't what I was after, I wanted it to be rotated down a little bit more. This was a bit trickier than it should have been, as something was changing my rotation of the spring arm component back to its default. This was due to the Blueprint of the character trying to set it back to the default - after setting the change in the blueprint the issue seemed to be resolved!

The end result looks like this:
Picture
In the next post, I'll explain how I switched the default player model into a custom one.
1 Comment

A Crack in Time (Working Title) - Intro

2/25/2019

0 Comments

 
​This game is my current personal project that I am working on. It is a top-down action game where the player must save the world through multiple time periods, and the player can use time-related powers such as stopping time in a small area around themselves.
There are going to be 5 different periods that the player will have to play through, which uses the same world map but with variations based on the time period - for example, in one time period there may be a small town but in the next time period this town has turned into a city. 

The game is being developed using Unreal Engine 4.21, and this page will be updated with my progress with blog posts that state how I achieved certain functionality.

The milestone I am working on at the moment is to have the character controls implemented. This includes:
  • Character movement & jumping
  • Attacking with a sword
  • Stop Time ability.
Once this milestone is complete I will be working towards defining & implementing more abilities that the player can use before implementing enemy logic.
0 Comments

    Author

    Software developer working on a game in Unreal Engine 4, this blog chronicles the development of the game.

    Archives

    March 2019
    February 2019

    Categories

    All

    RSS Feed