An idea for better performance

Can use “shouldUpdateModifiers”. If shouldUpdateModifiers = true, the system will recalculate modifiers each time the method is called. If shouldUpdateModifiers = false, the system will cache the results of modifiers at BaseStats.cs, and will never update.
Pros: many enemies with their stats and weapon, but they will never change their weapon or lv ups or maybe some changes happen but not frequently. So, in each frame, recalculating modifiers of many enemies is unnecessary, “shouldUpdateModifiers” can be set as “false” for better performance.

Or just use shouldUseModifiers = false for enemies like the tutorial video, shouldUseModifiers = true for player

My personal preference is to ignore shouldUseModifiers altogether and let the enemies gather stats, but my own game uses enemies that actually wear the armor that they have on (Modular Fantasy Hero), and if they happen to be wielding that Helmet of Ultimate Deus ex Machina, then theyr’e going to get the bonuses associated with it when you fight them. I’m not thrilled with the idea of caching state, personally, but I could see a good use case for this with characters that won’t change their modifiers…

It could actually be an interesting mechanic if you had items the enemies would be using and drop when defeated to your own disposal… Especially with some boss fight where you might find the enemy actually wasn’t that strong after all, but they had a really powerful artifact helmet.

1 Like

Privacy & Terms