v2023.0.0
Release Date: 05/10/2023
Changes
- REMOVE all entity caching related components and fields. This decision was taken because the previous caching system did not offer any substantial performance improvements and put a lot of limitaitons on the users' freedom to manage the entity model objects within the entity prefabs. Please refer to the update guide below in order to see how the process of updating your entity prefabs can be made smoother.
- FIX setting the initial position of new building placement instance and having that initial position be tested against the placement conditions of the building.
- FIX a bug where DropOffSource component does not subscribe to the new faction slot related events after the unit entity attached to it gets its faction updated.
- FIX a bug in the RowMovementFormationHandler that does not allow any row formation to output.
- FIX a bug on BuildingAttack where position calculations refer to the game object where the component is attached rather than the parent entity object.
- FIX enabling the Move On Attack field on the UnitAttack comoponent to allow the unit to find a target and engage with it while moving.
- FIX a bug that resets the attack reload timer every time a new target is assigned to an attack faction entity while the attack launcher iterations of a previously active attack is still running at the time of assigning a new target.
- FIX a bug that prevents attack units from launching an attack command on an entity that attacked them when they are allowed to engage when attacked outside of their LOS but they have Auto Ignore Angle LOS disabled in their attack engagement options, even though the latter option is only relevant for attack commands that are resulting of the attack component auto target search.
- FIX a bug with the AttackLauncher where having more than two attack sources and setting the launch type to be in order would not work as expected as it gets stuck on the second attack source launch instead of moving forward in order as expected.
- FIX a bug where converting a building with a Broder component from faction-less (free) to being in a faction does not trigger the activation of said Border component for the faction it was converted to.
- UPDATE BuildingPlacer to ignore same faction units when testing for obstalce collisions during placement but instead move these units outside the building radius if the building was eventually placed.
- UPDATE selection groups to still work issue-free even when no control key is assigned to it.
- UPDATE launching an attack with a set of attack units to consider the movement priority assigned in the unit's movement components to determine what units will have their path destinations calculated first.
- UPDATE ObjectPool components to reposition the inactive poolable objects to a static position defined in the static class RTSOptimizations with the property PoolableObjectDespawnPosition.
- ADD the option to have NPC factions in multiplayer games. Only the host player is allowed to add NPC faction slots to a multiplayer game lobby and only they are allowed to set the color, name, faction type and NPC type of the NPC faction slot which will then get synced to all other clients in the lobby. When the host leaves, all the NPC faction slots are removed and the new host is then able to add NPC factions slots to the lobby. When the game starts and the host player leaves, the NPC factions are not removed and they continue being available as long as the game keeps going (as long as the host player is not also the instance that is running the server).
- ADD Require Drop Off Position field to DropOffTarget component. When disabled, the resource collector unit is able to drop off its target as soon as it reaches the radius of the faction entity where the DropOffTarget component is attached and specifying a fixed drop off position is not required.
- ADD EnableType field to ControlType asset file (which defines a control/key used to trigger an action). By default the enable type is set to hold, which means that the control type would be considered enabled when the player is holding the down key associated with it. The second enable type is toggle which means the control type is enabled every time the player clicks on the associated key.
- ADD Allow Multiple Terrain Attacks field to the UnitAttack and BuildingAttack component. When enabled, the attacker entity is able to consecutively keep launching terrain attack iterations until it is instructed to stop instead of just launching one iteration before stopping.
- ADD Attack Move Enabled field in the Rallypoint component. When enabled, created attack units will move towards the rallypoint with attack-move enabled so that they can target and attack enemy entities on their way to the rallypoint.
- ADD Allowed Resource Types field to the DropOffTarget component allowing to restrict what resource types resource collectors can drop off at each drop off point.
- ADD the option to assign a control type for the EntityComponentTaskUIData asset file so that a key can be used to enable a task in the tasks panel.
- ADD Place Audio field to BuildingPlacer which is prioritzed over the general building placement audio clip in the Building Placement manager inspector when it is assigned.
- ADD the field Pre Spawn Data to all object pool managers (including AttackManager, EffectObjectPool, MinimapIcon, HoverHealthBarUIHandler and any other component that inherits from ObjectPool). This field allows to pre-spawn an amount of the poolable objects in the map scene on awake so that when they are first required to be used, no latency is caused due to the creation of these objects.
- ADD Init Event and Deactivate Event to the EffectObject component which are invoked respectively when the effect object is created/initialized and the it is fulyl deactivated after it was disabled and the disable timer is through.
API
- REMOVE IsTargetValid(targetEntity, playerCommand) method from IEntityTargetComponent and replaced it with IsTargetValid(SetTargetDataInput) for all components.
- FIX triggering the building placement transform (position) updated event to happen after updating the placement status of the building.
- FIX updating the faction slot's entity count data structures when a faction entity is destroyed.
- FIX a bug in UnitMovement where the event for triggering a target update/set is not called.
- UPDATE health update events to use the value argument for the last max health value when the max health value is updated.
- UPDATE selection and deselection events arguments to include information on the type of selection (not selected, newly selected or already selected) or deselection (all, single).
- UPDATE SetPathDestination methods in IMovementManager to take a struct as its only input.
- UPDATE UnitAttack by introducing limitations on repetitive and unnecessary checks in the Update loop.
- UPDATE IEntityComponent and IPendingTasksHandler implementations to use lists to cache the UI tasks they serve to the UI components to reduce the effect on performance that creating and destroying lists to display tasks and pending tasks in UI elements has.
- UPDATE TimeModifier to initialize its collections with a capacity and include an option to only trigger a maximum amount of timers per frame. Both configurations can be set from the static class RTSOptimizations.
- ADD ClickableLayerMask and EntitySelectionLayerMask mask layer properties to IMouseSelector that expose the current clickable layer and the entity selection layer masks.
- ADD IsActive property to main camera control handlers to allow to turn the control handlers off and on from external components.
- ADD separate event that gets triggered when max health is updated instead of using the same event for both max health and current health updates.
- ADD IOptionalGameService interface that can be attached to a IPreRunGameService or IPostRunGameService so that when attempting to import the game service from another component, it would only trigger a warning instead of an error.
- ADD virtual OnClick method on the BaseTaskUI that includes the click type as parameter (in addition to the one without any parameters) so that it relies what mouse button was used to click on the UI task.
- ADD SetPosition method to IMovementComponent allowing to set the position of a unit whether it is idle or moving. This method should be used instead of directly setting the transform position of the unit as it perserves the unit movement properties and it allows for a clean repathing in case the unit position is changed when it is actively on a movement path.
- ADD InitialFactionEntitiesSpawner component which can be used to specify initial faction entities for each faction slot defined in the map scene using individual pre-placed faction entity instances in the scene, using parent objects with children containing faction entities, using faction entity prefabs and any combination of the latter options. The initial faction entities can also be filtered through NPC type and faction tpye of the corresponding faction slot.
- ADD IsResourceTypeValidInGame method to IResourceManager which takes a ResourceTypeInfo instance as its input and tests whether it is defined in the map scene or not.
- ADD FactionUpdateStart event to IEntity triggered before a faction update to the entity starts.
- ADD global event for when a IResourceGenerator component is initialized.
- ADD ResourceGenerators list property to IFactionEntity interface to expose all the resource generator components attached to each faction entity.
- ADD GetFactionEntitiesListByCode method to IFactionManager to allow to retrieve a list of all spawned faction entities of a certain code of a faction slot.
- ADD IsZooming boolean property to IMainCameraZoomHandler interface which is true whenever the player is actively zooming the camera in or out.
- ADD IsTransformUpdating boolean property to IMainCameraController which is true whenever the player is actively zooming, panning or rotating the main camera.
- ADD AttackComponents property to IEntity which composes a read only list of the IAttackComponent instances attached to each entity.
- ADD EntityEnterIdle and EntityExitIdle events to IEntity interface and updated the Entity component to monitor active entity target components to update its idle state instead of querying each component everytime the property is Idle is accessed.
- ADD ActiveFactionSlots read only list to IGameManager to allow to access the currently active faction slots during a game.
- ADD LocalFactionCount property to ISelectionManager which returns the current count of local player faction selected entities.
- ADD custom read only editor field that shows an entity is idle or not.
Documentation
- UPDATE all guides by including the changed inspector fields and their explanations.
- ADD Downloads section at the end of each manaul guide with a link to download the results of each individual guide.
Demo
- FIX barracks demo building prefab construction health states.
- FIX deleted scripts on map scene environment prefabs.
- UPDATE Terrain Attack Key, Attack Move Key, Multiple Selection Key and building placement Hold And Spawn Key to use the control type enabling so that they can make use of toggling or holding down the keys to enable their corresponding features.
Modules
- Mirror Multiplayer
- REMOVE legacy code handling for Mirror integration package.
- UPDATE the multiplayer game lobby to deny new clients when they join and the lobby has reached the maximum faction slots count for the current selected map.
- ADD support for NPC faction slots in multiplayer games.
- UPDATE all UI related components to use TextMeshPro instead of Unity Text.
- Singleplayer
- UPDATE all UI related components to use TextMeshPro instead of Unity Text.
- Mobile Controls
- ADD module.
- A* Pathfinding Project
- UPDATE grid graph demo scene to use a smaller size for nodes and updated the building and resource obstacle entity child objects layer and size.
- Save System
- ADD the option to choose between data path and presistant data path as the path prefix for the save files in the JSON based IO handler.
- UPDATE all UI related components to use TextMeshPro instead of Unity Text.
- Basic UI
- UPDATE all UI components to use TextMeshPro instead of Unity Text.
- UPDATE resource panel UI handler to allow for drawing the collector/producer count for the resource types that it displays in the UI elements.
- UPDATE the task UI handler to allow displaying the control type assigned to a task over the task's icon, in case one has been defiend for the task.
- UPDATE resource panel UI handler to allow to select the collectors/producers of each resource type when the player clicks on the resource type.
- UPDATE Basic UI task UI prefabs to have events hooked up through code instead of hooking up the event manually through the inspector.
- UPDATE BasicUI prefab to include each dynamically changed panel in its own canvas.
- UPDATE UI components to avoid unnecessary updates to UI elements.
- ADD a UI handler component that allows to draw the faction entities of the local player faction slot as UI tasks showing each unique faction entity type with its amount count and allowing to select all entities with each unique code through a click on the UI element.
- ADD confirmation buttons for leaving to the main menu from the map scene pause menu (optional).
- ADD UI handler component that draws the faction stats (name, ID and one resource type amount by default) in the faction's color and strikes the stats text in case the faction slot is eliminated.
- ADD UI handler with functions that allow to select local faction slot attack units and idle worker units and hooked those two functions with UI buttons.
- ADD the option to pre create multiple selection panel elements when the map scene is started.
- Basic NPC
- UPDATE NPC components to be more optimized, cache some of the queries they repeatdly 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.
v2023.0.0 Update Guide
Entity Model Connections
Step 1: Before Updating
Please make sure to back up your current project first. Then make sure to upgrade your project's Unity editor version to a 2021.3.15f1!
Before you importing the new update, download the entity field extractor package into your current project running the RTS Engine v2022.3.2.
In the RTS Engine top bar menu, select Update -> 2023.0.0 -> Step 1: Extract Entity Fields
This will create a JSON file that includes all of the entity prefabs model connections in it. You can find it in the project tab under the path: RTS Engine Update Handling -> 2023.0.0 -> Json unde the name fields.json.
Now export only this Json file into its own Unity package and delete the whole RTS Engine Update Handling folder.
Step 1: Post Updating
Now update your project by importing the 2023.0.0 update into it and import the entity field setter package package as well as the package that includes the JSON field created in the previous step.
While it is generally advisable to not modify the content of the RTS Engine folder and build your custom logic outside of it without modifying the core code, it is understandable that some cases in your projects require the RTS Engine to be modified. If you can delete the whole RTS Engine folder then import the update, that would be ideal. Otherwise delete all content of the folder under the path RTS Engine/Core/Scripts/Model except for CameraBoundariesToTerrainPositions.cs!
In the RTS Engine top bar menu, select Update -> 2023.0.0 -> Step 2: Assign Entity Fields
This will use the information in the JSON file to hook your entity prefabs after the update with the correct entity model assignments to its components. Make sure to check the entity model (or its child objects) assignments in your custom created entity components.
From Unity Text to TextMeshPro
The BasicUI module (which includes the default UI components used in the RTS Engine) as well as the UI related components in the singleplayer and multiplayer modules have been all modified to support TextMeshPro instead of Unity Text so please make sure that the UI components in the map scenes and menu scenes are updated accordingly. Informative errors should appear when a TextMeshPro field is not assigned to guide you to the corresponding component in the inspector where you can fix it.