Project time frame: Jan - May 2019
|
Executable download: LINK
|
Project type: Coursework
|
Wall Climbing: The ability for the character to climb up certain walls.
Double Jump: The ability to jump again after the initial jump The Bow: The weapon that allows the character to shoot the arrows with the distance based on the charge time. In addition, the arrows deal different amount of damage depending on their impact area e.g. head and torso. Basic Enemy: Create a basic enemies to represent arrows coming into contact with them. |
Standard Arrow: A simple arrow that will attach on impact, deal damage or apply force if the hit target is a living enemy or an object respectively and act as a base class for other arrows to derive from.
Scatter Arrow: An arrow that ‘splits’ on the initial impact spawning 5 arrows that ricochet off walls. Sonic Arrow: An arrow that shows and highlights enemies and other weapons through walls Vacuum Arrow: An arrow that will apply impulse towards itself to all objects in a radius after the set time has passed. |
This is what defines the game character. In the attempt to imitate a functionality of a real bow, the arrows have to be manually "re-equipped" every time they are shot, this is achieved by making the object invisible and making it visible once it is "re-equipped", the further the arrow is pulled back the further and faster it will travel and during that create a visual representation by moving the arrow along the bow.
The user can switch through all the different types of arrows by pressing their corresponding buttons. When an arrow is changed, the colour of the arrow on the bow will change to indicate what arrow is selected. |
|
|
The scatter arrow will "split" into 5 arrows on collision. These arrows will then proceed to ricochet off any static object that is not simulating physics and is not an enemy. They will ricochet until they reach the ricochet limit, their lifespan timer runs out or collide with a physics object or enemy. The ricochet effect is achieved by taking the forward vector of the arrow and applying the formula of r=d−a(d.n)n where r is the final reflection vector, a is the angle of reflection, d is the forward vector and n is the normal vector of the collided object. The arrow will be automatically rotated to match the new vector thanks to the inherited rotation from the standard arrow. Lastly, to prevent the arrow from falling, the velocity is reset when it drops below the desired velocity. The trail effect is drawn by using the Unreal's DrawDebugLine function.
|
The effect of rendering enemies through walls was achieved by using an occlusion material with the help of a render depth pass. All objects, aside from the bow, will have custom render depth disabled. The arrow has a sphere component that enables and disabled custom render depth on enemies, by checking their tags, once they enter and leave the radius respectively. This all comes together once the Unreal Engine component, Post Processing Volume, is added and stretched across the desired part of the level to actually enable the ability to see through walls.
|
|
|
The vacuum arrow was designed to pull all objects that are simulating physics towards it. This process is done very similarly to that of the sonic arrow by using a sphere component to act as a trigger to see what objects are in its radius. Once the arrow collides and attaches to an object, it will begin to draw a green line in between itself and all objects in the radius and start a timer. However, a line trace is used to test if the line is being drawn through a non-physics object or not, This means objects that are in the radius but behind walls for example will not be affected. Once the timer runs out, it will apply an impulse to all objects towards the arrow by calculating a direction vector and multiplying it by the pull strength value. Once all objects have impulse applied, the arrow object will be destroyed.
|