





















































Get a 30% prepaid usage bonus on Apify this Black Friday. Scrape data for app integrations, performance tracking, competitive research, or custom pipelines. Use pre-built scrapers, build your own from scratch, or use quick-start code templates.
The Boost plan ends December 5 - grab it while you can!
Hi ,
Welcome to this week’s edition of ProgrammingPro!
In today’sExpert Insight, we bring you an excerpt from the recently published book, Artificial Intelligence in Unreal Engine 5, which introduces Unreal Engine 5's AI Perception System, detailing its components, predefined sense configurations, and how developers can use or customize it.
News Highlights: Fil-C tackles memory safety in C/C++ without requiring a new language; Go advances for AI and hardware efficiency with improved garbage collection; Rust Foundation enhances C++ interoperability with better tools and collaboration; and F# 9 introduces nullable reference types, computation expressions, and library upgrades.
My top 5 picks from today’s learning resources:
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
P.S.:This month'ssurvey is still live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.
params
collections, new thread synchronization tools, and implicit index access.swift-syntax
library.@MainActor
in Swift, a global actor introduced in Swift 5.5 to ensure tasks are executed on the main thread.Here’s an excerpt from “Chapter 10: Improving Agents with the Perception System" in the book, Artificial Intelligence in Unreal Engine 5 by Marco Secchi, published in October 2024.
...One of the key components when creating intelligent and reactive AI agents in Unreal Engine is the AI Perception System; this powerful system allows AI controllers – and, consequently, AI agents – to perceive and respond to different stimuli in
theirvirtual environment.
At the core of the AI Perception System aresensesandstimuli. A sense – such as sight or hearing – represents a way for an AI agent to perceive its surroundings and is configured to detect specific types of stimuli, which are sources of perception data emanating from other actors in thegame world.
As an example,sight senseis preconfigured to detect any visible pawn actors, whiledamage sensetriggers when the associated AI controller’s pawn takes damage from anexternal source.
Note
As a developer, you can create custom senses tailored to your game’s specific needs by extending theAISense
class, if you are working with C++, or the AISense_Blueprint
class, if you are workingwith Blueprints.
The AI Perception System consists of the followingmain classes:
AIPerceptionSystem
: This is the core manager that keeps track of all AIstimuli sources.AIPerceptionComponent
: This represents the AI agent’s mind and handles processing perceived stimuli. It needs to be attached to an AI controller toproperly work.AIPerceptionStimuliSourceComponent
: This component is added to actors that can generate stimuli and is in charge of broadcasting perception data tolistening elements.AIPerceptionSenseConfig
: This defines the properties of a specific sense, what actors can be perceived, and how perception decays over timeor distance.When an actor withAIPerceptionStimuliSourceComponent
generates a stimulus, nearbyAIPerceptionComponents
detect it through their configured senses. This perceived data is then processed by the AI controller to triggerdesired behaviors.
Once you have addedAIPerceptionComponent
to an AI controller, you will need to add one or moreAIPerceptionSenseConfig
elements in order to give your AI agent dedicated senses.Figure 10.1shows an example where perception is basedon touch:
Figure 10.1 – The touch sense config
From the previous screenshot, you may have noticed aDominant Senseproperty; this property allows you to designate a specific sense that takes priority over others when determining the location of asensed actor.
Let’s explore the available sense configs that, as mentioned earlier, define the properties of eachspecific sense:
Unreal Engine offers a range of predefinedAIPerceptionSenseConfig
classes that are highly likely to meet your specific requirements. Let’s take a look at theavailable options:
AIDamag
e: Use this configuration if your AI agent needs to respond to damage events such asAny Damage,Point Damage, orRadial DamageAIHearing
: Use this configuration if you need to detect sounds generated in thesurrounding environmentAIPrediction
: Use this configuration when you need to predict the target actor location in the nextfew momentsAISight
: Use this configuration when you want your AI agent to see things inthe levelAITeam
: Use this configuration if you want to notify the AI agent that some allyis nearbyAITouch
: Use this configuration when the AI agent touches some other actor or, vice versa, when something is touching theAI agentTheAIPerceptionStimuliSourceComponent
class allows an actor to register itself as a source of stimuli for one or more senses. For instance, you can register an actor as a stimuli source for sight. This registration allows an AI agent to visually perceive the actor in thegame level.
A stimuli source can be registered – or unregistered – for a sense, making it detectable – or undetectable – by thePerception System.
Artificial Intelligence in Unreal Engine 5was published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!
That’s all for today.
We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.
If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.
If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, take the surveyor just respond to this email!