Top Down Stealth Toolkit

The Top Down Stealth Toolkit is a pure blueprint framework that enables quick & easy creation of stealth games from a top-down perspective.

Marketplace Product Page: https://www.unrealengine.com/marketp…tealth-toolkit

Features:

• Top-Down Camera perspective.
• A custom-built AI Perception system tailored specifically for developing Stealth games enable the AI agents to perceive stimuli through four different types of perception models: Visual, Aural, Intuitive, & Motion perception.
• A Stimulus generation system that will enable the users to easily customize & add new types of perceivable events for the AI agents.
• Patrol Guards that can respond to a wide variety of stimuli including the player character, incapacitated teammates, alarms, footstep & gunshot noises, & more.
• Automated security devices like Cameras, Motion Sensors, Laser Security Systems, & Turrets function provide auxiliary support systems 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.
• A Global Alert Level system that controls the activation of automated security devices like lasers & turrets, as well as the deployment of reinforcement patrol guards.
• A Mission Stats Display system that tracks & updates high score information for every level.

Technical Details:

• Modular components are employed throughout the toolkit to handle special functionalities & aid in the creation of new variations to existing entities with minimal coupling.
• The Global Alert Level system controls the Global Alert Meter by employing event dispatchers to continuously listen in new stimuli being perceived by AI agents across the level.
• The AI Surveillance Controller directs the activation of all AI agents within the level. This system can be leveraged to create different starting conditions for each level, choosing to activate all security measures by default or have them activated in a modular fashion based on the overall threat perceived by the AI.
• The AI Sensory Manager continuously evaluates all stimuli against various agents & assigns new objectives to the AI agents based on the results.
• The Patrol Guard AI uses Behavior Trees to respond to the various objectives assigned by the AI Sensory Manager.

Current Product Version: 3.3

Optimized for: Unreal Engine v4.26

Intended Platform: Windows

Gameplay demo of the v3.1 edition of Top Down Stealth Toolkit (Windows): https://www.dropbox.com/s/45rpdhu5qp…itv3.1.7z?dl=0

Preview Videos:

Top Down Stealth Toolkit v2.0 Features Preview: Stimulus Classes

Top Down Stealth Toolkit v1.0 Preview:

If you have any doubts or queries regarding the toolkit, you can always reach out to me personally through my marketplace support email.

1 Like

Additional Information:

Update Logs:

Tutorials/Basic Concept Overviews:

  1. Top Down Stealth Toolkit Tutorial: How to create a new level: https://unrealpossibilities.blogspot…orial-how.html

  2. Top Down Stealth Toolkit Basics - Patrol Movement Systems: https://unrealpossibilities.blogspot…cs-patrol.html

  3. Top Down Stealth Toolkit Basics - Stimulus Types: https://unrealpossibilities.blogspot…it-basics.html

  4. Top Down Stealth Toolkit Basics - AI Perception: https://unrealpossibilities.blogspot…basics-ai.html

  5. Top Down Stealth Toolkit Tutorial - How to create a new custom Interest Stimulus: https://unrealpossibilities.blogspot…orial-how.html

  6. Top Down Stealth Toolkit Tutorial - How to control the AI Perception model for AI agents: https://unrealpossibilities.blogspot…al-how_22.html

  7. Top Down Stealth Toolkit Basics - Vision Arc Configuration: https://forums.unrealengine.com/unre…83#post1587283

  8. Top Down Stealth Toolkit Tutorial - How to create customized Laser Security Systems: https://forums.unrealengine.com/show…l=1#post642794

  9. Top Down Stealth Toolkit Tutorial - How to modify the size of the noise pulse emitters: https://unrealpossibilities.blogspot…orial-how.html

  10. Top Down Stealth Toolkit Tutorial - How to change to Third Person Perspective: Top Down Stealth Toolkit Tutorials - Google Docs

  11. Top Down Stealth Toolkit Basics - Global Alert Level System: https://unrealpossibilities.blogspot…cs-global.html

