Please Add Affiliation and Teams to Blueprints

Hello.

I am baffled by the largely C++ exclusive nature of the Detection by Affiliation feature of the AIPerception Component. As I understand the feature, it should help optimize a project by limiting perceived stimuli to only those that are relevant. The AIPerception Component includes Detection by Affiliation for each added sense. However the Team system and relevant Enum creation are limited to C++. The entirety of the project I am working on, including the relevant Characters, are in Blueprints. As such, I either need to convert existing parts of the project to C++ or utilize Tags instead. Both solutions are, in my opinion sub-optimal. Converting portions of the project to C++ has the potential to be a long and arduous task. Based on my understanding, Tags would still require the Character to process the stimuli, at least to a greater extent than the affiliation system would. In addition, the Tag solution has the potential to necessitate nested if statements.

My sanity may not be recoverable, but implementing this feature into Blueprints can still save the time of other Devs and spare them from headaches. (Please pardon my melodrama, it’s mostly for laughs.)

I will also note that it might be worthwhile to look into optimizing the usage of Tags separately. Even if it wouldn’t improve performance, a special Switch on Tags Flow control Node that can accommodate one or more tags within each case would at least help the code to look cleaner.

Making a blueprint based affiliation-type system isn’t that hard. Give all your pawns an enum var named team/faction/whatever (or just use an int and keep good notes lol) to assign their group. Then make an interface function which gets the team, call that via message when perception updates, and compare it to the controlled pawn’s team (or duplicate team to controller on possess) and decide how to react. I’m doing something like this and using a data asset to setup group affinity with a -1 to 1 float, feeding that to a weighted random bool (so a blue team might almost always attack red, while purple might ignore red and blue, and friendlies might even attack each other sometimes if the RNG gods are in a bad mood), the function comparing faction returns a bool and the perception update event branches off it to set a target for behavior tree to attack and such.