Opinions: Arquitecture of a Character on AAA Shooter game (or General) in Unreal and C++

Hello dear community.

This is my first post on this forum, and today i embark on one of my thoughest project yet, the development of a third person shooter game, wich envols mechanics, lets say, “standard” for a AAA shooter, such as “Uncharted” or (let’s keep it “Epic”;)) “Gears Of War”. I’m looking for examples from here and there, and all of them are ok (but still I feel there’s something missing), and I ended up looking at the Shooter Game project provided by Epic on the Marketplace. I believe is the best example i have found (at least for free), but taking a deep look at the c ++ examples, i find it kinda messy, to say the least, i mean, i’m not a fan that one of my c ++ code ends up whit more than a thousand lines (heck I even cry when ends up over a hundred lines), and the example is still a very basic character.

So, after so much writing, my point is to look for opinions, on wich could be good practice to tackle this matter, based on the Unreal Shooter Game, Is it ok to write almost all the logic of a character in a single c ++ file ? Is it better to divide it’s functionality on multiple components (Actor Component)? Should I manage inputs on a Player Controller or in the Main Character? I am aware that this is a very wide and ambiguous subject, but I find that talking about this matter will be good , not only for me, but for all the UE developers community.

Thank a lot.

Welcome to the forums then :slight_smile:

As you said this is a very wide topic. It always depends on your needs. for example if you have an inventory for multiple characters, I’d put it into a component so I can reuse it easily.
As for input, it depends on wether you can switch controls to a vehicle or anything else. Reusability is important and good but overengineering is very bad :wink: For me its easier to first do it quick and dirty but with a bit of extensibility in mind and later on rework it if its needed.

I’m a business software developer, and those habits carry over into my game development. As such I would say that best practices would be to not cram all your logic into a single C++ file. Object Oriented concepts work well in Unreal development and as such I would certainly look into those architectural patterns and divide your functionality out.