Adding NPCs is pretty easy! In the Project panel, look for the NpcSpawner prefab, in Prefabs > Spawners. Drop it anywhere in your scene. Let's try grabbing the prefab and dropping it in the Scene viewport, on top of your plane.
I'll review all the settings in the Npc Spawner. You can leave these all on their default values to get random enemies.
Spawn At Start
If checked, the NPC will spawn as soon as the level loads
Npc Type
Determines the NPC that will spawn
For now, all NPCs share most stats
Override Skin
This can make an NPC spawn with a given skin
This is useful only to modders who have made skins for NPCs
Override Stats
Let's you define some stats for this NPC that will override the default stats
You can do this in a similar way to the player equipement. Create > Game Stats > Doru Stats
Will only use appearance stats
Ai Type
Wander
Will make this NPC walk around randomly
Guard
Will make this NPC stay still in its starting position
Waypoints
Will make this NPC walk following pre-defined waypoints
Waypoints Behavior
Once Then Wander
Makes the NPC switch to Wander when completing its waypoints
Useful to make the NPC go to a pre-defined point when spawning
Once Then Guard
Makes the NPC switch to Guard when completing its waypoints
Useful to make the NPC go to a pre-defined point when spawning and guard it
Ping Pong
Makes the NPC go back in reverse order when completing its waypoints
Useful for a linear patrol route
Start Over
Makes the NPC start from its first waypoint when completing its waypoints
Useful for a circular patrol route
Random
Selects waypoints at random
Always Walk To Waypoints
Whether this NPC will only walk when moving through its waypoints, or if it will run when the distance between them is long enough
Walking is good for NPCs that are patrolling
Weapon
Determines the weapon the NPC will spawn with
Unarmed is currently not supported
Override Weapon
This is an internal property that has no use for map makers
Faction
Determines the allegiance of this NPC
Orchid Rain Corp
Enemy to the player
Enemy to Cruz Institute
Cruz Institute
Allied to the player
Enemy to Orchid Rain Corp
Monsters
Enemy to everyone else
Personality
Determines what personality should the NPC spawn with
Personalities give unique animations and voice lines to NPCs
Armor Spawn Info
Determines the chances of this NPC spawning with armor
Armor Sets
The type of armor
Right now the differences are only aesthetic
Armor Chance
The overall chance to get any armor at all
Chance for Head, Chest, Arms, Belly, Pelvis, Legs
The chance for each armor module
Armor spawning has two phases. First its determined if the armor will spawn at all, depending on the "Armor Chance" value. Secondly, each armor piece will check if it can spawn, depending on its Chance value
Hair Overrides
Style
If a value other than None is selected, this NPC will spawn with the selected hair style always
Colors
Will make the hair have a specific color given
When more than one color is added, the hair color will be selected at random from the given color pool
No value given will make the hair spawn with its default semi-randomized color
Hat Overrides
NPCs are planned to have a chance to spawn with a hat. Currently, only Officers have hats.
Hat Chance
This value affects the chance an NPC will spawn with its corresponding hat
Skin Overrides
These values will affect the colors of the NPC
Skin Color
These are the pre-defined skin colors of the game
Each skin color has its own unique chance to appear on an NPC
You can force an NPC to have a pre-defined skin color regardless of its spawning chance
Colors
You can bypass the pre-defined values altogether by choosing colors here
Eye Colors
This will make the eyes of the NPC have the color of your choosing
You can add a component called Npc Spawner_Weapon Randomizer to the GameObject containing the Npc Spawner. This will let you define a list a random possible weapons for this character to spawn with.
Letting an NPC spawn with every possible weapon in the game can be a little too varied in some cases. Maybe you don't want the enemies in an area to spawn unarmed, or with another melee weapon, but you would still like to be some variation to their weaponry. This is why I created this new component. Just add as many items to the Possible Weapons list as would suit your needs.
Customizing NPCs is a lot of fun. Take your time playing around with all of those values at some point. For now, you can leave them all as they are for the moment. The only other thing we need to do is create a NavMesh, so that our NPCs can move around on their own.
NavMesh, short for Navigation Mesh, is a Unity technology that gives pathfinding capabilities to AI agents. In practical terms, a NavMesh is a surface that NPCs will walk on. NPCs need a NavMesh to be present on a level in order to function properly. Luckily building one is pretty easy too.
Create an empty GameObject (Ctrl + Shift + N) and look for a component called "NavMeshSurface".
In Include Layers, select only "WorldColliders". This will tell the Nav Mesh Surface component to make our NavMesh using only the objects in that Layer. After that, press the Bake button in the bottom-right corner of this component.
When you do this, you should see a blue area on top of your WorldColliders objects. That's the NavMesh! If you can't see it, make sure you have the GameObject with the NavMeshSurface component selected. As soon as you deselect it, the NavMesh will be hidden. Remember that the GameObjects not marked as Static will not be taken into account when baking NavMeshes.
Test your map now and see if the NPC spawns and is able to move around (even if it is to attack you). Save it first, and then build it.
The lighting is still not good, but your NPC should be attacking you and moving around.