Mechanical Design


Player Movement 

youtube.com/watch?v=_QajrabyTJc 

 

Using Brackey’s tutorial I can weigh up 2 ways of creating character movement 

 

Character controller  

Rigidbody 

 

Handles steps 

Gravity built in  

 

Does not get stuck on walls 

Drag built in  

 

Easy to make snappy 

Interacts with physical objects 

 

 

 

Putting these points into a table allows me to make an informed decision on which movement type I want in my game. As I do not like the possibility of being stuck on a wall, I will opt to use the character controller.  

Melee system 

 

How to Build a melee system and what to avoid – 

 

Relative info found at https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc07/slides/S3736i1.pdf  

 

“Brutal combat, very physical! Realistic slow / tactical fights! Encourage player’s creativity by using the environment” 

Stated on this website is one major issue with first person melee systems. Inconsistent reactions with the world. Also provided is a fix for this issue. Multiple hit zones. These allow the sword to pass through them, but only apply damage within a set zone. This ensures that the weapon functions as intended.

Body awareness in the game – Camera management and conflict of hands/ shields with body.  

As stated in this picture, the camera, contact moves, FOV issues. All of these must be addressed when developing a melee system for a first-person game. I will have to carefully navigate all these things.  

As with any combat-based game, there is a combat loop, this is necessary for a successful first-person shooter/ melee title. These loops allow for players to regain concentration between fights. 

In my game, there will be a few seconds between each set of enemies, this ensures a solid combat loop but also lets the player regain positioning.  

How do you build a first-person melee system? 

 

Relative info found at https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc07/slides/S3736i1.pdf  

 

“Brutal combat, very physical! Realistic slow / tactical fights! Encourage player’s creativity by using the environment”

Stated on this website is one major issue with first person melee systems. Inconsistent reactions with the world. Also provided is a fix for this issue. Multiple hit zones. These allow the sword to pass through, but only apply damage within a set zone. This ensures that the weapon functions as intended.  

 

Body awareness in the game – Camera management and conflict of hands/ shields with body.  

As stated in this picture, the camera, contact moves, FOV issues. All of these must be addressed when developing a melee system for a first-person game. I will have to carefully navigate all these things.  

Hitbox Detections 

https://medium.com/nerd-for-tech/implementing-hitbox-detection-for-melee-combat-... 

Attack point 

“Create a new game object within our player that will represent the origin of the sword attack:” 

play the attack animation we will see that the point is at the centre of the attack: 

 

“In order to maintain order and simplicity when identifying the hitboxes, create a new layer for the enemies of our game:” 

 

Attack range 

“Next, in order to determine the range of our attack, let’s open the player script and create the next variables:” 

Attack point 

“This variable will store a reference to the attack origin Transform in order to know the position of each attack.” 

Attack range 

“This variable will determine the range of our attack starting from the attack origin.” 

 

“In case that we want to visualize the attack range, we can make use of our variables within the Gizmos.DrawWireSphere method at the OnDrawGizmos method:” 

 Jump 

With most PC games, the jump command is tied to the spacebar. This has become a unanimous feature of most games due to the spacebar being easily accessible for both left and right-handed players. For this reason, I have decided to have my jump command implemented in the same way. 

Enemy Movement 

Currently my enemies do not have any movement tied to them. If I had a bigger time scale and could create my project exactly as I envisioned, the enemies would chase the player around the map once a predetermined radius has been breached. If the player manages to break line of sight (LOS) the enemy would return to a neutral state.  

Enemies 

 

In my game there will be 4 enemy archetypes each with their own statistics. This comes from my own knowledge due to playing games like Genshin Impact. In this game there are many elemental and general enemy types however, elemental enemy types will not feature in my game for time constraint reasons.  

 

<span class="TextRun SCXW246482903 BCX0" <the="" four="" types="" of="" enemies="" in="" my="" game="" are="" listed="" below.<="" span="">>span class="EOP SCXW246482903 BCX0" data-ccp-props="{}"> </span>

 

  1. Pawns – Slow movement – low damage – TTK (Time to kill) – 2 hits 
  2. Jockeys – Medium movement – low damage – TTK – 4 hits 
  3. Shield bearers – Medium movement – Medium damage – TTK – 8 hits 
  4. Brutes – low movement – High damage – TTK – 10 hits 

Roaming enemies: 

Unlike previous projects, I will hopefully be using the nav mesh in a way that allows enemies to move around a specific area and only chase the player once a distance barrier is breached. 

Player movement 

As my game will be played on PC, the movement controls will be as follows: 

 

Right-handed players:  

 

Forwards – W 

Backwards – S 

Left – A 

Right – D 

 

Jump – Spacebar 

 

Mouse - Right hand controlled 

 

Mouse Left click – Attack 

 

Left-handed Players: 

 

Forwards – Up arrow 

 

Backwards – Down arrow 

 

Left – Left arrow 

 

Right - Right arrow 

 

Jump – Spacebar 

 

Mouse – Left hand Controlled 

 

Mouse Right Click – Attack 

Weapon damage 

A sword will be the players main weapon and will deal 40 damage to enemies or environment. My issue is where the attack point is positioned on the hammer. For this I have 2 options. Either have an attack point on the player and have 2 attacks, or 2 attack points. Upon questioning this and asking people around me, the best option is a single attack point and have anything within the radius gain damage.  

 

Player attacks 

Ground slam - A powerful ground attack triggered by right mouse button press, deals 40 damage. 

 Quick attack – fast and slightly weaker attack triggered by left mouse button press, deals 30 damage. 

 Player health and enemy attacks 

Like the enemy, the player will also take damage upon contact with the enemy's weapon. The player starts with their health at 100% and it will decrease by 20% on each connection with the enemy's weapon. 

Nav mesh 

Nav meshes are used to digitally map a specific area and can pick up structural data aiding in the visual representation of walls or other obstacles. And in the case of videogames, Nav meshes are used to both inform Unity of the enemies or obstacles as well as enabling the enemies to move around. 

Building a Navmesh... 

Building a Navmesh  ( docs.unity3d.com/Manual/nav-BuildingNavMesh.html) 

Using the Unity website, I can read into how a nav mesh is built, from baking a navmesh to adding navmesh agents and obstacle avoidance. This website will allow my understanding of meshes to improve. But also allow me to explore its use in current work.  

Baking a navmesh  

Baking a navmesh means that you define what surfaces are walkable for the Navmesh agent. 

 What is a Navmesh Agent? 

 

Nav Mesh agent components help you to create characters which avoid each other while moving towards their goal. 

 

Combining Navmesh agents with the navmesh component allows geometry data to be processed and any enemies baked onto the mesh will be able to walk around on that area. 

Nav system capabilities 

<span class="NormalTextRun SCXW246482903 BCX0" <the="" nav="" mesh="" can="" <="" span="">identify walkable areas for AI as well as finding and following pathways between points. In addition to this Nav meshes can avoid obstacles in and around the scene.</span> 

 

 

 

 

 

 

  

 

 

 


 

 

 

 

Get Thunderclap

Leave a comment

Log in with itch.io to leave a comment.