Question about best design for many character types
I am working on a game where there are multiple character types, like Explorer and Warrior and Woodworker. I can implement this in two ways - there could be a single BP_Character blueprint with variables (enums) for CharacterType, or I could have a separate blueprint for each type of character (BP_Character_Explorer, BP_Character_Woodworker). In terms of design patterns, what is the best approach? It seems like the one-character-blueprint approach would require a different AIController for each CharacterType, whereas the many-character-blueprint approach would allow me to define the behaveour in the event graph of each blueprint. Both would work, I am just curious, what do you think is the best approach? Thanks.
asked Jan 02 '18 at 11:45 AM in Blueprint Scripting
Hey there, it really depends on the complexity of each character type. If you have completely different movesets and skills and whatnot then creating a child class is the best approach imo. If they are rather similar then you can get away with the enum for the character type, which implies doing switches/ifs every place you want to distinguish the logic. The same logic applies to the AI Controller / Behavior Tree.
answered Jan 02 '18 at 11:53 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here