FAQ:

  1. I noticed that the turrets are disabled when I start a new game. But then they sometimes get activated over the course of a game. Why is it behaving this way, and how can it be enabled right at the start of a mission?
    A: The turret AI in Top Down Stealth Toolkit is set to a deactivated state by default. This is an intended feature designed to showcase the use of automated security devices as a form of backup system for the AI. The default behavior is to activate them once the Global Alert Level escalates to Stage I, which is why they seem to get turned on sometimes during the mission. For more details on how to control this behavior, check out: https://unrealpossibilities.blogspot…kit-faq-1.html

  2. I want to change the size of the vision arcs. Where can I find the variables that control it? Is there a way to do it from the editor window?
    A: You can customize the radius & angle of vision arcs for all types of AI through their perception components. For detailed information on how to go about doing it, check out the FAQ reply section at: https://unrealpossibilities.blogspot…kit-faq-2.html

  3. Does the vision cones update their shape based on the obstacles in their path?
    A: Yes the vision cones continuously gets updated based on any obstacles it encounters in its path.

  4. How can I turn off the Gadget Selection Menu that pops up at the start of a level?
    A: The BP_GameMode blueprint has a boolean variable named ‘SelectGadgetsAtLevelStart’. It determines if the Gadget Selection Menu will be displayed or not. So to turn off the menu, just set this variable to false.

Top Down Stealth Toolkit Basics #1: Patrol Bot Movement System

The Patrol bots in Top Down Stealth Toolkit are equipped with three different types of patrol movement system: Stationary, FixedWaypoints, & RandomWaypoints. This setting can be changed from the ‘PatrolMovementType’ enum variable listed under the ‘User Defined’ category for Patrol Bots as shown:

  1. Stationary Movement Type: The Stationary movement type setting is used for patrol bots that are assigned to guard a particular location without actual patrol movement. They will however move out to investigate any suspicious activity in their vicinity. Upon failing to find the player under any circumstances, these bots will always return to their original guard location.

  2. FixedWaypoints Movement Type: The Fixed Waypoints system is used to create well defined paths for patrol bots. This is accomplished using a combination of custom Waypoint actors as well as an array to store references to these waypoints in a fixed order. In order to create a patrol path using this system, drag in the BP_WayPointNode actors into the level to create a set of path points. Now under the ‘User Defined’ category of the patrol bot actor, add new elements to the ‘FixedWaypointsArray’, and then select the Waypoint actors [screenshot below] from the dropdown in the order in which the bots are required to traverse them. Bots that have been interrupted from this behavior by the player will always return to this designated path once they lose track of the player.

  1. RandomWaypoints Movement Type: Patrol bots assigned with this movement type will keep moving between randomly selected destinations at run time. Adjust the value of the ‘RandomWaypointRadius’ variable within the BP_PatrolEnemyAI_Parent blueprint to change the radius of search for the new waypoints.

Check out 0:54 of the Top Down Stealth Toolkit preview video to see all three patrol movement systems in action:

Hi, daft question, but how do I resize the vision cones?

Hi Daltone, if you select any of the bots in the level, you’ll be able to find two attributes ‘VisionRange’ & ‘HalfVisionAngle’ under the ‘User Defined’ category [see attached image]. You can adjust these values to change the size of the vision cone.

Alternatively, you can change it within the AI blueprints class itself to have it affect all AI units of that particular type.

Thanks, I think I must have gone temporarily blind. Nice toolkit though!

Thanks Daltone. I’ll be posting more information regularly on how to work with different parts of the toolkit.

I’ve been working on the first update over the past few weeks. The main focus of this update since the beginning was to find ways to make the vision arc rendering less expensive. While the actual line trace based calculations doesn’t offer much leeway in terms of cost reduction, I’ve found other ways to greatly optimize the vision arcs. These include checks to identify if the vision arcs are within visible screen space as well as less expensive obstacle checks to set the operation cost levels of enemy AI dynamically. Based on the operation cost level, the bots may turn off the line trace calculations for vision arc, player search logic, or both, thus essentially turning on/off expensive features based on the requirements.

