How practical is it to use attributes for status effects?

I was planning on adding status effects system using attributes. In a way that I can really utilize the GetAttributeChangedSignal to trigger the status effects and such. It helps me save alot by having module scripts communicate with those attribute change signals.

I was mainly curious since I lack that knowledge as of now, would it be a good idea to use attributes like that with the signals as well? Is it efficient performance wise? And how well optimized can it be?

I’ll gladly listen to your recommendations and advice. Thank you.

1 Like

If your talking about effects like bleed or burnt those type, i would do attributes if your not planning on editing them later. For example if i had a ton of fire magics and they all had different flsme colours, i would make a module script called applyFire and pass colour as the variable. If thats not the case go ahead and use attributes. Performance wise it wouldnt really matter and i think attributes would be better in this case tbh.

2 Likes

Yes that’s right, effects like bleed and burn. I was thinking having attributes like Statuseffect itself and statusEffectValue possibly. I’m mainly worried about the limits of how much attributes I can use, as I really want to avoid lag or performance issues.

1 Like

If your really worried about too many attributes maybe modules are your way to go. Also you never know what your gonna do in the future. Better to go the way that is most customizable and versatile in the future.

Edit: thinking about modules are heavily better than attributes for customization. Example: you already have a ton of different attributes for different colour fire. Now suddenly you want to add a dirstion property. Instesd of going to the attriubte changed. You can edit it from the module and call the method whenever needed. Saves time + energy.

2 Likes

If you’re changing the attributes every couples seconds then it definitely isn’t best for performance. Could you please elaborate more.

2 Likes

Let’s say a player got inflicted by a burn and bleed debuff. I would have boolean attributes both called ”Burn” and ”Bleed”. And using GetAttributeChangedSignal, I would detect if they are set to true or not. Once they are true, they would run the corresponding debuff logic from a module script.

This is just an example because attributes seems to make my life so much easier with mechanics like these. Seems underrated if anything.

1 Like

You make a really fair point with customization. You changed my way of thinking to have the ”triggers” be the attributes, and the ”configuration” of these debuffs be within the module scripts.

2 Likes

This is clever, are you running the effects on the server or the client?

It will most likely run first on a localscript, to detect the attribute value change first, then it sends a remote event to a server script with the debuff logic. For the debuff parameters, I will probably be using a constants module script containing all the necessary values (like tick damage, tick time, etc.)

Any recommendations or advice for modification would be appreciated. I would love to learn best optimization methods and techniques.

1 Like