NPC Factions are non-player-controlled factions which the local player can play against.
The creation and management of NPC factions will be covered in this part by going through a series of the components that regulate the NPC faction’s behavior.
In the following guides, unit, building and resource prefabs from the demo game will be used. So make sure you have the demo files in your project.
These guides are also based on the Basic NPC module which is a collection of components that manage a NPC faction's behavior. It is worth noting that you can write your own components that manage the NPC faction but starting with learning how the scripts in this module work should give you an idea on how you would eventually implement your own NPC handler components.
|Create NPC Type||Create a NPC type, NPC Manager and setup a map scene where a NPC faction slot uses the NPC type and manager.|
|NPC Unit Regulator||Create a NPC Unit Regulator Data asset file and assign it to regulate the creation of a unit type in a NPC faction.|
|NPC Building Regulator||Create a NPC Building Regulator Data asset file and assign it to regulate the creation of a building type in a NPC faction|
|NPC Unit Creation||Configure the NPC Unit Creator component to manage unit creations in a NPC faction.|
|NPC Building Creation||Configure the NPC Building Creator, NPC Building Placer and NPC Building Constructor components to manage creation, placement and construction of buildings in a NPC faction.|
|NPC Resource Colllection||Configure the NPC Resource Manager and NPC Resource Collector components to manage collection of resources for a NPC faction.|
|NPC Attack and Defense Handling||Configure the NPC Attack Manager and NPC Defense Manager components to manage the attack and defense beahviour of a NPC faction.|
|NPC Upgrade Manager||Configure the NPC Upgrade Manager to manage launching upgrade tasks in a NPC faction.|
|Other NPC Managers||Configure the NPC Capacity Resource Manager, NPC Territory Manager and other NPC manage components.|