Week 6 Development (Devlog)


Tasks Undertaken:

- The primary tasks for the week was to integrate PlayerController and AI damage from the HealthArmorController script methods through the projectile Prefabs alongside trying to integrate DOT damage script that can apply to unique munition types for the expanded range of Weapon Prefabs created within the Project that utilise the supported projectile prefabs.

- Minor changes were required for Jamie's HealthArmorController script in order to properly allow the BulletPrefab to prioritize which bar (Health or Armor) should be affected when the projectile collides with the target.  A Boolean variable called amorActive was created to determine if the Health or Armor needs to be subtracted in the respective LoseHealth and LoseArmor methods. Utilising the boolean to create a conditional statement that controls when Health is truly allowed to be lost when armor reaches zero. The LoseHealth and LoseArmor methods where then directly referenced within the BulletPrefab script on collision and tested on the static AI in the scene functioning quite well.

- The process of creating a DOT damage script is currently incomplete, however is pushed forward to the following week task list. The methodology was to integrate a timer that subtracts Health or Armor on each tick with a newly integrated burnTimer and burnDuration variable set. The next stage was to create a condition checking a newly created boolean that states if the target is burning which discerns when the player takes damage and when the DOT damage is over. This was tested with both Coroutines, standard Loops (While, DoWhile) alongside sole boolean use throughout both the HealthArmorController script and BulletPrefab script which had varying reactions such as crashing due to infinite damage being done to the target or minuscule amounts of damage being done but functioning the same as the standard damage script. Through discussion a proposed solution would be creating a separate DOT script that is attached to the bullet which can then be added to a variety of other munition types and prefabs.

Obstacles:

- The primary obstacle was trying to enable the DOT damage through the FlameBullet prefab script which failed to function successfully, instead dealing no damage whilst still registering the collision with the rigidbody. More research is planned and a separate script is planned to be made to apply to a variety of prefabs that can be integrated into the FlameBullet prefab and future developed ones.

Solution Reasoning:

- The solution for referencing the HealthArmorController within the bullet prefab script was deemed the most concise and logical decision as predominance of the methods could easily be referenced and impacted by variables within the BulletPrefab script. The creation of a new boolean was used for rapid testing and happened to work ideally (In which Jamie was informed and had full influence as to how it may be optimized or possibly changed at a later stage for his coding syntax and conventions). Other viable  solutions that were considered  were relaying the information directly to the weapon so that the amount parameter could be assigned by the Weapon's Damage instead and then that information would be read by the BulletPrefab allowing for more varied damage amount for each weapon. This is believed to be a future integration from the WeaponBase script to align with the  Player Skill Tree System which is why it was delayed for now. Functionality of the HealthArmorController with the BulletPrefab tested with a variety of weapons which subtract the AI/Player's Armor and Health  and then destroys them.


- The DOT Damage script has been attempted to be implemented a variety of ways including:  Coroutines, booleans, and conditional loops. The flaw observed is that the collision is detected by the prefab however the damage is not being triggered due to the expected condition of the burnTimer. After reviewal and discussion, it is decided that the DOT Damage will be handled  in  a separate script which will handle the universal functionality of damage over time which can allow it to be applied to traps and other components of the gameplay. This will be further developed over the upcoming weeks alongside other possible munition types that affect the player in a variety of ways.

Leave a comment

Log in with itch.io to leave a comment.