Tower Defense Starter Kit Tutorial: How to create custom Enemy Units

[The following information is based on the v1.5 edition of Tower Defense Starter Kit & 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?102675-Tower-Defense-Starter-Kit-Support-Thread]


The Tower Defense Starter Kit comes equipped with four types of Enemy AI units that all derive from the parent blueprint 'BP_EnemyAI_Parent'. As the name suggests, this tutorial goes over the process of adding your own new customized AI units into the mix.

1. First add a new entry to the enum 'ECreepType. I'm going to call it Exploder as I want this new AI unit to explode when destroyed, thus dealing heavy damage to all Tower Guardians/Towers caught in the explosion.

2. Now create a new child blueprint derived from the 'BP_EnemyAI_Parent' class. By inheriting from this class, our new AI unit will have all the basic capabilities that will be required of it including damage & threat response mechanisms, movement logic, etc. At this point, all you have to do is to set the skeletal mesh & animation blueprint from it's components tab based on your requirements.

3. Set values for the default 'User Defined' attributes of this unit & add new variables named 'Explosion Damage' & 'ExplosionDamageRadius' as shown in the screenshot below:


4. Now override & extend the 'End Play' event of the parent class by adding the explosion damage application logic as shown in the previous screenshot.

[Note: Steps 5 & 6 are only required if you intend to use the Group Based Wave Generation System from the Wave Manager.]

5. Head over to the 'BP_EnemySpawnPoint' blueprint & add a custom event similar to the other SpawnCreepBatch events present in it's Event Graph. Check out the next screenshot to see how it's done. Basically this takes care of the creep spawning mechanism, once the wave generator has decided to spawn this particular type of creep.


6. Now the Wave Manager needs to know that it can call this Event to spawn a batch of Exploder bots. So make the changes marked in red in the next screenshot, within your wave manager blueprint:


7. All that's left now is to add our new Exploder bot into the Wave Data Array as shown in the example below:



With that, we have covered the steps involved in creating a very basic Enemy AI template. All classes derived from the EnemyAI_Parent class will be capable of engaging in melee combat with the Tower Guardians. If you want your custom AI bot to engage in ranged combat with the Towers as well, just follow the logic implemented within the BP_EnemyAI_Ranged blueprint.

FPS Tower Defense Toolkit Tutorial: How to use Towers without Tower Bases

[The following information is based on the v1.9 edition of FPS Tower Defense 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?79300-FPS-Tower-Defense-Toolkit]

The FPS Tower Defense Toolkit lets players construct mazes using Tower Bases to control the paths of AI bots. The same Tower Bases also act as platforms for placement of Towers, which help prevent the AI bots from reaching the Power Core. However since most Tower Defense games allow players to directly place towers on the ground instead of a separate platform like Tower Bases, I've received a few queries about how to implement the aforementioned design with this toolkit. This tutorial goes over the modifications required for achieving the same.



BP_TowerManager:


1. Set the variable 'TowerZOffset' to 0.0. This variable determines the offset of the towers along the z axis relative to the ground location. The offset ensured that towers were spawned physically on top of the Tower Bases. Since we're not going to use Tower Bases in this particular scenario, a value of 0.0 ensures that the towers are spawned directly on top of the ground.


2. Now head over to the 'Destroy Tower' function & replace the value of 'Grid Status' input parameter for the 'Update Grid Data Array' function call from 'Tower Base' to 'Empty' [check screenshot below]. Having it set to Tower Base ensured that when a Tower is destroyed, the grid status would revert back to the Tower Base on which it was placed. In our case, we can directly set it to Empty as we're not dealing with Tower Bases.




3. Remove the function call 'Add Tower Base Entry to Selected Tower Data Array' within the 'Create Selected Tower Data Array' function & connect the nodes as shown in the screenshot below:





BP_AttackTowerActual_Parent:


1. Within the Construction Script, add the segment marked with red border in the next screenshot [check below]. This code ensures that the nav paths are rebuilt every time a tower is placed in the level. Since towers used to be placed on tower bases, we only had to do this when tower bases were spawned. And now since towers are going to be placed directly on the ground, we're calling the same functionality here as well.




2. In the Event Graph, add a new 'Event End Play' node & add the segment marked with red border in the screenshot below. This performs the same function as last step, the difference being that we're requesting the nav mesh to rebuild itself everytime a tower is destroyed.




