Sound of Life – Sensors, Materials and Widgets

Hallo everyone! in this post I’m going to talk about the gameplay in Sound of Life and what we need to make it work. I’m also going to talk a bit about widgets in Unreal Engine 4 and how we are planing to use them.

Lets start by explaining our gameplay. You play as a rescue worker and your job is to place sensors to try to locate people that are trapped underground. So the First thing I had to was to make the player be able to place sensors. I did this by activating an reycast at button press and the spawn an sensor actor on the point of collision if it collides. An impotent thing to think about when you spawn actors whit a static mesh component is to know where the objects pivot point is located. The actor will spawn at it’s pivot point so if it is in the center you will have half of what you asked for. After that is done you have to change it rotation so rotated in the right way, and with that I mean not always straight up.

So now when we know that the actor will spawn in the right place we have to make sure that the player know whats happening. this is done by spawning a ghost with the same mesh as the sensor so that the player can see where the sensor is going to be spawn. I also made two new materials, one green that is placed on the ghost when a sensor can be placed and one red material for the opposite. This makes the placement of sensors easier to understand.

But it is not enough just placing sensors, you want to be able to pick them up as well. So I added function that destroys a sensor if you look at it and press an button. It worked fine but now the game needed a way tell the player what he/she was looking at. The solution for this was to add an outline when the player was hovering over the object. The problem with this was that it was hard to see so instead we added a material that lerpt a colors transparency so it looked like blinking.

Now when you can see if you are looking at a sensor it would be nice to see where you are looking. So I added an crosshair in the center of the screen and after that I added an animation that will play when you look at an sensor. The crosshair is made in a widget and the widget is called on when you are hovering over the sensors. It is made out of four images that just changes location depending on which animation is playing. Creating an widget is one way of creating a HUD in unreal. This dose not work that good because it is animations so it finish one animation before starting the other. So this will be changed to work similarity to our crouch function in an later date.

sensors

Sound of Life – The beginning

Hallo everyone! My name is Emil Wahlund and I’m a member of the group !false and we are working on a concept called Sound of Life. In the game you plays as a rescue worker in an bombed city and your mission is to find people that has been buried under collapsed buildings. You do this by listening through sensors to try to pinpoint their location so that they can be rescued. I’m the lead designer in the group and also one of only two programmers. We are working in Unreal Engine 4 and the game is played in first person.

So now when everyone know the basics I can start talking about what I have been doing. The first thing we needed to have in our game was movement and we also had to decide what kind of movement. We decided to have a simple movement system, walking where the mouse is used for guidance and a crouch mode. Unreal provide a couple of templates and functions that contain different types of movement but they are not that good. They have a crouch function that set a new capsule and camera height but that does not contain a smooth transition.

So I started working on a new crouch function and it was more complicated then I first would thought. First I used a simple raycast to see if something was above the player. The player could not uncrouch as long as the raycast detected a hit. If nothing was detected the player could uncrouch and that would be done by a timeline so that the player got a smooth transition up or down. The problem with this was that the raycast was located at the top of capsule/player so it was a chance that player would get stuck if he/she stopped moving after an crouched area. The player could also not interrupter the transitions.

So I made a new function with help from our lead coder. The transitions are now updated by delta seconds so the player can now interrupt an crouching transition or an uncrouching transition. I also added more raycasts to reduce the getting stuck risk. Now all the raycast needs to return false to letting the player return to hes/shes original height. This work much better! the player does not get stuck often and it feels like you have more controller now when you can interrupt crouching. There are still some bugs where the player get stuck but that will be fixed in a later date.

B1