Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. NPC Factions
  4. NPC Resource Collector

NPC Resource Collector

The NPC Resource Collector is responsible for the collection of resources.

When creating a new NPC Manager object using the RTS Engine menu. The NPC Resource Collector is a component of the new NPC Manager’s “NPCResourceManagers” child object.

  1. Collectors: Drag and drop the unit prefabs with a Resource Collector component that you want the NPC faction to use as the main resource collectors. If the NPC Manager that this component belongs to is supposed to be used for different NPC types or different faction types then you can have units that play for those different types in this list because they will be filtered once this component is initialized (meaning only the units that fit the faction type and NPC type will be activated and used by the NPC faction). Make sure that units in this list have their regulator data correctly defined.
  2. Collection Settings: This defines the resource types that the NPC faction is allowed to collect. For each resource type, a couple of settings must be set:
    1. Type: Pick the name of the resource that is defined in one of the Resource Type Info assets that define resource types.
    2. Instance Collectors Ratio (between 0.0 and 1.0): This defines the ratio of the collectors that will be sent to collect an instance of this resource type to the available collectors slots.
    3. Max Collectors Ratio Range (between 0.0 and 1.0): This defines the ratio of the amount of collectors that can collect this resource type to the total amount of collectors available.
    4. Min Collectors Amount (Min 0): Allows to specify a minimum amount of collector units for this resource type. The NPC faction will prioritize assigning this minimum amount of collector units which ensures that resource types are being collected.
  3. Collection Timer Range (in seconds): Defines how often this component will check resources to collect.
  4. Collect On Demand: If other components request the collection of a resource, this field must be enabled in order for that request to be accepted.

How can we help?