How many branches are too many?

Hey there!
As someone relatively new to using BP and coding in general, I am attempting to create a project using only BP nodes, specifically to understand the power of them (I’ve heard mixed reviews on its complete capability regarding full-size game development). As I’ve begun the heavy scripting part of the project, I intend to create an ability system in which you can select your various abilities from a large pool, complete RPG style, all the while leveling up the chosen abilities.

My question then stands: How many branches are too many, and what would be the most proper way to create an ability system of this nature? My idea was to create 50 booleans, one for each ability, have each boolean assigned to a branch, which could be assigned a true or false value dependent on whether or not it is assigned to one of the action inputs. I would do this 4 times, one for each of the action inputs available to the player, and then have the 50ish abilities have 5 levels of booleans each, corresponding to the level the ability is at, with more branches changing each outcome of the ability dependent on its level.

I’d be looking at ~250 variables and ~1000 branches for a single character BP, not including the other various nodes placed for general movement, etc.

Is this too much code, or is this typical for the level of which I am trying to accomplish? How would it affect performance if at all? And is there a simpler way to complete this task?

I’m in school writing 20 lines of code for a single project, so I haven’t encountered what a complex coding project looks like or how much code it would generally contain. Thanks for the help! :slight_smile:

Hey buddy,

i would be careful with that as it sounds like a nested if statement situation. its going to be costly to work it this way.

BUT

The unreal engine has an ability system and it is very efficient.

it has a example project for you to get an idea of, it can be used with bp but there is a bit of C++ set up to do.

here is some good explanations/tutorials

Hope this helps

That’s not a good way to code it… :wink:

Why not make the ability system just a map with strings and ints. Like this, add ability:

297206-give.png

Take ability:

297207-take.png

Increase ability:

Has ability:

Something about it felt like I was doing too much. I figured there was a simpler way to do this. Thank you!

It felt like a bad way to code it! I wasn’t aware of the BP maps. I’m researching that now, but seems like a very organized approach. One question if you don’t mind; where would I be coding each ability to call? Would I be doing that inside the BP map or the character BP? Thank you again! You’ve been a huge help the past couple days! Lol

Inside the player, because it belongs to the player.

If you only have one player, no problem. If you have multiplayer, then you need to use player IDs and a save game to keep it organized :slight_smile:

Sometimes what we feel is less…or sometimes what we feel is more it is less in reality…