1. Home
  2. Unity RTS Engine
  3. Buildings
  4. NPC Building Placement

NPC Building Placement

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.

  1. Faction ID: The faction ID that this component belongs to.
  2. 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.
  3. 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.
  4. Building Center: The building used to expand the faction’s border/territory in the map (has the Border component).
  5. Population Building: The main building used to increase the maximum population amount when spawned.
  6. Drop Off Building: The main building that is used to drop resources at.
  7. 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.
  8. 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).
  9. 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.

How can we help?