Apart from this, I had been kind of troubled with the class hierarchy for the enemy AI. The Top Down Stealth Toolkit v1.0 comes with the following level of hierarchies:

  1. At the highest level, we have the Enemy AI Parent class derived from the character class.
  2. At the second level, we have two classes: Patrol AI Parent & Stationary AI Parent class, both derived from the Enemy AI Parent class.
  3. At the final level, we have two classes derived from Patrol & Stationary AI Parent classes each.

The problem with this approach was that the Stationary AI class inherit unnecessary components like character movement component & skeletal mesh component from the Enemy AI parent class. I could have made them into separate entities but since I wanted both types to be able to use vision arcs, I decided to derive them from the same class & implement the vision arc logic in the Enemy AI Parent class. So I started searching for more cleaner & alternative approaches & came upon the concept of composition, thanks to zoombapup mentioning it in an old forum post. After doing some research on component based workflow, I decided to use the Vision Arcs as custom components that can be added to any class. This modular approach along with the use of interfaces have helped to remove the unnecessary Enemy AI Parent class & instead have Patrol AI Parent & Stationary AI Parent as two separate entities, each containing only what is required of them. The vision arcs are now added as components to both the classes.

The other major changes that have been made so far include a new Turret bot AI, the use of Setter functions instead of setting exposed variables of a class from another class directly, more optimized AI threat detection logic, etc. I’m also planning to implement an optional gadget selection screen at level start, as well as looking into the prospects of implementing the gadgets as components.

I hope to finish work on this update by sometime next week & in time for the official Unreal Engine v4.11 release. There hasn’t been any updates about what’s happening with the updates for this toolkit, so I just wanted to give a heads up about that.

Here’s a short preview of a couple of new features that is coming in the v1.1 update.

The Automated Laser Component can be added to any of the bots that require a target lock-on system. Just activate the tracking system when necessary & it will use the associated interface functions to lock-on to the active target.

The new Turret bot acts as the offensive counterpart of the camera bot. While it offers a very limited static range of vision, its quick lock-on timer enables it to take down targets with ease.

This is great, one idea to enhance the AI would be to add a state so that once the player is detected, the enemy will look around and occasionally follow the same path/area of the player for a while, even if the player has escaped from view. I think this would make the AI more intelligent and less predictable, otherwise as with most games the AI basically has the memory of a gold fish :P. Another idea is once you’ve been spotted, the AI could then alert nearby AI. These are just some idea that I think would enhance the stealth aspects, but I’m pleased with the template and you will see how I get on using it in the UE4 G+ community. :smiley:

question,

so the AI starts following me. If I run away they will stop chasing me and return to their place?

Regards!

Hi Owen, glad to hear that you’re pleased with the toolkit. I agree with what you mentioned about memory of AI bots in stealth games. I noticed that in every game that I played through to collect references while working on this toolkit. What almost all of them does is it to have the AI go towards the last seen position to check it out. The AI does that in the toolkit as well, but I was not really pleased with the implementation in the vanilla version of the toolkit. So I’ve added a couple of new bot states for the upcoming update [will be submitted this coming monday]: a suspicious state when the AI first detects a player, & an alarmed state when it either hears an alarm or when it loses direct line of sight to player. The alarmed state lets the AI sprint towards the last seen position instead of the currently implemented investigation mode, which abruptly slows down the AI speed to normal patrol level. Once the AI reaches the last seen location, it will just do a stationary search at that location. The problem with letting the AI follow the player instead of going towards the last seen location is that I haven’t found a way to convey that to the player. At the moment, the vision arcs along with the strictly defined bot states provide accurate information about how far the AI can see, thus enabling the players to make decisions while understanding the rules. Unlike third person or first person stealth games where the player has a much better idea of whether the AI can see them, in top down games, I feel that we kind of need to let the player know about it. One possibility is to use a timer UI element to depict that the AI would follow the player until this timer finishes. I will definitely do some thinking about that while working on future updates, but if you have any other ideas, please do let me know.

As for the AI alerts, yes that would definitely be a neat little addition to the toolkit. I will try to include it in the second update.

