Using a namespace to hold NPC classes

I’ve never used namespaces before but if I understand correctly you can use them to organise classes into one neat file instead of having tons of scattered classes then just include the namespace in the scripts that use it.

Is it a good idea to place all the classes for NPCs in a single namespace? For different kinds of NPCs (humanoid, quadruped, avian, etc.)

It’s hard to give ultimate answer for such question. I use namespaces whenever I can, but I’m used to them after years of business development with thousands of classes in a solution.

If you want to have your classes stored in a more organized way, go for namespaces and additionally, keep your files in the appropriate folders. For example, if you want to keep your enemies in a namespaces YourProjectName.Enemies.Avian and YourProjectName.Enemies.Humanoid, then assuming you keep your scripts in Assets\Scripts folder, create the following folder structure

Assets
--Scripts
----Enemies      <- base enemy classes goes here
------Avian      <- flying enemies
------Humanoid   <- humanoids