3. Now add a 'Box collision' component to this class. This will act as the nav modifier volume that can block enemy AI paths, thus forcing them along alternate paths. Update the parameters of this component from it's details panel to match the information specified in the following screenshot.





BP_TowerBaseHolo:


1. Now go to the folder 'Holographic Towers'. You should see separate holographic tower classes for Tower Base & Towers. All holographic towers currently inherited from the 'BP_AttackTowerHolo_Parent' blueprint. 


Now the easiest way to modify the Holographic Towers based on our requirements would be to have them inherit from the 'BP_TowerBaseHolo' class. We choose to do this because this class already checks if the tower/towerbase can be placed on the focused grid cell based on the availability of paths from the enemy spawn points to the power core. And with towers being placed at the ground level, this has become a requirement for us. 


However, we still need to make a couple of minor changes within the blueprint. Go to 'Evaluate Tower Resource Requirements' & replace it's logic with the nodes shown in the screenshot below. Basically we're replacing the check for availability of tower bases with a check for availability of tower points.





[Note: You can copy paste these nodes from the same function implementation in  'BP_AttackTowerHolo_Parent' blueprint.]

2. Within the 'Create New Actor Transform' function, replace the 'TowerBaseZOffset' with 'TowerZOffset' as shown in the screenshot below:




3. Now create child blueprints from the 'BP_TowerBaseHolo' class for all the Towers. For example, I'm going to create one child blueprint & name it BP_LaserTowerHolographic. Within the blueprint, we need to set the 'Tower' mesh component to be that of the associated tower. So in this case, I'm just going to set the Laser Tower mesh to this component.


BP_GameInstance:

1. The 'Tower Data Array' variable contains user specified information about all the Towers. If you expand it's elements, you would notice that the first element is a Tower Base entry. Delete this element first.

2. Now expand the array element associated with the Laser Tower & set it's 'TowerHoloClass' parameter as the new holographic laser tower we created a while ago [check next screenshot]. Similarly change the same parameter for every other tower element within the array.



Alright, so now you should be able to use Towers without the need for Tower Bases in your projects. Just make sure to remove references to the Tower Bases & associated enums/blueprints if they're not required. And finally here's a sample screenshot with the final result:


Top Down Stealth Toolkit Tutorial: How to create customized Laser Security Systems

[The following information is based on the v1.4 edition of 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]


The Laser Security Systems in Top Down Stealth Toolkit function as an auxiliary layer of AI Threat Detection by alerting all nearby patrol bots upon being intercepted by the player. The underlying logic is a simple combination of Timeline based movement & Collision Overlap checks. These actors support drag & drop functionality from the editor & can be easily customized using the variables exposed to the editor from the blueprints. This post goes over the impact of the aforementioned parameters on the working of Laser Security Systems.



1. Length: The Laser Security System uses a box collision component to determine if the player is within it's range. The length parameter determines the total length of this box & also controls the area covered by the laser particle system.

2. Max Height: As described in the tooltip, this variable determines the max height up to which the lasers move relative to the default position at which the actor has been placed in the level.

3. Player Height: The Player Height parameter is used to control the color of the laser based on it's position relative to the ground. Red color indicates that players passing through the laser will trigger an alarm while white color indicates that the laser tracker has moved up beyond the player's height & thus enable safe passage below it. This can be quite useful in top down games, as perception of the location of actors that move along the z plane may not always be intuitive to the player.

4. Alarm Timer: The Alarm Timer value determines how often the alarms are triggered while the laser system has an active target. Since the range of alarm noises are limited, having a timed alarm system can improve the chances of alerting nearby AI patrol bots.

5. Movement Timeline Starting Time: This parameter determines the starting location of the laser along it's movement trajectory. It has a range of 0.0 to 4.0, with 0.0/4.0 representing the starting position [i.e. the location at which the actor was placed] & 2.0 representing the highest position along it's movement trajectory. Anything between 0.0 & 2.0 implies that the laser will have an upward motion going towards the highest point along the trajectory, while a value between 2.0 & 4.0 means that it will have a downward motion going towards the lowest point or the starting position along the trajectory.

Tower Defense Starter Kit Tutorial: How to create new Global Abilities


[The following information is based on the v1.5 edition of Tower Defense Starter Kit & 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?102675-Tower-Defense-Starter-Kit-Support-Thread]


The Tower Defense Starter Kit is equipped two default inbuilt Global Abilities: Airstrike & Tower Guardians. This tutorial goes over the steps involved in creating & adding a new custom Global Ability.

