Mastering AI Game Development with Unreal
()
About this ebook
Related to Mastering AI Game Development with Unreal
Related ebooks
Multiplayer Game Development with Unreal Engine 5: Create compelling multiplayer games with C++, Blueprints, and Unreal Engine's networking features Rating: 0 out of 5 stars0 ratingsGame Development Patterns with Unreal Engine 5: Build maintainable and scalable systems with C++ and Blueprint Rating: 0 out of 5 stars0 ratingsBecoming Comfortable with Unity Rating: 0 out of 5 stars0 ratingsUnity 3D Game Development: Designed for passionate game developers—Engineered to build professional games Rating: 0 out of 5 stars0 ratingsFirst Steps in Unreal: Building Your First Game: Mastering Unreal Engine: From Novice to Pro Rating: 0 out of 5 stars0 ratingsIT Cost Optimization A Complete Guide - 2021 Edition Rating: 0 out of 5 stars0 ratingsASP.NET 8 Best Practices: Explore techniques, patterns, and practices to develop effective large-scale .NET web apps Rating: 0 out of 5 stars0 ratingsSimultaneous multithreading A Complete Guide Rating: 0 out of 5 stars0 ratingsMastering Computer Programming: A Comprehensive Guide Rating: 0 out of 5 stars0 ratingsKubernetes from basic to advanced levels Rating: 0 out of 5 stars0 ratingsThe Unreal Developer's Guide: Intermediate Challenges: Mastering Unreal Engine: From Novice to Pro Rating: 0 out of 5 stars0 ratingsGoing Indie: A complete guide to becoming an independent software developer Rating: 0 out of 5 stars0 ratingsDesign for Software: A Playbook for Developers Rating: 4 out of 5 stars4/5Enterprise Architecture at Work: Modelling, Communication and Analysis Rating: 2 out of 5 stars2/5Retro Gaming with Raspberry Pi: Nearly 200 Pages of Video Game Projects Rating: 0 out of 5 stars0 ratingsJetpack Compose 1.5 Essentials: Developing Android Apps with Jetpack Compose 1.5, Android Studio, and Kotlin Rating: 0 out of 5 stars0 ratingsCode review Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsInstant StyleCop Code Analysis How-to Rating: 0 out of 5 stars0 ratingsMastering Three.js: A Journey Through 3D Web Development Rating: 0 out of 5 stars0 ratingsGeometry for Programmers Rating: 0 out of 5 stars0 ratingsASP.NET Core in Action, Third Edition Rating: 0 out of 5 stars0 ratingsConstruct 2 Game Development by Example Rating: 0 out of 5 stars0 ratingsVulkan Fundamentals: A Beginner's Guide: Vulcan Fundamentals Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Midjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5ChatGPT 4 $10,000 per Month #1 Beginners Guide to Make Money Online Generated by Artificial Intelligence Rating: 0 out of 5 stars0 ratingsChatGPT For Dummies Rating: 4 out of 5 stars4/52084: Artificial Intelligence and the Future of Humanity Rating: 4 out of 5 stars4/5101 Midjourney Prompt Secrets Rating: 3 out of 5 stars3/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/5Nexus: A Brief History of Information Networks from the Stone Age to AI Rating: 4 out of 5 stars4/5THE CHATGPT MILLIONAIRE'S HANDBOOK: UNLOCKING WEALTH THROUGH AI AUTOMATION Rating: 5 out of 5 stars5/5AI for Educators: AI for Educators Rating: 5 out of 5 stars5/5Writing AI Prompts For Dummies Rating: 0 out of 5 stars0 ratingsCo-Intelligence: Living and Working with AI Rating: 4 out of 5 stars4/5The Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5The Roadmap to AI Mastery: A Guide to Building and Scaling Projects Rating: 3 out of 5 stars3/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Artificial Intelligence For Dummies Rating: 3 out of 5 stars3/5Killer ChatGPT Prompts: Harness the Power of AI for Success and Profit Rating: 2 out of 5 stars2/5A Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5ChatGPT For Fiction Writing: AI for Authors Rating: 5 out of 5 stars5/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 3 out of 5 stars3/5
Reviews for Mastering AI Game Development with Unreal
0 ratings0 reviews
Book preview
Mastering AI Game Development with Unreal - Hrishikesh Andurlekar
CHAPTER 1
Introduction to Unreal Engine
Introduction
In the realm of game development, artificial intelligence plays an important role in creating immersive and dynamic virtual worlds. Unreal Engine, a powerhouse in the industry, offers a robust suite of AI tools that empower developers to breathe life into their digital creations, whether they are complex enemies or simple NPCs. This book delves into the intricate AI systems within Unreal Engine, exploring essential components such as navigation, behavior trees, blackboards, and perception systems. We will also uncover the potential of state trees, Environment Query Systems, Smart Objects, and the groundbreaking Mass AI. Whether you are a seasoned developer or a curious newcomer, this comprehensive guide will equip you with the knowledge to harness Unreal Engine’s AI capabilities and elevate your game development projects to new heights.
Structure
In this chapter, we will cover the following topics:
Brief History of Unreal Engine
Overview of Unreal Engine
Installing Unreal Engine
Understanding the Unreal Engine Interface
Brief History of Unreal Engine
Unreal Engine is a powerful game development platform that has significantly influenced the gaming industry and beyond, stretching its capabilities into film, television, architecture, automotive, and other fields.
Tim Sweeney, the founder of Epic Games, started developing the first official game from Epic Mega Games at the age of twenty-one. This game, called ZZT, was an abstract dungeon puzzler and was distributed as shareware.
Figure 1.1: ZZT dungeon puzzler
ZZT was written in Turbo Pascal using an object-oriented programming style. This idea of object-oriented programming was not new, but games of that era did not use that workflow and every game would be built from the ground up. Implementing OOP in a game allowed significant user modification and laid out a framework for the concept of a game engine.
Epic Games released the first-person shooter game, "Unreal. This game was the first to utilize the Unreal Engine in a public setting, showcasing revolutionary graphics, superior gameplay mechanics, and an immersive 3D world. The success of
Unreal" cemented Epic Games’ position in the gaming industry and provided the foundation for the subsequent development and release of the Unreal Engine.
Unreal Engine 2 was introduced in 2002, marking a new era in game development with its enhanced features, including superior rendering capabilities, high-quality graphics, improved physics, and support for PlayStation 2, Xbox, and GameCube. Unreal Editor, which allowed developers to construct complex virtual environments. The first game to showcase Unreal Engine 2 was America’s Army.
In 2006, Epic Games released Unreal Engine 3. This new engine brought about several significant advancements, including the introduction of the Unreal Development Kit (UDK), which allowed independent game developers and hobbyists access to a version of the engine for the first time.
Figure 1.2: The Unreal Development Kit
Unreal Engine 3 also leveraged advancements in hardware technology supporting the coming generation of HD consoles. Tools such as Matinee (now Sequencer) and Kismet (now Blueprints) allowed level designers a lot of freedom, reducing their dependency on programmers.
However, the most significant transformation in Unreal Engine’s history came with the release of Unreal Engine 4 in 2014. Epic Games shifted its business model, making the engine available to anyone for a nominal fee and a percentage of game sales. Unreal Engine 4 was packed with features designed to streamline development processes and enhance visual quality, including physical based rendering, a visual scripting system called Blueprints (successor to Kismet), and comprehensive tools for creating immersive virtual and augmented reality experiences. In March 2015, Epic released Unreal Engine 4 for free to everybody, with a requirement of 5% of revenue for products that make more than $3000 per quarter.
In April 2022, Epic Games released Unreal Engine 5, featuring its Nanite and Lumen technologies, designed to deliver photorealistic graphics and dynamic lighting effects.
Over the years, Unreal Engine has been used to create some of the most popular games in the industry, such as the "Gears of War series,
Fortnite, and
Street Fighter V. But its influence extends far beyond gaming. It has been used to create visual effects in television series such as
The Mandalorian" and in architectural visualization, product design, and simulations.
The history of Unreal Engine is marked by continual innovation and progress, not just for Epic Games but for the entire realm of interactive 3D content. It has democratized game development, enabling both large studios and independent developers to create stunning, immersive digital experiences, and its future looks just as bright and unreal as its illustrious past.
Overview of Unreal Engine
Unreal Engine, developed by Epic Games, is a comprehensive suite of creative development tools for constructing and rendering 3D graphics. Initially created for first-person shooter games, the engine’s robust capabilities have been expanded and fine-tuned over the years, transforming it into a highly versatile tool used by video game developers, film and television professionals, architects, automotive designers, and others who seek to create high-quality, real-time 3D visuals.
In the world of video game development, Unreal Engine stands as one of the premier choices for both indie developers and AAA studios. Its power lies in its high degree of customization, allowing developers to tailor each project to their specific needs, regardless of genre, platform, or scale.
A crucial advantage of Unreal Engine is its rendering capabilities. The engine’s fully dynamic lighting features, called Lumen, and geometry virtualization technology, called Nanite, enable the creation of stunning and immersive virtual environments.
The engine also incorporates a powerful visual scripting system known as Blueprints. This system allows developers to create game mechanics, interactive elements, and complex functions without the need for extensive coding knowledge. Blueprints empower artists and designers by giving them direct control over the technical aspects of game development, leading to a more collaborative and efficient workflow.
For more complex or unique functionality, Unreal Engine also fully supports coding in C++. This grants seasoned programmers the ability to tweak and extend the engine’s functionality, leading to complete control over a game’s backend mechanics. Access to the engine source code grants unprecedented flexibility to programmers looking to extend Unreal Engine’s functionality.
The incorporation of comprehensive physics and artificial intelligence systems into Unreal Engine permits the simulation of realistic movement and behavior in games. Developers can dictate how characters, objects, and environments react and interact, providing the foundation for compelling gameplay mechanics. This book focuses on the artificial intelligence features of the engine.
Unreal Engine has built-in support for a broad array of platforms, including PCs, consoles, mobile devices, VR, AR, and more. This cross-platform capability is invaluable for developers targeting multiple systems. Unreal Engine also supports multiplayer functionality, with built-in systems to assist in the creation of both cooperative and competitive multiplayer experiences. These systems handle a range of tasks, including character replication, lag compensation, and session management.
In the realm of virtual production, Unreal Engine has become a game-changer, enabling filmmakers to visualize CG environments and characters in real-time. Notably, the technology was used extensively in the production of the Disney+ series "The Mandalorian," helping to create its detailed, immersive worlds.
Unreal Engine also offers comprehensive VR support, providing an array of tools for creating VR experiences. From immersive games to interactive architectural visualizations, Unreal Engine provides the capability to develop within VR itself using VR Mode.
Unreal Engine’s Marketplace offers a vast array of pre-made assets, including 3D models, sounds, animations, and complete project templates. These assets can significantly streamline development processes, allowing developers to focus on creating unique gameplay experiences or visualizations.
Unreal Engine is a highly advanced, versatile development tool designed to create visually stunning and complex 3D experiences. With a broad array of features and capabilities, the engine offers unprecedented control and efficiency to game developers and artists across many disciplines. As technology advances and the demand for high-quality 3D content continues to grow, Unreal Engine remains poised to remain at the forefront of real-time 3D technology.
Installing Unreal Engine
Unreal Engine is available through the Epic Games Launcher, which is the primary method of downloading and updating the Unreal Engine on all platforms, including Windows, macOS, and Linux. Below are the steps to install Unreal Engine on these platforms:
Windows:
Navigate to the official Unreal Engine website (www.unrealengine.com).
Click the Download
button. This will take you to a new page.
Download the Epic Games Launcher Installer for Windows.
After the installer has downloaded, open it, accept the terms of service, and follow the installation prompts.
Once the installation is complete, launch the Epic Games Launcher.
Sign in or create a new Epic Games account on the screen that pops up.
In the left panel, click "Unreal Engine."
Click the Install Engine
button on the top right to install Unreal Engine.
Figure 1.3: The Install button shown when installing the engine for the first time
Accept the End User License Agreement and choose the path to install the Engine.
Figure 1.4: Chose the path to Install the Engine
The Options button will allow you to install additional packs. Click Install to begin the installation.
Figure 1.5: The Installation should begin
After the installation process is complete, you can launch Unreal Engine from the Epic Games Launcher's Library tab.
The first time you launch the engine, you may see the text Prerequisites
on the button. Wait for a few minutes as the engine installs the required software. Unreal Engine should start up after that.
Figure 1.6: Prerequisites text shown during first Launch
macOS:
Navigate to the official Unreal Engine website (www.unrealengine.com).
Click the Download
button. This will take you to a new page.
Download the Epic Games Launcher Installer for macOS.
After the installer has downloaded, open it, accept the terms of service, and follow the installation prompts.
Once the installation is complete, launch the Epic Games Launcher.
Sign in or create a new Epic Games account.
In the left panel, click "Unreal Engine."
Click the Install Engine
button on the top right to install Unreal Engine.
Figure 1.7: Setting the Path on a Mac
After the installation process is complete, you can launch Unreal Engine from the Epic Games Launcher.
Linux:
The installation process on Linux is a bit more involved as the Epic Games Launcher is not natively supported.
Navigate to the official Unreal Engine website (www.unrealengine.com).
Click the Download
button. This will take you to a new page.
Figure 1.8: Linux Download Instructions
On this page, under DOWNLOAD INSTRUCTIONS, you will find a link called View Linux download instructions. Click it to come to the Linux Downloads page. You may be asked to log in to your Epic Account before the page shows up.
Figure 1.9: Linux Download Links
You can download the zip file of the appropriate version of the Engine that you want from the links listed on this page.
Extract the zip files to your preferred installation destination.
To start Unreal Engine, navigate to the folder you extracted the zip file to and run UnrealEditor in the Linux subfolder. For example, if you extracted the zip file in Downloads/UnrealEngine_5.2.1, navigate to the UnrealEngine_5.2.1 folder and then further navigate to /Engine/Binaries/Linux and open the terminal at that location. Type ./UnrealEditor at the terminal command line to run Unreal Engine.
Figure 1.10: Running Unreal Engine on Linux
Remember, Unreal Engine is a large software package, and downloading/installing it will require a substantial amount of time and disk space. Make sure you have a reliable internet connection and adequate storage on your computer.
Understanding the Unreal Editor Interface
Let us begin with a quick tour of the Unreal Editor interface. If you are already familiar with the Unreal Editor interface, feel free to skip this chapter and move on to the next chapter, where we introduce ourselves to blueprints.
Let us start the Unreal Engine Editor by clicking on the Launch button on the appropriate version of Unreal Engine that we wish to work on. In our case, we will be working on Unreal Engine version 5.4. Some parts of the book may have screen shots from Unreal Engine 5.3.
Figure 1.11: Launch Unreal Engine from the Launcher
A splash screen will show up for a brief amount of time. The Unreal Project Browser will then open up. Select the Games section, and then choose the Third Person template. The Third Person template contains a pre-created basic Third Person game for you to start with. This will save us a lot of setup time. We will also be checking the Starter Content check box. This will add some assets, such as meshes, materials, particles, textures, and so on, to the project, which will help us start. We will find these assets under the Starter Content Folder in our projects Content Folder. We will import additional assets as necessary. Choose a suitable project location folder on your disk drive and enter the Project Name. Click the Create button to create a new project.
Figure 1.12: The Unreal Project Browser
The Unreal Engine splash screen will show up again, and this time the Unreal Editor window will open up. The image (img name) shows how the Editor looks once it is opened up.
Figure 1.13: The Unreal Level Editor
This is the default layout of the editor. We will be modifying it slightly for our purposes.
Editor Layout
The Unreal Engine Level Editor provides a comprehensive workspace for creating and editing game levels. Here’s a brief introduction to its layout:
The main window is typically divided into several key areas:
Menu Bar: Provides access to all editor functions and settings through dropdown menus.
Main Toolbar: Offers quick access to common actions and editor modes.
Level Viewport: Central area displaying the 3D level, allowing direct manipulation of objects.
Content Drawer: Organizes and provides access to all assets in your project.
Bottom Toolbar: Contains additional tools and information relevant to the current editor state.
Outliner: Lists all actors in the current level hierarchically.
Details Panel: Shows properties of selected objects and allows for their modification.
Menu Bar
Every editor within Unreal Engine features a menu bar positioned in the upper-right corner of its respective window. While menus such as File, Window, and Help remain consistent across all editors, the contents of the Menu Bar may differ based on the specific editor in use. The following image presents an example of the Menu Bar for the Level editor.
Figure 1.14: The Menu Bar
Main Toolbar
The Main Toolbar within Unreal Editor houses quick access to frequently used tools and commands.
Figure 1.15: The Main Toolbar
The toolbar can be divided into the following sections:
Save and Search button section
The Save button saves the currently open level, while the Browse button browses and selects the currently open Level asset in the Content Browser.
The Mode Selection section
The Mode Selection dropdown menu enables you to open different edit modes for your level.
Figure 1.16: Mode Selection Dropdown
Content Shortcut Buttons
This section contains buttons to add and access various types of content in the Level Editor. These buttons let you add content, including Actors, Blueprints and Cinematics, as well as links to Quixel Bridge and the Unreal Marketplace.
Play Mode Controls
This section contains buttons that let you Play, Skip, Stop, and Eject the gameplay in your editor.
Platforms Menu
This Menu lets you access Options and Settings to help deploy your game on different platforms such as Android, iOS, Windows, and so on.
Settings Dropdown
The Settings dropdown is located at the right-side end of the Main Toolbar. It contains various configuration settings affecting the editor and the performance of your game.
Figure 1.17: The Setting Dropdown menu
You can also reconfigure the layout to display the Place Actors Panel by selecting the Place Actors Panel option in the Quickly Add to the Project
button dropdown menu. The Place Actors panel is similar to the Unreal Engine 4 layout, and a lot of developers continue to prefer that panel.
Figure 1.18: The Place Actors panel
Level Viewport
The Level Viewport lets you edit and display the contents of the opened level. Usually, it shows a Perspective view, but you can change it to Orthographic views or change the display mode to Lit, Unlit, or Wireframe, using the toolbar on the top of the viewport. The viewport toolbar also has buttons for viewport navigation and asset transformation.
Figure 1.19: Level Editor Viewport
Content Drawer
The Content Drawer serves as a file explorer window within your project, displaying all Assets, Blueprints, and other project files. It enables you to navigate through your content, move Assets into the Level, transfer Assets between projects, and perform various other tasks. It shows up when you click on the Content Drawer button located at the bottom-left corner of the editor.
Figure 1.20: Content Drawer
If you click on the Dock in Layout button on the Content Drawer, a Content Browser window opens up. This window is similar to the Content Drawer, the only difference being that it stays open as it used to in Unreal Engine 4 and is preferred by developers who are used to the Unreal Engine 4 workflow.
Figure 1.21: Content Browser
Bottom Toolbar
The Bottom Toolbar features quick-access options for the Command Console, Output Log, and Derived Data capabilities, along with the display of source control status.
Figure 1.22: Bottom Toolbar
Outliner
The Outliner in Unreal Engine is a vital organizational and management utility that enables game developers and designers to efficiently manage and navigate the various game project elements. It provides an overview of all the objects, assets, and components present in a scene or level via a hierarchical list or tree view.
The Outliner shows item hierarchies in a scenario, making parent-child relationships clear. Understanding how game elements are arranged and nested requires this hierarchy. Selecting items directly from the Outliner is handy in complex situations when selecting objects directly in the 3D viewport is difficult. In large and complex game projects, the Outliner's filtering and search capabilities help users find certain objects or components in the scene. The Outliner lets users turn items on and off. This helps manage item visibility during level design, testing, and debugging. The Outliner lets users modify the hierarchy by letting them parent or unparent objects, organize the scene, and build game element interactions. In addition to scene objects, the Outliner can display references to blueprint classes.
Figure 1.23: Outliner
Details Panel
The Unreal Details panel is an important part of the Unreal Engine interface, offering detailed information and exact control over certain assets, objects, or components in the game environment. It provides a detailed view of an item’s characteristics, parameters, and settings, allowing developers and designers to fine-tune and change features such as appearance, behavior, and functionality. This panel is a vital tool for making exact modifications, assigning materials, establishing collision properties, and customizing several parameters that regulate how items and elements interact and behave inside the game environment.
Figure 1.24: Details Panel
Tools and Editors
Unreal Engine has a variety of tools and editors that allow game developers and content makers to create immersive and interactive experiences. Let us take a look at some of the most important tools and editors accessible in Unreal Engine:
Level Editor: The Level Editor allows you to create game levels and environments. It provides a visual interface for putting and modifying objects, topography, lighting, and other game world components. When you create or open a project, the Level Editor window appears. The level that is loaded by default in the Level Editor can be changed in the Project settings. The Level Editor will build a new level called Untitled if no Level is specified in the Project settings.
Static Mesh Editor: This is where you may change the properties of the static mesh (fbx meshes imported into Unreal Engine). The UV sets, LODs, collisions, and materials used can all be changed here.
Figure 1.25: Static Mesh Editor
Material Editor: The Material Editor is a specialized tool in Unreal Engine