Hello, I have a question about best practices for creating weapons in a game and whether or not to use Data Tables.
For context, I am creating a weapon system where there are Guns and Swords, and I am using the Gameplay Ability System.
Obviously, guns and swords are both weapons and share properties such as Damage, however Guns do not have Hitboxes and Swords do not have Ammo.
My original plan when I first started this project was to have a C++ WeaponBase class that stores an array of GameplayAbilities to be activated based on their GameplayTags such as PrimaryFire and SecondaryFire that would be granted and removed when equipped/unequipped. Then, I would have GunBase and SwordBase C++ classes that inherit from WeaponBase. The GunBase class would include additional features such as Ammo and the SwordBase would feature a Collider/Hitbox component. From there, my plan was to create child BPs of these two classes to create many Guns and Swords.
My questions are as follows:
-
Would Data Tables be useful to make the game design process better? My concern is that Swords’ hitboxes need to be individually adjusted for each weapon, which I feel necessitates them each having child BPs.
-
Does this negate the main benefit of DataTables, or would it still be useful to take a hybrid approach and have integer stats like Damage be in a Data Table while still creating lots of child BPs?
-
One idea I had to reduce the number of GameplayAbilities was to store Guns’ reload animations in DataTables and for the majority of generic guns use a generic “GA_Reload” that simply accesses the animation from a DT. Is this recommended?