1. First we need to add a new entry to the enum 'EGlobalAbilities' to depict our new custom Ability. I'm going to add an entry named Shockwave, & this particular sample ability will reduce the health of all enemy units in the level.

2. Now we will create an actor component that contains the core functionality of this ability. Basically these ability components will be added to an actor named 'Global Ability Deployer' [which as the name suggests acts as a container for the component], when the ability is activated by the player at runtime. 

As shown in the screenshot below, I've added the logic for retrieving references to all enemy bots in the level, & then reduce their health by a certain amount. Once the job is done, the component requests the owning actor [Global Ability Deployer as mentioned above] to destroy itself. We're doing this because the deployer comes into action only when the ability has been activated.



3. With the custom enum & actor component set in place, it is now possible to add a new entry into the Global Abilities Array within the BP_GameInstance class. For this new member of the array, set the 'AbilityType' parameter to the new enum entry we created earlier; the 'AbilityComponentClass' to the new custom actor component; 'AbilityNameAbbreviation' to the text displayed on the Global Ability Button; 'RechargeDuration' value to the amount of time it takes for the ability to recharge; & finally the 'Unlocked' parameter [it does not do anything at the moment & is reserved for potential future uses] to true. Here's a screenshot depicting the array entry for my new Shockwave ability:



The In-Game HUD takes the data from this array & dynamically displays the Global Ability buttons based on the specified information, thus reducing the need to make any changes to the associated HUD blueprints when abilities are added or removed.

4. Now all that's left is to tell the Global Ability Deployer to handle this new ability. As depicted in the screenshot below, the Deployer will have information regarding the type of ability activated by the player. Using this information, it adds the associated ability component to itself. So when the switch case encounters the Shockwave ability, we just have to add our new Shockwave ability component.


Tower Defense Starter Kit Tutorial: How to add new levels to the Level Selection Menu

The Tower Defense Starter Kit comes equipped with a level selection menu that enables players to choose from a list of levels as shown below:



The toolkit contains three playable maps & one main menu map by default, & supports usage of new custom maps as well. The following steps go over the process of adding your own custom levels into the toolkit:

1. Create a new custom level from the Content Browser.

2. Open the 'BP_GameInstance' blueprint within the Blueprints folder & select the variable 'LevelDataArray'. It should have four entries by default: one for the main menu & three for the sample maps. To add our new custom map, first add a new element to this array.

Each element of this struct array contains the following attributes: ID, ScreenName, FileName, Image, & Unlocked. The ID is used to set the level number, starting with '0' for the main menu level. It is not used for any calculations & serves only to provide a means for classification of levels. The ScreenName determines the name that would be displayed for the corresponding entry in the level selection menu. The FileName is used to store the address of the level asset. The Image is used to display a preview shot of the map within the level selection menu, & the Unlocked attribute determines if the level would be unlocked by default. If it isn't, it will be unlocked, as soon as the player completes the level linked to the previous entry within the Level Data Array.

3. Fill out the attributes mentioned above for the new level data element. Make sure to copy the name of the new custom map asset within the content browser & paste it into the FileName attributes. Here is a sample entry for a new level that I created:



4. Now close the project & delete the 'Saved' folder within the project folder. This ensures that the changes made to the Level Data Array do not get overridden by information specified in an existing save game file.

5. Now open the project, open up the main menu level from the 'Maps' folder within the Content Browser, & launch an instance of the game. The level selection menu will now display information about the new level, provided that it's been set to Unlocked. Here is a sample screenshot with the new custom level:


Top Down Stealth Toolkit v4.10 Basics: Skills & Gadgets

