First off, I apologize if I’m not posting this on the right forum category. This is my first time using these forums, but I’ve been using Unreal for ~7 years so hopefully this question doesn’t come across as (for lack of a better term) noobish. I’m looking for the recommended approach (I’ll include the different implementation ideas I have) to implementing the described system, rather than a direct step-by-step tutorial.
I’d like to implement a weapon overheat system for a game built on top of Lyra. The concept is similar to the ammo system but with a few major differences. For reference, the system is very similar to Star Wars: Battlefront II (2017)'s overheat system. Here’s a basic rundown of the intended mechanics:
- After a number of shots, the weapon overheats, causing the weapon to not be able to be fired until the weapon fully cools down.
- Upon player input, the heat of a weapon can be manually reset by “venting” the weapon before it overheats, which, in comparison to overheating, results in less of a delay before the weapon can be fired again.
- After a certain number of seconds without being fired, the weapon starts to slowly cool down automatically/passively without hindering its ability to fire.
Ideally, the system should additionally meet the following requirements:
- The system should be optional for weapons, meaning weapons can fully function with or without using the overheat system.
- The system should be able to hold a number of configurable variables unique to each weapon (Heat Per Shot, Overheat Delay, Vent Delay, Passive Cooldown Delay, Passive Cooldown Amount, etc.) and ideally have these variables modifiable by gameplay abilities and effects.
- The system should be able to operate independently from the ammo system, working with a weapon that has finite ammo or infinite ammo.
- Current weapon heat should be a float between 0.0 and 1.0, rather than an integer value.
- Network friendly
I’ve come up with a few ideas for implementing this system, if I don’t include your recommended method feel free to specify it in the response.
- Option 1: Copy the ammo system. This is the easiest solution, I’ve actually already implemented this but I don’t like how it uses integers and doesn’t have configurable variables.
- Option 2: Make an inventory fragment (e.g. InventoryFragment_OverheatConfig) and a corresponding LyraAbilityCost class and probably some gameplay abilities for the passive components of the system. A drawback to this noncentral all of the data and logic is (if that makes sense).
- Option 3: Extend LyraRangedWeaponInstance. Probably the second easiest solution, but takes away from the modular aspect I’d like it to have.
- Option 4: Some type of gameplay effect?
- Option 5: Extend LyraGameplayAbility_RangedWeapon. Sort of a combination of options 2 and 3 as far as pros and cons are concerned.
Sorry if this was a lot, I just wanted to be thorough and love discussing gameplay features. I’d love to hear your feedback and ideas!