Is it any good idea to put 600+ "if branches" (no casting just for some simple variables) on 1 custom event ?

At some point, when all 300 traits are activated, you will check them all. But this way if you have no traits active, you only have 1 check.

Also, you could save the data of enabled/active traits and read it directly instead of recalculating every time. Depends on preference. This kind of thing shouldn’t be done every time the user opens the traits menu, it should be checked on load, stored, and updated on the widget so its always ready, and only change the necessary values when the user interacts with the skill-tree.

At least that’s a simple performance-friendly approach. Most of things that are complex or performance intense of data checks that can be done during game/map load are done like this usually, at the time when the user knows things are meant to take time and load.

Ultimately it’s up to you what kind of game you want to make, what approach you want to take and what’s an acceptable or unacceptable performance impact.

No matter what, at least once you’ll have to run through all skills to set the icon and state properly on the interface unless you have them set manually. Even then you’ll have to use some method to look through the skill list to “enable” necessary skill points. That’s why I suggest the “calculate on start-up/load and update only when necessary what is necessary” approach.

1 Like