Hi Namesis, well it depends on the current state of the AI. Here’s how it’s going to work once the v4.11 update goes live on the marketplace [assuming here that the AI bot doesn’t get distracted by any alarm or footstep sounds]:

The AI bot is chasing the player character [Threat Detected state] >> The player manages to get outside it’s vision range >> The AI bot goes toward the last seen player position & does a stationary search, which is basically looking around towards right & left a certain number of times [Alarmed state] >> If it cannot see the player during this search, it will revert back to patrol state. Now based on the patrol movement type, it would do one of the following things:

  1. Random waypoint patrol: It will choose a random location within a specified radius & start patrol movement towards it.
  2. Fixed waypoint patrol: It will go to the next position that it was supposed to go before it went on chasing the player.
  3. Stationary patrol: It will go back to it’s original guarding position & stay there.

Update I (v1.1) [Compatible with Unreal Engine v4.11] project files are now available in the Marketplace. Since this update brings about a lot of changes, both in terms of new features as well as the improvements over the previous v1.0 implementation, the update has been released only for Unreal Engine v4.11. This ensures that anyone who wants to keep using the v1.0 implementation can still download the v4.10 project files from the Marketplace. Listed below is a brief overview of the code changes in the update:

  • Dynamic Vision Arcs & Laser Tracking system are now implemented through the use of custom components & interfaces. The component based design provides improved modularity & enables easy attachment to different classes.

  • Added Turret Bot AI. Uses the new Laser Tracking component to acquire & lock on to targets. [Preview Video: https://www.youtube.com/watch?v=9uOBp0Tnk34]

  • Gadget Selection menu at level start enable players to select custom loadouts. Gadgets populated as HUD elements dynamically based on information specified in the Gadget Data Array. [Preview Video: https://www.youtube.com/watch?v=1FJeg6V7iek]

  • The new Gadget Data Array controls the important parameters of all available gadgets from a central location.

  • The Camera Bot now triggers timed alarm loops instead of single alarm as long as player character is within vision range.

  • Replaced Camera Jammer with an EMP that can temporarily deactivate both camera & turret bots.

  • Laser Tracking component added to Ranged Patrol bot to improve over the existing targeting system.

  • Improved aesthetic feedback for peripheral range display. The peripheral range display changes color from white (default) to red based on peripheral alert level, replacing the text render that displayed peripheral threat counter.

  • The patrol bots can now distinguish between different types of noises & handle decision priorities accordingly. Alarm sounds receive higher priority compared to footstep & whistle sounds.

  • Added new suspicious & alarmed states for the patrol bots to create a more realistic design for state changes.

  • The new Vision Arc Optimizer actor provides performance boost by removing rendering calculations for arcs outside the screenspace.

  • Added dynamic operational cost levels enable AI to turn on/off expensive calculations like vision arc updates & threat detection logic on the move based on the requirements.

  • Setter functions implemented to enable variables changes to occur only from within their parent objects.

  • Improved code standardization & optimization implemented across all classes.

All changes within the blueprints are marked with the boolean variable ‘Version1.1’ in order to easily identify the workflow changes introduced with this update. Comments are also written to describe the major changes. The new variables as well as functions added to existing blueprints are also marked in the event graph as shown below:

717721adaf40f2468987c36839b8c8114bce8b24.jpeg


Changes in the Content Browser:

  • New default HUD class added: BP_PlayerHUD.

  • New default Game Instance class added: BP_TDSTGameInstance.

  • Removed BP_EnemyAI_Parent class.

  • Added new stationary enemy AI class: BP_StationaryAI_Turret.

  • BT_PatrolEnemyAI, & BTT_SearchCurrentLocation renamed to ‘BT_PatrolAI’, BTT_SetNewPatrolLocation & BTT_InspectCurrentLocation respectively.

  • Removed BT Tasks BTT_AimAtPlayer & BTT_ExecutePatrolMovement.

  • Added new BT Tasks BTT_KeepTargetInFocus, BTT_SetActiveThreat, BTT_SetNewPatrolLocation, BTT_SetNewTargetLocation & BTT_TakeAimAtTarget.

  • BP_StationaryEnemyAI_Camera & BP_StationaryEnemyAI_Parent renamed to BP_StationaryAI_Camera & BP_StationaryAI_Parent respectively.

  • Added new custom components: BPC_AutomatedLaserTracker & BPC_VisionArcVertexManager.

  • Added new enums: EHUDState, ENoiseType & EOperationCostLevel.

  • Removed enum Enum_PlayerSkills.

  • Added new class BP_VisionArcOptimizer.

  • Added new widgets: Widget_GadgetSelectionButton, Widget_GadgetsGridPanel & Widget_LoadoutMenu.

  • ‘BB_PatrolEnemyAI’, 'BP_AIController_PatrolEnemyAI, 'BP_PatrolEnemyAI_Melee, BP_PatrolEnemyAI_Parent, & BP_PatrolEnemyAI_Ranged renamed to BB_PatrolAI, BP_AIController_PatrolAI, BP_PatrolAI_Melee, BP_PatrolAI_Parent, & BP_PatrolAI_Ranged respectively.

  • Enum_PatrolAIClass, Enum_PatrolAIState, Enum_PatrolType, Enum_PlayerGadgets, Enum_StationaryAIClass & Enum_StationaryAIState renamed to EPatrolAIClass, EPatrolAIState, EPatrolType, EGadgets, EStationaryAIClass & EStationaryAIState respectively.

Hey,
Great template and I’m hoping to migrate the Ai to my top down (point & click game). I want to place the PatrolAi into my map so that they wonder around, attacking the top down character units (& eventually buildings) in the game. If I place the patrolAi straight into the new game they don’t move, so obviously I need to re-configure the BP’s. Do you have any suggestions? Even placing the Patrol Ai into the default top down doesn’t work out so I would like to pinpoint which BP’s I can migrate>adapt to create the movement and default actions as per the demo.

I have tried a bunch of tutorials and even looked into other Ai systems documentation but there doesn’t seem to be any info on migrating characters beyond simply retargeting animations of characters. If I do get this working I will definitely make a tutorial because there should be more info for migrating(merging) marketplace content into a game with a mix BP assets. :slight_smile:

Hi Owen, thanks for your feedback. : ) I tried migrating the assets to the Top Down Template as well & as you said, the patrol bot does not move. This is because it’s doing a couple of casts to the default toolkit game mode and player character [see attached screenshot] to hold references to these objects for later use without further casts.

If you replace both those casts with your new Top Down Game Mode & Player Character, the bot will start doing it’s patrol when you start the game. You won’t have to do any sort or retargeting unless you’re using a different skeletal mesh. All the changes that would need to be made will be centered around using replacements classes for the existing classes in the toolkit like Game Mode, Player Character, etc.

Also make sure that you’re migrating all files including the Behavior Trees & tasks in the ‘PatrolEnemyAI’ folder. You might notice that the Engine asks you whether you want to transfer a whole bunch of other classes & enums apart from the ones you selected. Some of them are actually necessary, while others are getting dragged along for the ride just because a class like Game Mode gets imported which in turn might have references to the said classes. Just press ok for now. Once you have them all in the new project, you can replace the classes with your own classes & delete the ones that are not required. You can check out the list below to get started in that direction:

  1. Among the migrated folders, Keep the ‘Animations’, ‘Character’, ‘Material’, ‘Meshes’ & ‘Particles’ folder as they are. There’s no blueprint logic in any of those folders. Keep all the classes in the folder ‘PatrolEnemyAI’ as well. These are the ones that you actually require.
  2. If you want to use your own game mode & player character class, replace all references to the ‘existing toolkit gamemode, player character & player controller classes’ within all Patrol AI blueprints with the ones that you created for your new project. Delete all three classes once you’ve made the replacements.

[The following classes are all unnecessary; They were migrated because of links from player controller, character or game mode classes]
3. Remove all references to the enums ‘EGadgets’, ‘EHUDState’ & ‘EStationaryAIState’ & then delete these enums as well.
4. Remove all references to the blueprints ‘BP_StationaryAI_Parent’, ‘BP_PlayerHUD’, ‘BP_SaveGame’, ‘BP_TDSTGameInstance’, ‘Widget_GadgetSelectionButton’, ‘Widget_GadgetsGridPanel’, ‘Widget_GameOverHUD’, ‘Widget_LoadoutMenu’, ‘Widget_TopDownHUD’, ‘BP_ProximityShockMine’, ‘BP_AimPlane’, ‘BP_ExitPoint’ & ‘BP_Gems’ & delete these classes.
5. Remove all references to the struct ‘Struct_GadgetData’ & delete it.

If you have more doubts about the migration process, let me know. And thanks for pointing this out. I’ve added this post to the FAQ section so that it can help others who might want to do the same. I’ll try to make some structural changes to the toolkit in the v4.12 update so that the migration process becomes a smoother experience.

Hey, I love this kit. Got it today and have made some good progress learning it. I have my own player character and melee character working “mostly”. They all walk, follow paths, react to camera and foot step sounds, but there are a couple things I can’t figure out:

  1. The custom melee characters do not see the player in the view cone at all. The do sense the player in the small white circle around the enemy. I have made the cone small and large and have no change.
  2. Even when detected in the small white circle and touching the player, nothing happens. If I walk out of the small white circle they go back on patrol without damaging the player or ending the level.

EDIT: I should have stated I created the customer character by creating a child of the BP_AI_Patrol_Parent class (Hope i spelled that right).
EDIT2: I feel like an idiot. I was extending the wrong class. Sorry. Everything is working good now. I just have to figure out why one of my guys has a blue chest and the other doesn’t but that’s my issue I think.
Thanks in advance,

Hi Raymond, very glad to hear that you’re having fun. I think I understand what’s been causing the issue. If you take a look at the Patrol AI Parent class, you would see a component named ‘VisionArcBounds’.

7516d19872abd7c21d111162db57a829609c244e.jpeg

It’s basically a box collision component to identify obstacles in the close vicinity of the bot. Now normally we wouldn’t require an overlap check to detect obstacles, since the AI already has the functionalities to search for player and identify if it’s within range. But since we’re using vision arcs in this scenario, which runs on really expensive calculations, I decided to use the VisionArcBounds box to turn on/off vision arc calculations on the move. This makes sure that unless an AI Bot has detected any obstacles within the box, it will not do any expensive calculations.

Now if you take a look at the Melee bot blueprint, you would find that the VisionArcBounds has been adjusted to be a bit larger than the vision arc range. For all units using the vision arc, I’ve made sure that the box component extends 20 units longer in all directions from the vision arc. So with the melee bot having a vision range of 300, the length of the box will be 300 + 20x2=340 units. Hence the box extent will be 340/2 = 170 units in the local x axis.

Right now, you would have to manually change the size of this VisionArcBounds box everytime you change the vision arc radius or angle. I’m working on the v1.2 update for the toolkit & it will include the feature to automatically adjust the box size based on the vision arc that you set. So you would only have to make a single change & the bot will take care of the rest.

Thank you very much for the explanation. This will help when I start to create other types of entities as well. Like droids and ROV’s.

This may not be related to your pack, but any chance you may know what is causing one out of three of my characters to have either a red or blue trans parent material? Almost like a team material index is in the blueprint but I can’t find one anywhere. The other two blueprints I created children for, player and ranged character work with no problem at all. I have also tried a few other materials to see if that was the issue but no matter what it comes up either blue or red on the chest and see through.

Here is what the skeletal mesh looks like:
93e292d865a81fb438a8283555878bc85b936a37.jpeg

And here is what the same character looks like in the blueprint:
9ddf8eb49fff645e3074c4020ceadcd59aa0a01e.jpeg

I don’t have access to my computer right now, but I believe that it’s happening because the melee and ranged bot classes contain some logic to display blue and red colors at the center of their upper torso. It was made that way to distinguish between them. You can remove this logic from the construction scripts of the melee and ranged bot. It’s just a couple of nodes that set the color using a material instance.