[The following information is based on the v4.10 of the Top Down Stealth Toolkit & hence may not remain entirely relevant in later versions. For information regarding the implementation of Skills & Gadgets in the latest version of the toolkit, check out this post in the official support thread in the Unreal Engine forumshttps://forums.unrealengine.com/showthread.php?97156-Top-Down-Stealth-Toolkit&p=459460&viewfull=1#post459460]

The player character in the Top Down Stealth Toolkit is equipped with skills & gadgets to deal with the AI guards. By default, the player can select one skill & one gadget from the 'BP_PlayerCharacter' blueprint before playing a level. The variables 'ActiveSkill' & 'ActiveGadget' can be used to select the active skill/gadget. The default input buttons for the same are 'Q' & 'F' respectively.


Skills: Skills are abilities that can be used unlimited number of times.

1. Whistle: The Whistle skill can be used to distract guards within a certain radius of the player to the whistle origin location. The affected distance depends on the 'Loudness' variable of the noise within the 'MakeFootstep/WhistleNoise' function. The formula for the noise to AI Perception distance is mentioned within the function. 


Gadgets: Gadgets are abilities that can be used only a limited number of times. The number of gadget activations remaining is displayed through the UI element for the same. Gadgets also have a cooldown interval during which it cannot be used. The default number of activations can be specified using the 'NumberOfGadgetActivationsLeft' variable in the 'BP_TDST_GameMode'.

1. Camera Jammer: The Camera Jammer gadget can be used to deactivate all camera bots within a certain range of the player, for a limited period of time. The jammer range can be specified through the 'CameraJammerRange' variable.

2. Proximity Shockmine: The Proximity Shockmine is a deployable actor that deactivates the first patrol bot to pass through it, for a limited period of time. The functional logic for the same can be found within the 'BP_ProximityShockmine' blueprint.


3. Stun Gun: The Stun Gun can be used to permanently deactivate the targeted patrol bot, until it is detected by other patrol bots. Unlike the other gadgets, the stun gun requires manual targeting using the mouse cursor. Splines are used to provide visual aim assists from the player towards the target. The functions 'Activate/DeactivateStunGun' & 'UpdateAimSplineLocation' contain the functional logic for this gadget.

Top Down Stealth Toolkit v4.10 Basics: Vision Arcs

[The following information is based on the v4.10 of the Top Down Stealth Toolkit & hence may not remain entirely relevant in later versions. For information regarding the implementation of vision arcs in the latest version of the toolkit, check out this post in the official support thread in the Unreal Engine forums: https://forums.unrealengine.com/showthread.php?97156-Top-Down-Stealth-Toolkit&p=459450&viewfull=1#post459450]

The vision arcs in Top Down Stealth Toolkit are created using custom meshes & updated at runtime to match & resize based on the obstacles in their path. The vision arcs serve the aesthetic purposes of AI threat detection, while the functional part is executed elsewhere, thus serving as two modular parts that make up a whole. As a result, it is possible to edit the base properties of the vision arcs without worrying about AI logic. 

The vision arcs exist as parts within the AI Bot logic. The following parameters can be used to edit their properties [screenshot below]:

1. DisplayVisionArc?: Use this parameter to turn on/off the vision arcs. This can be used to disable vision arcs for certain types of bots, or to compliment certain bot states such as stunned or deactivated. Turning off the vision arcs also greatly improves the performance.

2. UseTranslucentVisionArc?: Turned on by default, this parameter determines whether the vision arcs are translucent or opaque. Turning it off could yield slight performance improvements.

3. VisionRange: The vision range parameter determines both the visual range of the vision arc as well as the associated threat detection range for the bots. This can be used to produce different types of vision arcs for different types of bots. For example, a melee bot might have less vision range, while a ranged bot could have large vision range.

4. HalfVisionAngle: This parameter can be used to control the angular range of the vision arcs and hence can be used to produce different types of vision arcs for different types of bots. However increasing it to high values can reduce performance.




Tower Defense Starter Kit for Unreal Engine Marketplace

The Tower Defense Starter Kit is a pure blueprint framework that enables quick & easy creation of Tower Defense games. The toolkit is now available in the Unreal Engine Marketplace for $29.99: https://www.unrealengine.com/marketplace/tower-defense-starter-kit

Preview Screenshots:





Features:
  • Top Down Camera view with panning, edge scrolling & smooth/step zoom support.
  • Seven types of Towers: MachineGun, Shockwave, Laser, Sniper, Artillery, Boost, & Mining Tower.
  • Five types of Enemy AI: Tank, Healer, Runner, Ranged, & Tower Disabler.
  • Tower Abilities: Overdrive & Repair.
  • Global Abilities: Airstrike & Tower Guardians.
  • Three types of AI Wave Generation systems, with support for endless waves & repeating wave cycles with dynamically escalating difficulties.
  • Automated resource allocation between waves provide players with the abilty to Build, Upgrade, & Sell towers.
  • Supports custom spline based multi-lane paths as well as the default nav mesh based pathing system. Sample maps included to demonstrate the working of each type of system.
  • Includes a loadout menu at level start with player driven tower selection.
  • Modular Grid Generators with drag & drop support to create grid cells for tower placement.
  • A Main menu system that supports level selection & persistent map unlocks across multiple sessions.

Technical Detail:
  • The Wave Manager allows complete customization of waves through parameters like EnemyType, NumberOfUnits, SpawnPoint, SpawnDelay, etc.
  • Data driven approach through user defined arrays enable easy customization of the Towers, Tower Abilities, & Global Abilities.
  • Variables are categorized into 'User Defined' & 'Automatically Set' to facilitate identification of customizable parameters.
  • The Enemy/Tower/Tower Guardian AI & Tower/Global Abilities are driven through modular components, thus facilitating the creation of new types of AI bots & abilities with ease.
  • The Game Mode handles initialization of all core gameplay actors from a single central location using a linear workflow design.
  • The Player Controller acts as a conduit for all low level HUD update requests, while the Game Instace & HUD classes manage high level HUD changes.
  • AI Spawn Points support precached & runtime generation of randomized spawning locations.
  • Event driven logic used predominantly over continuously ticking services for HUD updates.
  • Blueprint function library employed to easily retrieve references to core gameplay actors from all blueprints.
  • All static Tower parameters are store in a centralized Tower Data Array, thus requiring only dynamic parameters such as DPS, Range, etc to be stored in the tower actors.
  • The Tower Selection menu is populated dynamically based on information specified in the Tower Data Array, thus eliminating the need for manual HUD changes when adding/removing towers.



Intended Platform: Windows

Optimized for: Unreal Engine v4.15

Preview Video:


All further details about the toolkit will be updated in the official Unreal Engine forum support thread: https://forums.unrealengine.com/showthread.php?102675-Tower-Defense-Starter-Kit-Support-Thread

Unreal Engine Tutorial: How to use curves to control the prices of in-game items

Hi, welcome back for another tutorial. This time around, we're going to learn how to use curves to control the price of an item over time. I'm going to start with the Third Person template that is available by default in the Unreal Engine. 

First of all, we need to create a Float Curve along which we will plot the price of the item relative to time. To do so, just right click on the content browser, then select Miscellaneous >> Curve & choose the Float Curve option. Now open it up & add some points in the graph to define a curve. This can be done by right clicking anywhere on the graph & selecting 'Add key to curve'. Also in order to set accurate values, just click on the point & set 'Time' & 'Value' according to your requirements on the top left corner. I'm using the following values for this tutorial:

Time = 0; Value = 1
Time = 2; Value = 2
Time = 4; Value = 1

You may notice that it will generate a very sharp curve by default. In order to change this behavior, just try out the other interpolation methods available on the menu bar in the top. 



Next I just setup the scene with a desk and a couple of glowing cube meshes on it. They're all purely for visual purposes. There's really no need to do so.



Now we're going to create an actor blueprint named 'BP_ItemManager'. Within this blueprint, we'll add script to control the price of items based on the game time. But before that let's create a struct [Struct_ItemAttributes] to list the properties of the items. I've added a Name parameter of type 'String' plus Cost & GameTimeMultiplier parameters both of type 'Float'. The Game Timer Multiplier will be used to control the relation between the price of an item & game time by multiplying the game time with this value.



Now open the Item Manager blueprint & create an array of type Struct_ItemAttributes. Then give some default values to the different items. For example, these are the elements of my Item Array:

Element 0 >> Name = Green; Cost = 100; GameTimeMultiplier = 1
Element 1 >> Name = Orange; Cost = 100; GameTimeMultiplier = 3.6

The higher GameTimeMultiplier value of the orange item means that it's price will vary along the curve at a much faster pace than the green item.

We also need another variable of type Float Curve named 'PriceCurve' to hold a reference to our price curve. Make sure that it's default value is set to 'Price Curve'. 

Now we're going to create a function that can retrieve the curve float value at any point of time based on the game time as well as gametimemultiplier. First we find out the time range for the price curve. Then we do a modulo of the game time divided by this time range. The modulo operation will make sure that we will always get the required curve value, even if the game time has exceeded the max curve time plotted in the graph, thus essentially using the curve like a repeating wave pattern. The gametimemultiplier will be taken as an input parameter while the curvefloatvalue will be returned as an output parameter.



In order to retrieve the prices of all the items in the item array, we're going to add another function in the Item Manager named 'RetrieveCurrentPrice'. This function will loop through the items array, call the 'GetCurrentCurveValue' by passing in the GameTimeMultiplier from the struct & then multiply the returned curve value with the cost element. It then appends the result with the item name & prints it on to the screen.




All that's left now is to call this function from the player character. We can use 'Get all actors of class' at event begin play to store a reference to the Item Manager actor. When we press the required input button, we'll use this actor reference to execute the 'RetrieveCurrentPrice' function.



If we go ahead and the press the F button now, the function will print out the price of both items based on the game time at that point.

Alright, so that's it for this tutorial. I'll be posting a new Unreal Engine Diaries episode soon to continue on with Part II of the Basics of Particle Systems series. Until then, goodbye & have a great weekend. :)

Unreal Engine Tutorial: Create Circular Ring Material without Textures


Hi, welcome back for another tutorial. It's been quite a while since I put up a tutorial as I've been busy working on toolkits for the Marketplace. One of my earlier tutorials [link: Unit Selection Decals for RTS Games] had focused on how to create ring materials using textures, as well as using them to display unit selection decals for RTS games. However, a drawback associated with using textures was that it prevented the user from changing the inner & outer radius of the ring. And during prototyping stages of a product, it's far better to implement structures that can be changed easily from within the engine so that you don't have to create a new asset from an external package every time you need to test out a new idea. I've found this approach quite useful while working on my own products. Hence, this tutorial focuses on creating a ring material that can be adjusted both from within the material editor as well as dynamically at runtime.

Alright before we get started, I'm going to use the default Top Down Template that comes free with the Unreal Engine, as the top down view is a good example for showcasing the uses of a ring material. We're going to be creating a decal material here. So the first step is to create a new material from the content browser & adjust it's default properties from the detail panel. Under the 'Material' category of the details panel, set 'Material Domain' to 'Deferred Decal' & 'Decal Blend Node' to 'Emissive' as shown in the screenshot below.


Now right click within the material editor & create two 'RadialGradientExponential' nodes. This node is normally used to produce radial gradients, but we're just going to use them to create two circles. The gradient effect can be negated by increasing the density of both these gradients. For that, just create a new constant expression & set it's value to 100. Connect it to the 'Density' input of both the gradient nodes. Now with that taken care of, we need to specify the outer & inner radius of the ring material. Create two scalar parameters 'OuterRadius' & 'InnerRadius' with the values 0.5 & 0.4 respectively. Connect these two to the 'Radius' input of the gradient nodes. Now subtract the inner radius gradient node from the outer radius gradient node & connect this to the 'Opacity' parameter of the material.


We have thus implemented the core logic for the ring material. Now on to the emissivity & opacity to wrap it up. First, create a vector parameter named 'BaseColor' & a scalar parameter named 'Emissivity' with the default value of 2. Multiple both of them & then multiply it's output with the result of the subtract node we added for the gradients. Connect the result to the 'Emissive' parameter of the material & we have created a circular ring material.


This next step is not necessary, but I created two material instances using this material: one for the unit selection decal & the other for displaying attack range. 

Alright, now select the Top Down Character & add two 'Decal' components to it: a Unit Selection Decal & a Range Display Decal. Set the Z value of both to -98 cm & pitch value to -90 degrees. The pitch value is changed because the default orientation of the decal component spawns it in an invisible plane. Since the default dimensions are too small for our needs, we can scale up the Unit Selection & Range Display Decal to (1, 50, 50) & (1, 400, 400). As you may have noticed, we do not scale up the X value. This is because we don't want the decal to be drawn on surrounding objects. Setting it to one allows it to behave in such a way that it gets cut off by the obstacles in it's path instead of painting over them.


Now if you play in the editor, you should be able to see both the unit selection & range display decals display & move along with your character as shown in the screenshot below:


Alright, so that's it for this tutorial. I'll be continuing on with the Unreal Engine diaries series for concepts that do not require a whole tutorial. But I have some ideas for new tutorials as well & if possible, will try to upload them some time during this coming week. Until then, goodbye & have a great weekend. :)

