Basic NPC Module
Includes components that track a NPC faction's progress then determines its behavior and its goals within a game, allowing you to predict the behavior using a set of inspector fields. The NPC behavior is eventually not an advanced one but a good starting point for your NPC factions.
- Manages and regulates the creation of NPC faction units and buildings according to some configurations regarding the amount and ratio among population.
- Manages all tasks that a regular faction must do including: building placement, building construction, resource collection, expanding territory, attacking enemy factions, defending from attacks, launching upgrades and more.
- RTS Engine 2022.0.0 or higher
Find it in the Core installation of the RTS Engine or get it from the Basic NPC Module and import it into your project.
A dedicated series of guides for NPC factions using this module can be found here.
Release Date: 03/01/2022
RTS Engine 2022.0.0 or higher
Release Date: 03/17/2022
RTS Engine 2022.1.1 or higher
ADD inspector debug field for the NPCUnitBehaviourManager component to debug the total amount, the pending amount and the idle amount of each tracked unit type.
- ADD inspector debug fields for the NPCAttackManager component that display the current amount of the resources defined for the Launch Attack Resources and Cancel Attack Resources.
Release Date: 03/29/2022
RTS Engine 2022.1.2 or higher
FIX updating the attack engagement order in the NPCUnitBehaviourManager component when an attack order is given while the delay on the last order is still running.
- FIX sending in attack, movement and defense commands to units in the NPCUnitBehaviourManager component by flagging them as player commands in order to bypass constraints imposed when these commands are launched from the corresponding units' components auto behaviors.
Release Date: 04/27/2022
RTS Engine 2022.2.0 or higher
ADD event logs for NPCUnitCreator component to log the status of each regulator creation request (for each unit prefab whose creation is requested to be handled by the NPCUntiCreator, it will log the result of the request: regulator created successfully, regulator already exists or unable to find a valid regulator).
Release Date: 06/15/2022
RTS Engine 2022.2.2 or higher
FIX a bug with updating active amount (created) and pending amount (where the creation task has been launched but not completed) of NPC units in the NPCUnitRegulator that keeps track of unit types and their count.
- FIX a bug that shows the winning menu for the local player when a NPC faction wins the game after the local player faction has been already defeated.
Release Date 01/24/2023
RTS Engine 2022.3.2 or higher
FIX a bug in handling territory defense for NPC factions where the defense state is enabled but no attack units are sent to defend the attacked faction entity
- UPDATE NPCBuildingRegulatorDataInput and NPCUnitRegulatorDataInput components' fields to make use of FactionTypeTargetPicker and NPCTypeTargetPicker data types.
- ADD the option to create a new NPC Manager through the RTS Engine top bar menu, which directly creates a new prefab in the project tab.
- ADD NPCTypeRTargetPicker target picker data type which allows to pick NPC types from the inspector.
- ADD custom editors for all NPC manager components.
- ADD inspector and event logs for all NPC manager components. This would allow you to see in real-time the decisions that a NPC faction is taking and what current entities/elements of the game each manager component is actively monitoring.
Release Date: 05/10/2023
RTS Engine 2023.0.0 or higher
UPDATE NPC components to be more optimized, cache some of the queries they repeatedly do, make use of new RTS Engine events to keep track of unit and building states and introduce new properties on entity regulator handlers that provide direct access to groups of NPC faction entities instead of launching a query each time.
Release Date 09/25/2023
RTS Engine 2023.0.2 or higher
FIX NPC faction logic to only consider launching tasks from UnitCreator, UpgradeLauncher and Builder components if the underlying components are in fact active.
- FIX a bug in the NPCUnitRegulator component where it does not unsubscribe from events successfully when it gets destroyed (when the associated NPC faction is defeated).
- FIX NPCDefenseManager custom editor script field "Cancel Territory Defense Reload Range" not showing up.