This project addresses the challenge of generating varied, context-appropriate behavior for large populations of ambient NPCs in open-world games without exceeding tight runtime budgets. The core contribution is a memory-driven action selection framework where NPC behaviors are defined as directed graphs of actions and a bounded memory mechanism favors untried or least-recently used transitions, producing behavioral variety without requiring online planning or search. The framework is implemented as an engine-agnostic C++ shared library with a public C API and JSON-defined behavior configurations. It has been integrated and validated in both Unity and Unreal Engine, demonstrating cross-engine portability and sub-linear performance scaling from 50 to 200 NPCs while remaining well within per-frame budget targets.
Complete C++ project for review. To build from source, cloning from the GitHub repository is recommended.
For building from source, clone directly from the repository. This handles vcpkg submodule initialization automatically.
Full Unity 6 project with framework integration, demo scene, and pre-built framework binary.
Contains licensed Synty assets — review use onlyFull Unreal Engine 5.7 project with framework integration, demo level, and pre-built framework binary.
Contains licensed Synty assets — review use onlyExpand each section below for detailed instructions on the corresponding download.
The zip contains the complete framework source code.
src/ contains the framework implementation,
include/ contains the public C API header files, and
tests/ contains the unit tests.
The build system is configured through CMakeLists.txt and
CMakePresets.json, with dependencies declared in
vcpkg.json. A Doxyfile is included for
generating API documentation. The vcpkg dependency manager is not
included in this zip as it is managed as a git submodule. To build
the project from source, clone the GitHub repository instead.
Cloning the repository handles the vcpkg dependency manager automatically through git submodules. This is the recommended approach for building from source.
git clone https://github.com/EricBL3/ambient-behavior-core-framework.git
cd AmbientCoreFramework
# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install required tools
brew install pkg-config
# Ensure Xcode Command Line Tools are installed
xcode-select --install
git submodule update --init --recursive
cd vcpkg
# Windows
.\bootstrap-vcpkg.bat
# macOS / Linux
./bootstrap-vcpkg.sh
cd ..
cd vcpkg
./vcpkg install
cd ..
# Windows
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows
# macOS (Intel)
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-osx
# macOS (Apple Silicon)
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=arm64-osx
# Linux
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux
cmake --build build --config Release
cd build
ctest --config Release
cd ..
doxygen Doxyfile in the project root.docs/doxygen/html/index.html.The downloadable zip is provided for reading and inspecting the source code. Because vcpkg is managed as a git submodule, the zip does not include the full vcpkg installation needed to build. To compile the project, clone from the GitHub repository using the steps above.
The zip contains the full Unity 6 project. The relevant
contents for review within the Assets/ folder are organized as follows:
Scripts/AmbientCharacterFrameworkIntegration/ contains the
C# wrapper layer that bridges the C++ framework with Unity,
while the remaining folders in Scripts/ contain
demo-specific code. Plugins/ contains the pre-built
framework DLL binaries. AmbientBehaviorFrameworkConfig/
contains the JSON configuration files that define NPC states, actions,
sequences, and entity configurations (see Appendix A of the project
report for documentation of this format).
Scenes/ contains MainDemo and
PerformanceDemo. The remaining folders
(Animations/, Animators/,
Audio/, Prefabs/, and
PolygonAncientEmpire/) contain the demo's art
assets, animations, and prefabs.
Assets/Scenes/ and
open MainDemo.unity.
The Assets/Scenes/PerformanceDemo.unity scene is the
environment used for the performance evaluation described in Chapter 6 of
the project report. It can be opened and run using the same steps above.
Once the demo is running successfully, framework settings such as the character batch size can be adjusted. See Chapter 5 of the project report for how these settings are configured and what they control.
This project includes the pre-built framework binary. No separate download is needed to run the demo.
The zip contains the full Unreal Engine 5.7 project. The
relevant contents for review are organized as follows:
Source/AmbientBehaviorDemo/AmbientBehaviorFramework/
contains the C++ wrapper layer that bridges the framework with
Unreal Engine, while the remaining files in
Source/AmbientBehaviorDemo/ contain demo-specific code.
ThirdParty/AmbientCoreFramework/ contains the pre-built
framework DLL binaries. Content/AmbientBehaviorFrameworkConfig/
contains the JSON configuration files that define NPC states, actions,
sequences, and entity configurations (see Appendix A of the project
report for documentation of this format).
The demo level is located at Content/DemoScene.umap.
Binaries/ contains the compiled game module, and
Config/ contains project settings.
Content/ and open
DemoScene.
Once the demo is running successfully, framework settings such as the character batch size can be adjusted. See Chapter 5 of the project report for how these settings are configured and what they control.
This project includes the pre-built framework binary. No separate download is needed to run the demo.