Top Down Stealth Toolkit for Unreal Engine Marketplace

The Top Down Stealth Toolkit is a pure blueprint framework that enables quick & easy creation of stealth games from a top down perspective. It is now available in the Unreal Engine Marketplace at: https://www.unrealengine.com/marketplace/top-down-stealth-toolkit


Features:
- Top Down Camera Perspective.
- Patrol Guards that can respond to multiple types of stimuli including the player character, incapacitated team mates, alarms, & other types of noises.
- Cameras, Motion Sensors, Laser Security Systems, & Turrets function as supporting entities to assist the Patrol Guards & provide additional layers of challenge to the player.

- Use Whistle, Gadgets, Suit Abilities, & Weapons to distract or disable AI Bots.

- Gadgets: Proximity ShockMine.

- Suit Abilities: EMP Blast.

- Weapons: Stun Gun, Hand Gun, & Silenced Hand Gun.

- Place Exit Point & collectible Gems across the level to drive the core gameplay.

- The Loadout Menu at level startup enables selection of Gadgets through player driven choices.

- A persistent Mission Stats system that provides High Score information at the end of a level.

- Dynamic Vision Arcs, Noise Pulse Emitters, Range Decals, & AI State Display Icons accurately portray information about the AI Perception Status to the player, thus providing the tools to make calculated decisions.

