Monday, September 19, 2016

FPS Tower Defense Toolkit v1.8 Dev Log #2: Focus Fire System

The upcoming v1.8 update for FPS Tower Defense Toolkit will introduce a Focus Fire system that enables the player to request all relevant towers to focus fire on a designated target. This system is driven by a component based approach, thus facilitating easy integration into any new towers that maybe added in the future.

The Focus Fire component will be added to the Laser Tower, Machine Gun Tower & the Sniper Tower by default as these are the three towers capable of focusing on a single target. Along with the associated Manual Target Override interface, this component serves the purpose of overriding any active target & focusing on a new target specified by the player, provided the target is within range.

The Tower Manager will keep a record of all actors that support manual target overrides & also acts as a conduit through which focus fire orders from the player get relayed to the relevant actors.

With this new system, the player will be able to play a more tactical role during the combat phase of the game. There are still a few more relatively minor changes to be implemented in the next update. More details will be made available soon.


For more details about the toolkit, check out the official Unreal Engine forum support thread at: https://forums.unrealengine.com/showthread.php?79300-FPS-Tower-Defense-Toolkit

Saturday, September 17, 2016

FPS Tower Defense Toolkit v1.8 Dev Log #1: Improved AI systems

The creep AI logic in FPS Tower Defense Toolkit is primarily driven by a set of timed distance, angular, & trace based checks. It provides the designer with complete control over editing the visual range parameters as well as the underlying workflow. However driven by an inheritance based approach, the system had issues with code modularity. For example, the Core Bomber class had no threat detection capability unlike the the Melee & Ranged classes, thus leading to either code redundancy or the requirement for more vertical layers of inheritance. As a result, adding more creep classes in the future might require a lot of unnecessary work. Fixing this potential issue is the main focus of the v1.8 update for FPS Tower Defense Toolkit.

The new & improved AI design in the upcoming update is primarily driven by a move to component based design that allows the creep classes to have different levels of threat detection capabilities. The four components that make up the new threat detection system are:

1. Visual Perception component: This component uses a combination of distance, angular, & line trace based checks to provide the parent class with information about it's spatial relation to all potential targets.

2. Damage Perception component: This component keeps track of incoming damage from all potential targets & relays the information back to the owning actor. It is also responsible for controlling the relevance of damage inflicted over a long period of time. This allows the owner to focus on the immediate threat instead of focusing on an actor that may have inflicted some damage 30 seconds ago.

3. Threat Analyzer component: While the previous two components focus on gathering data, this component focuses on retrieving the aforementioned data & evaluation of potential targets based on it. It also allows the designer to specify the relative importance of visual perception weightage vs the damage perception weightage for the parent actor. For example, if you want a creep that generates more aggression toward damage causing agents than closer targets, it's as simple as improving the maximum weightage of the damage perception while reducing the same for visual perception within this component. The component also makes sure that the active target gets special preference over other targets to prevent the parent actor from rapidly shifting focus between targets based on weightage changes. The evaluated results are passed on to the parent actor through it's associated interface functions.

4. Threat Response component: This component comes into play once the parent actor has acquired an active target. It determines whether to move to/attack the active target based on the distance to it. The final decision is then relayed back to the parent actor for execution. For example, an attack order to melee parent actor would be executed in a different manner when compared to the execution by a ranged parent actor.

Even though I've mentioned that some of these components take in data obtained from other components to perform their functions, it does not mean that they are interdependent. The components are not aware of the existence of other components. They are only aware of their own existence as well as that of the owning actor. Any information that is being relayed between these components happen through the parent class & interface functions. This facilitates creation of new creep types with different combination of components [along with their associated interfaces]. For example, both the melee & ranged creep classes will now be equipped with all 4 components by default, while the corebomber class will only use visual perception component in conjunction with some custom logic in the parent class tailored to it's requirements. Similarly if you do not want a certain type of creep to not respond to damage causing agents, just add all components & interfaces excluding the ones related to damage perception.

The update also adds a new Creep AI Manager class that keeps track of all potential targets for the creeps, thus freeing them to only focus directly on the targets. It gets alerted everytime a potential target has been spawned or destroyed anywhere in the map. The Creep AI Manager then relays this information to all relevant creep actors in the level, so that their target weightage information always remain up to date.

With this new system, creation & maintenance of creep AI should be a much more convenient process than it is right now. Plus the introduction of a weightage system paves way for inclusion of companion bots in the future updates. There are a few more notable changes making it into the v1.8 update. More details will be made available soon.


For more details about the toolkit, check out the official Unreal Engine forum support thread at: https://forums.unrealengine.com/showthread.php?79300-FPS-Tower-Defense-Toolkit

Tuesday, August 9, 2016

Tower Defense Starter Kit v1.4 Dev Log #3: Global Abilities

The Tower Defense Starter Kit is finally getting a feature that I've wanted to implement for quite some time: Global Abilities. Along with Tower Abilities, this will be the other major new feature that will be introduced with the upcoming v1.4 update. Going forward along a similar route as the Tower Abilities mentioned in an earlier post [check it out here: Tower Abilities], I'm using a component based approach for the Global Abilities as well. 

The major focus of the Global Ability implementation within the context of v1.4 update is to establish a system that can be easily extended through subsequent updates, while introducing the first ability 'Airstrike' to demonstrate the working of the system. With the Airstrike ability, the player can now unleash a series of explosive strikes at the targeted location. Mechanically, it functions similar to the Meteor Strike ability in Kingdom Rush, relying on a cooldown based activation instead of the Tower Points. 

The new Global Abilities Array dynamically updates the list of available Global Abilities in the HUD, thus reducing the need to make changes to the HUD every time an ability is added or removed. As a result, the designer only has to handle the functional part when adding a new ability.

