Making a ladder for our castle towers. Week 3 and 4

My Task

Over the next two weeks I tasked myself with making the ladders work in Unreal Engine 4 so that we can access  each individual floor of the towers. The project took around 40 minutes to complete and I believe came out very well.

Firstly I had to start with making an actor out of the ladder static mesh we had created in Maya:

As you can see the box collision is larger than the actual ladder so that when the player has climbed up the ladder they can access any ledge without any glitches, this is going to make the transition between floors much smoother.

The ladders work by pressing the E key which I had to program to make the character fly but only in the box collision to give the player controller the feeling that they are climbing the ladder. To do the code many changes had to be made to the base firstpersoncharacter blueprint in Unreal Engine 4.

These were the changes I made –

This included adding 2 variables to check if the player is on the ladder and if they were near it which allowed them to climb.

After this I made the ladder actor and added these commands –

These checked if the player was on the ladder and if they were it would make them fly up to the top of the box collision.

This concluded the creation of our ladders.

 

 

 

Particle Systems

What Is a Particle System?

A Particle system is a technique where hundreds/thousands of very small sprites, 3D models or other graphics are combined to create special effects. Every videogame uses this one way or another as a way of displaying visual information, they can do this through colors etc, e.g red being hurt and green being health.

How I made Mine

Our task was to make a particle system that could be used to signify health for players, here is my design –

To do this I had to create many different materials (sprites) which i spawned hundreds of in smaller sized which when combined together gave me the floating effect of all the small particles. Instead of making them spawn in a straight line I had to set it so that they could spawn anywhere within a pixel radius, this was hard to match to the outline of the circle as the radius was in a square shape so I had a few particles outside of the edge.

This is a screenshot of my effect being created in Unreal Engines Particle system editor.

 

Where/How/Why are they used?

Particle effects are in essentially all video games whether it be pick-ups, smoke grenades etc.. They are a very good and easy way of making these as it gives the creator full control on what they want to create as they can use their own assets to create something completely unique.

Examples Of Particle Systems In Games

League Of Legends is a great example of where I can show particle systems because of all of the champion abilities that you can use, here we see a spinning attack, toxic gas, death effects, healing effects and shielding effects.

The effects used here are very colorful and you can distinguish which each one represents, healing being green and any harmful ability being a darker color.

Adding Consumable Loot

Today in Unreal Engine we looked at creating useful loot which drops after a target is killed.

To do this we created a new blueprint actor which we called loot and assigned any static mesh as a placeholder, we then added a collision box which allows it to interact with the player. From here we accessed its blueprints to tell it to add 30 to the players max ammo when it is walked over and then to destroy itself.

To make it drop from the target we opened the targets blueprints and created the string of code that when its destroyed it will drop the loot in the air in a random direction.

Creating A Custom Health Bar.

Today I created my own health bar which is in the shape of a heart, to do this I used photo shop to create an outline and a fill image of the heart which would gradually go from fill to outline depending on the damage you take, I saved my images as PNG’s with hidden backgrounds so that it is transparent once I imported it to Unreal Engine.

This is my completed health bar in game.

Creating My Blueprint Actor and Working Flashlight In Unreal Engine 4 (Horror Game Part 2)

Battery Actor and Blueprint –

This is my Battery actor and blueprint, every time the character collects the battery it will disappear and add 0.4% battery life to the torch to a maximum of 1.0.

I added a box collision the the static mesh which then triggers the set of blueprints when the first person character enters it.

Working Flashlight Blueprint –

I added a spotlight component to my first person player to give my flashlight the actual light. It works on the basis of battery life, if it reaches 0.0 the torch will not function. The blueprints will check over the amount of life left to determine if the torch will turn on or not.

I set it to use the F key to toggle on or off.

Lighting In Unreal Engine 4

Today we were looking at lighting in Unreal Engine 4.

We are doing this so that we can create a short horror puzzle game set in a small maze like map. Lighting is a large part of horror games and so learning how to create flickering lights and different intensities of light will assist us in giving our map a more horror like feel.

 

Actors in Unreal Engine 4

An actor is a type of object which can be given a set of instructions to follow, an example of an actor would be a static mesh actor. Here is a static mesh actor I made of a door, this is an interactive door which when you have the matching key card it will open.

Above are also given instructions to the actor to allow it to open when the first person player has the required key-card.