v2022.3.0
Release Date: 08/20/2022
Changes
- FIX a bug in the FactionManager where a newly converted building does not get its amount updated in the faction manager's building type amount counter.
- FIX a bug where multiple worker entities with EntityTasksQueueHandler component are selected and are assigned a resource collection tasks queue command towards the same target resource entity where only one of the entities gets assigned the task.
- FIX a bug that disallowed the Builder component from spawning buildings that can be rotated during placement.
- FIX a bug in the MovementManager where a single unit movement task is triggered and the original target destination is valid which does not trigger the path destination logic and keeps the same input height for the original target destination and that does not always match with the heights that the unit is allowed to move through depending on the terrain areas it can move in.
- FIX a bug where the unit stops movement and its navmesh agent component still have a non-zero velocity which makes it continue moving for a bit more creating an offset between the unit's last position after the velocity hits zero and the unit target position marker assigned to it that stopped updating as soon as the movement is stopped by the UnitMovement component. The fix allows the unit target position marker to keep getting its position reset to the actual unit position until the velocity hits Vector3.zero.
- FIX a bug that disallowed NPC building placement logic from rotating buildings while placing them.
- FIX a bug that render resource health states unusable in case there are more than 2 health states defined.
- FIX a bug that triggers errors on the BuildingWorkerManager when the building first starts the placement process in case worker positions are statically set.
- FIX a bug that causes an endless loop within the TimeModifier component when some global timers have a near-zero timer duration.
- UPDATE ModelCacheManager to initially check for the visible terrain positions after the whole game starts running instead at the point when the component itself is initialized.
- UPDATE default music and SFX volumes in the new map configurations prefab to the maximum value of 1.
- UPDATE handling building placement failure errors with an appropriate player message for local player building placement.
- UPDATE MainCameraController component to only receive the main camera and UI main camera (optional) as inputs for its inspector fields while separating the rest of the fields and the behavior over individual main camera control handler components that all implement the IMainCameraControlHandler interface with three main groups of main camera control interfaces:
- IMainCameraPanningHandler that handles camera panning.
- IMainCameraRotationHandler that handles main camera rotation.
- IMainCameraZoomHandler that handles zooming in/out the main camera.
- UPDATE having the main camera follow a target entity with centering the camera position on the target entity depending on its height by either manipulating its height if it relies on the camera position to handle zooming or its field of view if zooming is handled the camera's FOV. This allows to avoid the issue where the camera is following a target air unit while the camera is zoomed in to a degree that is below the height of the air unit.
- UPDATE main camera rotation handling to enforce the initial rotation values when following a target.
- UPDATE main camera rotation to allow for rotating the camera on both the X and Y axis (horizontal and vertical rotations) with limits that can be defined for both directions using minimum and maximum Euler angles.
- UPDATE main camera rotation to restrict triggering it only after a threshold of mouse movement (that can be defined in the inspector) is reached when rotating the camera using the mouse wheel or the right mouse button.
- UPDATE peace time handling to only disallow attack faction entities that belong to a faction from attacking each other. Free (factionless) entities can now still attack faction entities and vice-versa.
- UPDATE initial reload time of an entity component target finder to be a low non zero value so that target finding can start (semi-)immediately when the game starts.
- UPDATE faction entity target components (builder, resource collector, healer, converter, etc..) and the unit attack component to check whether the position they can enable their component's progress at is free of any other unit target position markers (so after checking whether the faction entity is in range of its target and all other conditions allow to start the component progress, the additional unit target position marker is done). This is done to guarantee that units do not end up stopping before their actual movement destination on position that is planned to be or is already reserved by another unit.
- ADD the option to enable main camera panning by holding down and dragging the mouse wheel button.
- ADD the option to rotate the camera by dragging the right mouse button.
- ADD the option to enable the main camera to pivot towards a degree that can be chosen from the inspector when the camera's height reaches a range (defined via inspector as well) from the minimum allowed height. When pivoting is enabled, you can define the angle that will be assigned to the main camera and a backwards distance value that will be set when the minimum height is reached. Both the angle and backwards distance are updated smoothly until reaching the minimum height.
- ADD the option to define a control type (keycode) that when held down and the player is zooming in/out, the zoom would occur in the direction of the current mouse position instead of the middle of the screen.
- ADD a sample object with an AudioSource component to the new map configurations prefab to be used as an example for the Music Audio Source field in the GameAudioManager inspector.
- ADD Order Audio field to the ResourceCollection component inspector that can be defined for each resource type that the resource gatherer is able to collect. This audio clip is played when the local player commands a collector to start gathering a target resource.
- ADD a field to the main camera rotation handler that allows to reset the camera rotation to its initial values when local player building placement is active.
- ADD Ignore Layer Mask field to the BuildingPlacer component that allows to ignore colliders attached to game objects whose layers belong to the layer mask.
API
- REMOVE SetTargetFirstLocal method from the IEntity interface. The method used to allow to assign a target entity to the first IEntityTargetComponent that deems it valid that is attached to the source entity without going through the InputManager and hence a chance of having a desync issue in case this method is misused.
- UPDATE ScreenToWorldPoint method in the MainCameraController component to determine the world point coordinates using a raycast towards the base terrain and if that fails, revert back to the old way of directly accessing the ScreenToWorldPoint from the main camera instance.
- UPDATE GridSearchHandler to allow for IsPositionReserved method (which checks whether a range within a position has any unit target position markers) to include a field for a marker that can be ignored.
- UPDATE NavMeshBuildingObstacle to NavMeshEntityObstacle, BaseBuildingObstacle to BaseEntityObstacle and IBuildingObstacleHandler to IBuildingEntityHandler so that the component can also be attached to non-building entities (mainly resource entities) that can also have navmesh obstacle components.
- UPDATE the RemoveTimer method in ITimeModifier to allow for an additional parameter that disables calling the removeCallback when the timer is removed.
- UPDATE adding entity components to have the code be set by default to "entityCode_componentName_randomNumber" to avoid issues with having the same default code for multiple entity components on the same entity.
- ADD MousePositionDelta Vector3 property to the MainCameraController component which returns the difference between the mouse position in the current frame and the one from the last frame.
- ADD specific super interfaces for IMainCameraControlHandler that handle panning, rotation and zooming each with different properties and methods exposed regarding each type of main camera control handling.
- ADD IsRotating property to IMainCameraRotationHandler interface and fix a bug where rotating while in pivoting mode near min height does not disable pivoting mode.
- ADD a method to assign a new defaultValueRange value in a GlobalTimeModifiedTimer.
- ADD a method to assign a new DefaultValue value in a TimeModifiedTimer.
- ADD the GraphUpdated event to the IMovementSystem interface which triggers every time the navmesh (or whatever pathfinding system you are using, including A* Pathfinding Project) is updated by either adding or removing a navmesh obstacle component that is attached to a building or a resource.
- ADD the option to always enable or enable by holding down a key rotation around the position that the main camera is looking around.
- ADD the Can Place In Enemey Border field in the BuildingPlacer component to allow a building to be placed within an enemy faction's territory.
Documentation
- ADD a guide on setting up the main camera in a map scene that goes through the required components to handle its main camera panning, rotation, and zooming.
Modules
- Advanced Building Placement
- REMOVE the Disable Placement On Any Invalid field from the General tab of the Advanced Local Player Faction Placement component inspector.
- FIX a bug with grid placement where rotating a building during placement did not update the grid cells in its area and its surroundings.
- UPDATE handling building placement failure errors with an appropriate player message for local player building placement.
- A* Pathfinding System
- FIX a bug in Navmesh/Recast graph based pathfinding where the removal/addition of a new building or resource entity that has a NavmeshCut component makes any unit's movement stuck when the unit is within a certain range of the added/removed building or resource entity.
- UPDATE demo scenes for both Navmesh/Rect and Grid based pathfinding with entities from the demo game.
- Save System
- UPDATE saving and loading the time at which saved game slots are saved to use a global form to avoid unexpected issues that may arise when loading a save game slot file from a different machine.
v2022.3.0 Update Guide
- In each scene, navigate to the Cameras object under GameManager -> Essential in the hierarchy and set the fields for the updated MainCameraController component and the main camera control handler components that handle panning, zooming and rotation.