Technical Details:

- The Suit Abilities, Gadgets, Weapon Systems, & Stamina Management for the player character, & Dynamic Vision Arcs, Laser Tracking, & Patrol Waypoint systems for the AI Bots are handled through the use of custom components & interfaces. The component based design provides improved modularity & enables easy integration with different classes.

- Variables are categorized into 'User Defined' & 'Automatically Set' to facilitate identification of customizable parameters.

- The Vision Arc Optimizer actor provides performance boost by removing rendering calculations for Vision Arcs outside the screenspace.

- Blueprint function library employed to easily retrieve references to core gameplay actors from all blueprints.

- Event driven logic used predominantly over continuously ticking services for HUD updates.

- Ranged Patrol Guards & Turrets use Laser Tracking components to acquire & lock on to targets.

- The Game Mode handles initialization of all core gameplay actors from a single central location using a linear workflow design.

- The Player Controller acts as a conduit for all low level HUD update requests, while the Game Instace & HUD classes manage high level HUD changes.
- The Gadget Selection menu is populated dynamically based on information specified in the Gadget Data Array, thus eliminating the need for manual HUD changes when adding/removing gadgets.

Intended Platform: Windows

Optimized for: Unreal Engine v4.10 & v4.11


Preview Screenshots:





Preview Video: 