The new Airstrike Ability HUD elements

The Global Abilities use a new Targeting system that function separately from the default Grid Cell Detection logic. This targeting system does not interact with the grid based elements & conveys to the player if the focused actor is a valid platform for deploying the selected ability. Having the targeting reticule displayed on the target in world space helps convey the impact location & depth more clearly than the default cursor based reticule that is displayed on screen space.

And finally here is a short video preview of the Airstrike in action: [My video creation/editing abilities are really bad, but I think it will atleast serve to demonstrate what's mentioned in the post]


As mentioned earlier, this update aims to create a system that will make it easier to add more abilities. Hence more cool abilities will be making it into the toolkit in future updates.


For more details about the Tower Defense Starter Kit, check out the official Unreal Engine forum support thread at: https://forums.unrealengine.com/showthread.php?102675-Tower-Defense-Starter-Kit-Support-Thread

Wednesday, July 20, 2016

Top Down Stealth Toolkit Tutorial: How to Migrate the Patrol Bots to a new Third Person/First Person project

[The following information is based on the v1.2 of the Top Down Stealth Toolkit & hence may not remain entirely relevant in later versions. For more information about the toolkit, check out the official support thread in the Unreal Engine forums: https://forums.unrealengine.com/showthread.php?97156-Top-Down-Stealth-Toolkit]


This tutorial goes over the steps involved in migrating the patrol bot AI from the toolkit onto a new Third Person/First Person template.

Since some of the AI classes contain references to the toolkit game mode, player character, etc we need to first remove those references before migration in order to avoid having those linked classes migrated to the new project unnecessarily. They can be replaced with your own custom classes in the new project after the migration.

Apart from that, the vision arcs used by the AI in the toolkit becomes completely useless when you're using the AI in a third person or first person stealth game. As a result, I'll be deleting the functionality associated with it as well before migrating the AI blueprints.

Keeping both these factors in mind, the screenshots posted below goes through the different AI blueprints to depict the changes that need to be made in order to aid in the migration process.

BB_PatrolAI:



BTT_CallEndGameLogic: Event Graph



BPC_AutomatedLaserTracker: Function 'Processing Lock On Request'



BP_PatrolAI_Parent: EventGraph



BP_PatrolAI_Parent: Function 'Search For Nearby Patrol Bots'



BTS_VisionCheck: Event Graph





Now that all the necessary changes are made, the only thing left is to right click on the 'PatrolAI' folder & select Migrate Asset into the Content folder of your new custom project. Unreal Engine will automatically transfer other associated files such as the animations, materials & textures, etc. Since we have made sure that references to the Toolkit Game Mode & Player Character are removed, they will not get transferred into your new project, thus leaving you with the option of using your own custom classes for the same.

Once the content is migrated into the new project, just head over to the Patrol AI Parent class & then remove the variable 'MID_VisionArc' & delete all instances of it within the class. Without the Vision Arc, we no longer need the dynamic material instance to update it's color at runtime. Apart from that just make sure that you've added a Nav Mesh Bounds volume so that the bots can move around. Now just drop the Melee/Ranged Patrol Bot into the level & you should be good to go.

If you have any other queries regarding the migration process, feel free to let me know in the comments & I'll get back to you on that.

Tuesday, July 12, 2016

Tower Defense Starter Kit v1.4 Dev Log #2: Tower Abilities

When I started working on the Tower Defense Starter Kit, one of the games that inspired me was Anomaly Defenders by 11 Bit Studios. Even though the game was generally not received as well as the Anomaly Warzone series, it did have one good feature that we don't always see in Tower Defense games: Tower Abilites. 

In Anomaly Defenders, the towers are equipped with Tower Functions, which basically improves the effectiveness of the tower for a short duration. The Tower Functions are activated gradually as the player progresses through the campaign & can be improved further using the skill points received at the end of each level. Some examples of the Tower Functions include an EMP Blast that reduces the shield of nearby creeps, a Rage mode that greatly increases the damage of the tower, etc. 

While the campaign missions in Anomaly Defenders are all based on a limited number of waves, I feel that Tower Abilities would make an excellent addition to Tower Defense games that feature endless wave modes. It could ensure that the players will have some amount of micro management left even after they have placed all their towers in the level. And since the Tower Defense Starter Kit supports endless wave modes, it seemed like a good idea to add Tower Abilities to it. 

Over the past couple of updates, I had been restructuring certain parts of the code to smooth out the transition to this new feature. So I'm finally happy to announce that the upcoming v1.4 update will feature two new Tower Abilities: Overdrive & Repair.

Overdrive: The Overdrive ability amplifies the tower's output per cycle for a set duration. This ability will be available out of the box for all towers. As a result, a Laser Tower on Overdrive would have increased damage, while a Mining Tower would have improved resource mining rate.

Repair: The Repair ability regenerates the tower's armor over set period of time. This ability will be available out of the box for all towers as well.

Listed below are a couple of WIP screenshots that display the updated Tower Functions menu & the new status effect icon:



Tower Functions Menu updated with the new abilities


New Status Effect Icon added to display active ability & it's remaining duration


[Note: More abilities will be introduced through future updates & I think it's safe to assume that atleast some of these abilities would be tailored towards certain type of towers, thus rendering them useless in the context of other towers. As a result, I'm using Composition instead of an Inheritance based approach to prevent unnecessary bloating of the Tower blueprints.]

For more details about the Tower Defense Starter Kit, check out the official Unreal Engine forum support thread at: https://forums.unrealengine.com/showthread.php?102675-Tower-Defense-Starter-Kit-Support-Thread]