How To Create The Hitman Suspicion Meter In Unreal Engine 4/5 | Far Cry Detection System | Part 1/3

Matt Aspland
15 Sept 202215:04

Summary

TLDRIn this tutorial, the creator demonstrates how to build a dynamic AI detection system using Unreal Engine 4 and 5, inspired by games like *Far Cry* and *Hitman*. The system enables the AI to detect the player over a brief period before fully engaging, giving players a chance to evade or hide. It includes a visual detection indicator above the player's head that fills up as the AI spots them. The video covers the necessary blueprint interface, widget creation for the detection indicator, and AI setup, while focusing on efficient player-AI communication. The tutorial is split into two parts, with part one covering the foundational setup.

Takeaways

  • 😀 Create a blueprint interface to allow communication between AI and the player for detection and chase logic.
  • 😀 Use a progress bar in the UI to visually represent the player's detection status with an indicator that fills up as the AI detects them.
  • 😀 The detection system includes a short delay (0.5 seconds) before fully detecting the player, giving them a chance to escape.
  • 😀 The detection indicator starts gray, then fills with white as the detection progresses, turning red when fully detected.
  • 😀 The AI does not stop chasing the player until the detection meter resets or the player hides again.
  • 😀 A visual indicator for detection helps the player understand when they're being seen, adding tension to the gameplay.
  • 😀 Create the AI blueprint with Pawn Sensing for detecting the player, adjusting the sight radius, and sensing interval for better responsiveness.
  • 😀 The AI's detection logic uses a 'do once' node to prevent redundant calls and ensure the detection only starts once when the AI first sees the player.
  • 😀 Use a 're-triggerable delay' to ensure the AI stops detecting the player after a set period (like 0.5 seconds) without seeing them.
  • 😀 To implement the chase logic, a boolean flag (should chase) is used to determine when the AI should pursue the player after detection.
  • 😀 In the AI blueprint, the detection system is connected with the player blueprint via interfaces, allowing for interaction between the two characters during the detection and chase process.

Q & A

  • What is the purpose of the detection system discussed in the tutorial?

    -The detection system allows AI to detect the player after looking at them for a few seconds. This gives the player a few extra seconds to react or escape before being fully detected, similar to systems seen in games like Far Cry and Hitman.

  • What visual indicator is used to show the player's detection status?

    -The visual indicator used is a progress bar that fills as the AI detects the player. The bar turns red when the player is fully detected, and if the player hides again, it resets accordingly.

  • What happens if the AI fully detects the player?

    -If the AI fully detects the player (when the progress bar turns red), the AI will start chasing the player. If the player hides again, the AI continues chasing until the detection is cleared.

  • How is the detection indicator created in Unreal Engine?

    -The detection indicator is created as a widget with a progress bar. The background image is set to a 'detection meter empty' image, while the fill image is set to a 'detection meter full' image. The progress bar is resized, and its fill type is set to 'center horizontal' to mimic the detection fill effect.

  • What blueprint interface functions are created for the detection system?

    -The detection system creates four functions in a blueprint interface: 'Start Detection,' 'Stop Detection,' 'Start Chase,' and 'Stop Chase.' These functions handle the detection process and allow communication between the AI and the player.

  • What is the role of the 'Pawn Sensing' component in the AI setup?

    -The 'Pawn Sensing' component allows the AI to detect the player. It provides properties like sight radius and peripheral vision angle, which determine how the AI senses the player. Additionally, it includes an event for when the AI sees a pawn (player).

  • Why is a 'retriggerable delay' used in the AI detection logic?

    -The 'retriggerable delay' is used to prevent constant detection if the AI loses sight of the player. It allows a certain period (0.5 seconds in this case) to pass before stopping the detection if the player is no longer in the AI's sight.

  • What does the 'do once' node do in the AI detection system?

    -The 'do once' node ensures that certain actions, such as starting detection, are only performed once when the AI first detects the player. This prevents repeated triggers of the same detection event.

  • How is the 'chase' behavior implemented in the AI?

    -The chase behavior is controlled by a boolean variable called 'should chase.' When the player is detected and this variable is set to true, the AI will start moving towards the player using the 'AI Move To' node.

  • What happens if the AI loses sight of the player during the chase?

    -If the AI loses sight of the player, the detection is stopped, and the AI will stop chasing. The logic ensures that the chase only continues if the player remains detected.

Outlines

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Mindmap

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Keywords

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Highlights

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Transcripts

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن
Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
Unreal EngineAI detectiongame tutorialUE4 tutorialUE5 tutorialplayer detectionAI chaseprogress bargame mechanicsindie gamegame development
هل تحتاج إلى تلخيص باللغة الإنجليزية؟