Personal Blog Entry #3
Personal Blog Entry #3
100424776)
Last two weeks have been spent on complete rework of the game design and level design.
Tasks finished during the last two weeks:
1. Object outlining.
2. Climbing ladders.
3. Bug fixing and movement rework.
The movement has been reworked to feel more natural, for that some of the values of character’s
jumping and falling have been changed as can be seen on the screenshot below.
Figure 1. Movement rework. Removed Air Control and inreased the jump Z velocity.
I have also started to implement ladder climbing functionality. We do have a system that lets players
climb walls (vines), but I decided to work on my own solution for ladders.
Firstly I created an actor called “Item” to be a testing placeholder for the ladder. This Actor has a Box
Collider that I tagged as “ladder”. The blueprint for this Actor described what happens when player
overlaps with the box collider. See Figure 1.
Figure 2. shows that upon components overlapping the character's movement type is switched.
When the two components begin overlapping the type of charater’s movement is switched to “Flying”
which allows movement up and down, which is essentially what climbing ladders is.
When these components stop overlapping the movement mode is switched back to Walking.
The main logic for the climbing was created in the FirstPersonCharacter Blueprint which is the main
blueprint where most of the player’s actions are described. Figure 2 demonstrates what ladder climbing
looked like.
Figure 3. Ladder logic. Overly complicated version. Didn't make it to the final vers
It is impossible to see the nodes on the Figure 2 what the actual nodes were, but the way it was
structured was this:
By taking a reference from the camera I took a vector which served as a line trace. Tracing was meant to
determine whether the object the player is looking at is an actual ladder. After that there comes a bunch
of checks to see if the movement mode needs to be switched. I would go into more details, but it is not
necessary as this implementation was discarded later.
After the demo I started to work on implementing a much needed feature – object outlining. It is
quite important, because without it players won’t know which objects they can interact with.
Originally the intention was to make messages appear on screen when the player is looking at
interactable object. But I wanted to do a proper version when the object’s shape is outlined when
looked upon.
Figure 4. Outling logic. The nodes are small but I wanted to capture the scope of the feature as a whole.
The idea is the same as with the ladder climbing. There needs to be a trace of object to see which ones
we need to outline. The node “SphereTraceForObjects” represents a number of objects that we found
by tracing. Out of all objects we need only those of type “Interactable” a type created by me specifically
for the purposes of outlining. This also means that the “Collision Preset” of the object must be set to
“Custom”. To make the sphere tracer I created two variables – Range and Radius. I wanted to place it in
front of the camera at a certain distance. The camera’s world location serves as a starting point of a
trace. Then then forward vector is taken from the camera and multiplied by the “Range” variable thus
getting a distance at which we want to start detecting objects. The sum of the camera’s world location
and the forward vector multiplied by the Range variable gives us the end point of our tracer. Then I
created two functions: Start Trace and Stop trace, they are needed to turn on and off outlining when
player looks at one interactable object and then looks at another one and the previous object is no
longer outlined. Both functions take two parameters: New Actor and Old Actor. The materials that
actually represent visual outlining have been downloaded from a free source. The results can be seen on
the video:
Figure 5. Demonstrates finished outlining feature. This also works on more complicated shapes like flowers. The outlining color can
be easily changed.
After I finished outlining feature I returned to work on ladder implementation. This time I decided to
reuse the system that was already built in – wall climbing. Unfortunately, instead of working with
different types of movement this system overwrites normal movement, so the ladder climbing will be
done in a special way. The results can be seen on the video below, the feature is not yet finished, but for
now a player must press a button to start climbing and press it again to stop climbing. When climbing
you are only allowed to move up and down, movement to the sides is disabled compared to the wall
climbing. I need to make some sort of the conditions for getting over the top of the ladder and when
player goes down the ladder and hits the ground.