Week 4 Development (Devlog)


Task Undertaken:

- The primary task for the week was integrating a series of new attributes for more weapon variants that utilise spread accuracy, number of projectiles and velocity adjustments. Working in tandem with Carter, he ended up creating a Shotgun prefab for testing purposes in order to get the spreadRange, projectileCount and velocity attributes working for the script. He also made a series of other testing prefabs that we collaboratively reviewed via discord.

- After he pushed his project, he allowed me to re-integrate the variables from the Shotgun script into the Weapon Base so that all weapons that were designed could utilise the projectileNumber and spreadRange variables for easy accuracy implementation and possible integration of complex weapons at a later point. The spreadRange checks the set number (For example 45) and sets that as the boundary rotation on all axes or the projectiles that are instantiated in a random pattern. The projectileNumber is overt and utilises the spreadRange for each projectile so that they can all move in the same generalised direction for the number instantiated. This was achieved using a For loop placed within the Fire method and functions even if there is a singular projectile being instantiated. The For loop reviews each projectile and and selects a random range from the Spread range boundary each time the weapon is fired and the FireRate timer is complete.

- The instantiation of projectiles was also changed to GameObjects instead of Rigidbodies which was then translated to Mitch's Bullet Prefab for testing. An updated version of that prefab with a new imported bullet model was created for testing utilising Mitch's bullet script that was easily accessible for my scene. 


Obstacles:

- Some complications arose with the Raytracing script I was trying to implement for more realistic weapon movement due to all assets that were imported being default rotations of 90 degrees which could not be altered. This resulted in the scrapping of this element due to it being superfluous.


Solution Reasoning:

- The key decision to implement additional attributes into the WeaponBase was decided because they added to the functionality to the all child classes and allowed for more unique 'Legendary' weapons that could use randomised stats at a later stage in the development process. The Accuracy (spreadAngle) and Bullet Count (projectileNumber) are quite standardised for most weapons in games also, therefore it was deemed a necessity to intgegrate them into the base class. Once again, the decision was based on code concision overall some other ideas were posed by Carter such as integration into individualised child scripts for user privatisation and limitation on editing which was tested a series of times. This ended up being problematic due to not being checked prior to the input as the abstract class was the base method.


- The change from Rigidbodies to GameObjects was done for 2 key reasons. 1 being that having the bullet instance within the scene attached to the projectileSpawn was a bit haphazard and untidy for the PlayerController when looking around. The second being oversight of a simplistic bypass for receiving the rigidbody data with the GameObject as a basis using GetComponent<>. This allows all of the physics elements to be returned and utilise proper collision and velocity for the Bullet prefab whilst not having to be present within the scene.

Leave a comment

Log in with itch.io to leave a comment.