For more information, check out the official Unreal Engine forum thread: https://forums.unrealengine.com/showthread.php?97156-Top-Down-Stealth-Toolkit

Unreal Engine Diaries #11: Nav Mesh Configuration

[This episode of Unreal Engine Diaries focuses primarily on nav mesh configuration, nav areas & configuration of agent types.

Source: Unreal Engine 4 AI Support Twitch Broadcast with Mieszko: https://www.youtube.com/watch?v=7LaazCv4rB0]


1. The Recast NavMesh has a couple of attributes named 'CellSize' & 'CellHeight' under the 'Generation' section in it's details panel. Together they determine the resolution of the nav mesh & lowering these values can create more precise nav meshes. It could be especially useful when there are lot of holes in the nav mesh due to the surface properties of the terrain. However, lowering them also makes the nav mesh calculations more expensive.

2. If runtime nav mesh generation is enabled, it would be best to set the 'Tile Size' attribute of Recast NavMesh to the minimum viable amount.

3. The 'Min Region Area' parameter which can also be found under 'Generation' section of Recast NavMesh can be increased to get rid of small nav mesh islands that are isolated from the rest of the nav mesh regions.

4. When moving around objects that can influence the nav mesh with the runtime nav mesh generation enabled, it is far more efficient to use the actors as dynamic obstacles (with custom nav area settings) when compared to moving around actors in their default state. For static meshes this can be done from the static mesh editor as shown:



Just tick the 'Is Dynamic Obstacle?' checkbox & set the nav area type from the dropdown right above it. 

Alternatively, the same can be set up from the collision components in actor classes as shown below: [same procedure as mentioned in the static mesh editor workflow]



5. If you have tall characters in your game that are having issues with the nav mesh pathing, go to 'Navigation System' category under Project Settings. Add a new 'Supported Agents' & then try increasing the z value of 'Default Query Extent' of the new agent. 

On the other hand, in order to create separate nav mesh pathing for the bigger AI characters, add a new element to 'Supported agents' array & specify custom agent radius, query extent, agent height, etc. Build paths again to see a new nav mesh recast in the Scene Outliner tab. The 'Enable Drawing' parameter under Recast Navmesh can be ticked On to visualize the new nav mesh. It seems that the navigation system will automatically determine which agent type is suitable for the bot based on it's collision capsule size.