ProgrammingPro #83: Unreal Engine 5's AI Perception, Fil-C's Memory Safety for C++, Go's AI Evolution, and Python In-Memory Computing
Scale your scrapers with Apify’s Black Friday Boost plan!
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!
Welcome to this week’s edition of ProgrammingPro!
In today’s Expert 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:
Researchers develop Python code for in-memory computing — in-memory computation comes to Python code🧠
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
P.S.: This month's survey 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.
🗞️News and Analysis🔎
Java News Roundup: Spring Framework 6.2, OpenJDK JEPs, Micronaut 4.7, Gradle 8.11: Other highlights include Project Reactor 2024.0.0, with enhancements spanning dependency upgrades and other new features.
Rust haters, unite! Fil-C aims to Make C Great Again: Fil-C, a memory-safe variant of C and C++ developed by Filip Pizlo aims to address memory safety vulnerabilities, without requiring developers to learn a new language.
F# 9 adds nullable reference types: The version also introduces empty-bodied computation expressions, and standard library enhancements like random sampling and shuffling functions.
Go language evolving for future hardware, AI workloads: The Go team is working on improving garbage collection, introducing hardware-efficient features, and integrating AI SDKs like LangChainGo.
Rust Foundation moves forward on C++ and Rust interoperability: The initiative focuses on enhancing tools, building consensus for long-term solutions, and collaborating with the C++ community to address challenges.
JetBrains releases IntelliJ IDEA 2024.3 and other IDEs, still struggles to convince devs of benefits of new UI: Updates have been made to PHPStorm, PyCharm, and GoLand. Improvements include Logical code structure view.
Uno Hot Design aims to meet demand for a visual designer for modern .NET: Hot Design is a visual design tool in the Uno Platform Studio suite to address the lack of a designer for modern .NET development, including WinUI.
🎓Tutorials and Learning Resources💡
Python
🗞️Researchers develop Python code for in-memory computing — in-memory computation comes to Python code: Technion researchers have developed PyPIM, a tool that translates Python code into machine code for in-memory computing, enabling programmers to use Python without adaptation.
For more Python resources, go to PythonPro
C# and .NET
🎓Tutorial | Events and Delegates in C#: Covers the definition, implementation, and practical use of events and delegates in C#, including their benefits, use cases, and challenges, with examples and best practices.
💡C# 13 and .NET 9: Personal Highlights: Reviews highlights of C# 13 and .NET 9, including enhanced performance, AI integration, improved
paramscollections, new thread synchronization tools, and implicit index access.🎓Tutorial | Mastering Divide and Conquer (D&C): A Fundamental Algorithmic Paradigm: Explains the paradigm, detailing its practical applications with examples like Merge Sort and curated LeetCode problems.
C and C++
💼Case Study | Retrofitting spatial safety to hundreds of millions of lines of C++: Outlines Google's efforts to enhance spatial memory safety in its vast C++ codebase by retrofitting hardened libc++ with bounds checking.
🎓Tutorial | Non-allocating Circular Buffer in C++: Explains circular buffers in C++, highlighting their fixed capacity and ability to overwrite the oldest data when full.
🎓Tutorial | You can use C-Reduce for any language: Demonstrates the versatility of C-Reduce, a tool initially designed to minimize C compiler bug reproducers, with an example involving RustPython.
Java
🎓Tutorial | A Basic Introduction to the Classfile API: Introduces the Classfile API, providing a basic guide to generating JVM bytecode by constructing class files programmatically.
🎓Tutorial | The Ultimate Linked List Guide: Become a Hero with All Methods and Theory in Java (Part-2): Introduces methods for inserting nodes at the start, end, or a specific index in the list to maintain the structure.
💼Case Study | Java Backend Observability with OpenTelemetry Traces and Minimal Code: Explores how the MY.GAMES team integrated OpenTelemetry into their Java backend for Rush Royale to improve system observability.
JavaScript and TypeScript
🎓Tutorial | Importing a frontend Javascript library without a build system: Covers the three main types of JavaScript files (classic, ES Modules, and CommonJS), their characteristics, and methods for importing them.
🗞️Meet Angular v19: Key updates include incremental hydration for server-side rendering, event replay stabilization, route-level render modes, and experimental zoneless support.
💼Case Study | Adopting Bazel for Web at Scale: details Airbnb's migration of its large-scale web monorepo to Bazel, highlighting challenges, custom solutions, and performance gains in CI processes and developer workflows.
Go
🎓Tutorial | Constraints in Go: Explores constraints as tools for enhancing type safety and functionality in generic programming by defining permissible operations for types through method sets, unions, and approximations.
🎓Tutorial | Testing with Go and PostgreSQL: ephemeral DBs: Explains how to integrate ephemeral PostgreSQL instances into Go testing workflows, optimizing setup for convenience, resource efficiency, and reduced test times.
Rust
🎓Tutorial | Speeding up the Rust edit-build-run cycle: Showcases steps like using faster linkers (e.g., Mold), minimizing debug information, and creating non-position-independent executables.
🎓Tutorial | Build your own SQLite, Part 3: SQL parsing 101: Introduces tokenization and parsing concepts, implements a tokenizer to process SQL strings, defines an AST structure for SQL statements, and more.
Swift
🎓Tutorial | Syntax Highlighting SwiftUI Code with Swift Syntax: Demonstrates how to implement native SwiftUI syntax highlighting in an app using the
swift-syntaxlibrary.🎓Tutorial | MainActor usage in Swift explained to dispatch to the main thread: Explains the usage of
@MainActorin Swift, a global actor introduced in Swift 5.5 to ensure tasks are executed on the main thread.
PHP
📜Fuzzing the PHP Interpreter via Dataflow Fusion: Presents FlowFusion, the first automated fuzzing framework, validated by PHP developers, tailored to detect memory errors in the PHP interpreter.
🗞️PHP 8.4.0 Released!: The major update introduces property hooks for computed properties, asymmetric visibility for enhanced property access control, the #[\Deprecated] attribute for user-defined deprecation warnings, and more.
SQL
💼Case Study | Presto® Express: Speeding up Query Processing with Minimal Resources: Delves into Uber's Presto Express which optimizes short-running SQL queries and reduces end-to-end SLA.
💡SQL Style Guide: Covers best practices for naming conventions, query syntax, and formatting, aiming to enhance code clarity and facilitate collaboration among developers.
Ruby
🗞️2024 Ruby on Rails Community Survey Results: Highlights include a growing focus on maintaining applications with the latest Ruby and Rails versions despite challenges like dependency management.
💡Elixir-like pipes in Ruby (oh no not again): Explores an experimental implementation of an Elixir-style pipe operator in Ruby, leveraging abstract syntax tree (AST) transformations to enable pipeline-style coding.
Kotlin
🗞️State of Kotlin Scripting 2024: Highlights that while Kotlin scripting remains a vital part of the Kotlin ecosystem, its adoption has been limited.
🎓Tutorial | Understanding Properties in Kotlin: Covers mutable and read-only properties, custom getters and setters, backing fields, compile-time constants, late-initialized properties, and delegated properties.
🌟Best Practices and Advice🚀
Transforming Legacy Healthcare Systems: A Journey to Cloud-Native Architecture: Examines the challenges of modernizing legacy healthcare systems into cloud-native architectures, using Livi's transformation of its MJog platform as an example.
Clean Architecture: The Missing Chapter: Critiques traditional layer-based structures for scattering related components, advocating instead for organizing code by features or components.
To Dare or Not to Dare: the MVA Dilemma: Explores the challenges of balancing business and technical risks when developing a Minimum Viable Product (MVP) and its supporting Minimum Viable Architecture (MVA).
How I Used Event-Driven Architecture in the Wrong Way: Reflects on the challenges of implementing event-driven architecture, highlighting issues such as managing two-way communication and handling complex event chains.
🧠Expert Insight📚
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.
Presenting the Perception System
...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
their virtual environment.
At the core of the AI Perception System are senses and stimuli. 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 the game world.
As an example, sight sense is preconfigured to detect any visible pawn actors, while damage sense triggers when the associated AI controller’s pawn takes damage from an external source.
Note
As a developer, you can create custom senses tailored to your game’s specific needs by extending the AISense class, if you are working with C++, or the AISense_Blueprint class, if you are working with Blueprints.
Presenting the Perception System
The AI Perception System consists of the following main classes:
AIPerceptionSystem: This is the core manager that keeps track of all AI stimuli sources.AIPerceptionComponent: This represents the AI agent’s mind and handles processing perceived stimuli. It needs to be attached to an AI controller to properly work.AIPerceptionStimuliSourceComponent: This component is added to actors that can generate stimuli and is in charge of broadcasting perception data to listening elements.AIPerceptionSenseConfig: This defines the properties of a specific sense, what actors can be perceived, and how perception decays over time or distance.
When an actor with AIPerceptionStimuliSourceComponent generates a stimulus, nearby AIPerceptionComponents detect it through their configured senses. This perceived data is then processed by the AI controller to trigger desired behaviors.
Once you have added AIPerceptionComponent to an AI controller, you will need to add one or more AIPerceptionSenseConfig elements in order to give your AI agent dedicated senses. Figure 10.1 shows an example where perception is based on touch:
Figure 10.1 – The touch sense config
From the previous screenshot, you may have noticed a Dominant Sense property; this property allows you to designate a specific sense that takes priority over others when determining the location of a sensed actor.
Let’s explore the available sense configs that, as mentioned earlier, define the properties of each specific sense:
AIPerceptionSenseConfig types
Unreal Engine offers a range of predefined AIPerceptionSenseConfig classes that are highly likely to meet your specific requirements. Let’s take a look at the available options:
AIDamage: Use this configuration if your AI agent needs to respond to damage events such as Any Damage, Point Damage, or Radial DamageAIHearing: Use this configuration if you need to detect sounds generated in the surrounding environmentAIPrediction: Use this configuration when you need to predict the target actor location in the next few momentsAISight: Use this configuration when you want your AI agent to see things in the levelAITeam: Use this configuration if you want to notify the AI agent that some ally is nearbyAITouch: Use this configuration when the AI agent touches some other actor or, vice versa, when something is touching the AI agent
Stimuli source
The AIPerceptionStimuliSourceComponent 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 the game level.
A stimuli source can be registered – or unregistered – for a sense, making it detectable – or undetectable – by the Perception System.
Artificial Intelligence in Unreal Engine 5 was published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!
Get the eBook for $39.99 $27.98
🛠️Useful Tools⚒️
fast-graphrag: A cost-efficient, dynamic, and interpretable framework for building scalable, agent-driven retrieval-augmented generation pipelines.
pglite-fusion: A PostgreSQL extension that embeds SQLite databases into table columns, offering streamlined multitenancy and efficient data isolation.
fireproof: An open-source live-update database enabling real-time collaboration, seamless integration with any stack, and deployment anywhere.
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 useful here.
If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want to advertise 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 survey or leave a comment below!




