The NPC Building Placement component allows NPC factions to place their buildings, construct and look after them.
When setting up a map, make sure that each faction slot has a NPC Building Placement component.
- Faction ID: The faction ID that this component belongs to.
- Map Height: When buildings are placed by this component, their position on the y axis are set to this value. This value must be a little bit higher than the terrain’s position on the y axis in order for buildings to be always a bit over the terrain and not make it visible for the player.
- All Buildings: An array that includes all the available buildings for the faction to build. Only buildings that are not faction specific must be in included in this list.
- Building Center: The building used to expand the faction’s border/territory in the map (has the Border component).
- Population Building: The main building used to increase the maximum population amount when spawned.
- Drop Off Building: The main building that is used to drop resources at.
- Buildings Check Timer Range: Minimum and maximum values for the building check timer that checks whether the faction has some buildings requiring construction and therefore decide to send builders to these buildings.
- Delay Timer: Mminimum and a maximum value for a timer that allows for a more human-like behavior when the NPC faction places its building (in order to not make it instant but rather make the faction wait some time before placing the building).
- Move Value/Timer: NPC factions pick a building center (building with the Border component) and then places the building around it by rotating the pending building around the center and moving it away from the center (Move Value) periodically (period = Timer field) till it finds a suitable position to place the building at.