Author: riverliu

Distribute plugin

Reference: UE4 Plugin MarketPlace guidelines How To Package Plugins For UE4 Marketplace Contents

Read More »

UE4 dependency issues with AIController

Link error: error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl AAIController::AAIController(class FPostConstructInitializeProperties const &)" (__imp_??0AAIController@@QEAA@AEBVFPostConstructInitializeProperties@@@Z) Add AIModule as one of the project dependencies in the Build.cs file.

Read More »

7.4 – Layered Influence Map Architecture

7.4.0 – The idea When I was at GDC last week, I was impressed by Dave Mark’s talk on using a layouted layered Influence Map (IMap) to represent spatial knowledge for large scale worlds. And by querying it,…

Read More »

7.3 – Layered Influence C++ Libraries

Layered Influence Map

Read More »

7.2 – Layered Influence Map Demo

Read More »

7.1 – Layered Influence Map Literature Review

Game AI Pro – John Manslow’s Possibility Maps for Opportunistic AI and Believable Worlds Game AI Pro 2 – Dave Mark’s Modular Tactical Influence Maps Game AI Pro 2 – Mike Lewis’s Escaping the Grid: Infinite-Resolution Influence Mapping GDC Talk 2009 – Peter…

Read More »

5.3 – Hybrid (BT + Utility) C++ Libraries

Hybrid of utility and behavior tree

Read More »

5.2 – Hybrid (BT + Utility) Architecture

5.2.0 – The Idea At certain point when I was implementing stuff, I started to realize that all kinds of AI systems could probably give very similar results, if not identical. It was just a matter of how…

Read More »

6.3 – Buddy AI Demo 2 – Ambient Following, Taking Cover, Combat Utility

Read More »

6.2 – Buddy AI Demo 1 – Ambient Following

Read More »

6.1 – Buddy AI Literature Review

Game AI Pro 2 – Max Dyckhoff’s Ellie: Buddy AI in The Last of Us

Read More »

5.1 – Hybrid System Literature Review

Game AI Pro – Bill Merrill’s Building Utility Decisions into Your Existing Behavior Tree Game AI Pro – Daniel Hilburn’s Simulating Behavior Trees: A Behavior Tree/Planner Hybrid Approach Game AI Pro – Sergio Ocio Barriales’s Building a Risk-Free Environment to…

Read More »

2.6 – Utility Demo 2 – Target Selection

<Utility name="Utility_Test_3"> <Action id="Investigate"> <Consideration name="NotSeeEnemy"> <ResponseCurve type="Step" slope="-1" exponent="1" xshift="0" yshift="1"/> <Input id="SeeEnemy"/> </Consideration> <Consideration name="HaveLKP"> <ResponseCurve type="Step" slope="1" exponent="1" xshift="0" yshift="0"/> <Input id="HaveLKP"/> </Consideration> <Consideration name="CoolDown"> <ResponseCurve type="Polynomial" slope="0.5" exponent="2" xshift="0" yshift="0"/> <Input id="Time"/> </Consideration> </Action>…

Read More »

2.5 – Utility Architecture Update – Target Selection

2.5.1 – Target Selection Overall I thought about two ways to do target selection. One way is to use a hierarchy system to select targets, and another way is to calculate the scores for all targets simultaneously. Mike…

Read More »

iterator vector::end() returns funny result

So far this run-time error only happens in UE DevelopmentEditor environment. In a particular case, I used vector::find() to search for an element in a vector array. If it returned it = vector::end(), I pushed a new element…

Read More »

3.4 – GOAP Architecture

3.4.0 – The Design Different from all the previous architecture, GOAP, or Goal oriented action planner, is a planner–it is not only be responsive to the current scenario, but predicts future moves. To do that, it interpret the…

Read More »

3.3 – GOAP Demo 1

<GOAP name="GOAP_Test_1"> <VariableList> <!– Variable List –> <Variable id="EnemyInRange" key="0" let="200"></Variable> <!– true: let; false: gt–> <Variable id="EnemyLost" key="1"></Variable> <Variable id="EnemyDead" key="2"></Variable> </VariableList> <ActionList> <!– Action List –> <Action id="Search" cost="1"> <Precondition id="EnemyLost" value="true"></Precondition> <Effect id="EnemyLost" value="false"></Effect> </Action>…

Read More »

3.2 – GOAP C++ Libraries

Goal oriented action planner iteration 0 – use World State to represent the game world, use A* graph search for action planning, handle data loading from XML iteration 1 – build as a static library and integrate with UE4,…

Read More »

3.1 – Planner Literature Review

Peter Higley and Chris Conway’s GDC 2015 Talk on GOAP (0:00, 20:00) Jeff Orkin’s website on GOAP Jeff Orkin’s Applying Goal-Oriented Action Planning to Games (2003) Jeff Orkin’s Three States and a Plan: The AI of FEAR (GDC…

Read More »

2.4 – Utility Architecture

2.4.0 – The design Utility theory highlights the “motivation” behind every decision the AI makes. Each AI has a list of Actions. Each action contains a list of Considerations. Each consideration has a Response Curve and a Input…

Read More »

2.3 – Utility Demo 1

<Utility name="Utility_Test_2"> <Action id="Attack"> <Consideration name="SeeEnemy"> <ResponseCurve type="Step" slope="1" exponent="1" xshift="0" yshift="0"/> <Input id="SeeEnemy"/> </Consideration> <Consideration name="NearEnemy"> <ResponseCurve type="Linear" slope="-1" exponent="1" xshift="0" yshift="1"/> <Input id="Distance"/> </Consideration> <Consideration name="HealthIsHigh"> <ResponseCurve type="Linear" slope="1" exponent="1" xshift="0" yshift="0"/> <Input id="Health"/> </Consideration> <Consideration…

Read More »

2.2 – Utility C++ Libraries

Utility system iteration 0 – response curve functions based on Mike Lewis’s Choosing Effective Utility-Based Considerations (Pro 3-13) and Dave Mark’s GDC Talk Architecture Tricks: Managing Behaviors in Time, Space, and Depth (starting from 33:40), with data loaded from XML in runtime iteration 1…

Read More »

2.1 – Utility Literature Review

Game AI Pro 1 – 9 An Introduction to Utility Theory by David Graham Game AI Pro 3 – 13 Choosing Effective Utility-Based Considerations by Mike Lewis Mike Lewis and Dave Mark’s GDC Talk Building a Better Centaur: AI…

Read More »

Compile error: missing “;” before “*”

This compile error is likely due to the absence of proper namespace…weird. Sometimes switching the build target between “DevelopmentEditor” and the others helps.

Read More »

1.4 – Behavior Tree Architecture

1.4.0 – The design 1.4.1 – Behavior Behavior is the basic building block of the tree. Every node is essentially a child of the base class Behavior. The core functions are a tick() for single entry, and onInitialize(),…

Read More »

1.3 – Behavior Tree Demo 1

<BehaviorTree name="BT_Test_2"> <ActiveSelector> <Filter name="Attack"> <!– Attack the enemy if seen. –> <Condition id="SeeEnemy"/> <Action id="MoveToEnemy"/> <Action id="AttackEnemy"/> </Filter> <Filter name="Investigate"> <!– Search near last known position for 3 times. –> <Condition id="HaveLastKnownPosition"/> <Repeater limit="3"> <Sequence name="SearchNear"> <Action…

Read More »

Raycasting fails to avoid owner

UE4 uses a Collision-Trace-Channel system for raycasting (and physical collision). Interestingly, the Collision property is not only applied to “colliders”, but everything with a mesh. In order for the raycasting to work properly, you need to set the…

Read More »

0.5 – UE4 Level Setup

Top-down view for the initial level setup.

Read More »

0.4 – Hierarchy FSM Architecture

0.4.0 – The design After decades and decades, FSM is still widely used in games for behavior selection. So it makes sense to actually build one for UE4. The general idea is to run FSM from each actor,…

Read More »

UE4 Animation Montage

It may not be possible to modify the blend map from script (need to look into that), but driving animation in script is certainly possible. Ref: AnimMontage

Read More »

UE4 crashes when started but the project is complied successfully

Runtime error may be caused by multiple reasons. First thing is to check the Log–usually it will not show much by default. Try print debug messages to the Log and track down the problem. Some tricky cases I…

Read More »

String conversion: Fstring – std::string

std::string to FString std::string _string = "Enjoy the game"; FString _fstring(_string.c_str()); FString to std::string FString _fstring = "Enjoy the game in UE4"; std::string _string(TCHAR_TO_UTF8(*_fstring)); Other: String Conversions: FString to FName, FString to Int32, Float to FString

Read More »

Compile fails / Cannot create MyUEProject.dll in VS2017

It may due to transferring files between systems. Delete everything under /Binaries and build again.

Read More »

1.2 – Behavior Tree C++ Libraries

Behavior tree iteration 0 – simple behavior tree v1 with data loaded from XML in runtime iteration 1 – separate implementation and structure iteration 2 – build as a static library and integrate with UE4

Read More »

1.1 – Behavior Tree Literature Review

Game AI Pro – 4, 6, 7 on BT

Read More »

0.3 – Math and HFSM C++ Libraries

3D Math for easy manipulation iteration 0 – raw C++ headers iteration 1 – build as an UE4 static library Hierarchy FSM iteration 0 – raw C++ headers for simple FSM with data loaded from XML in runtime, integrated…

Read More »

0.2 – AI and Framework Literature Review

C++ for game programmers (book) Introduction to game AI (book) Artificial Intelligence for games (book) Game Engine Architecture – 4 on Math Game AI Pro 3 – 4 on player perception, 7 on FSM debug, 8 on modular,…

Read More »

UE4 + VS2017

Plugin: Intro to UE4 plugin Package engine plugin Create plugin with example Library module vs. Plugin module A tutorial for packaging libraries in a plugin Static library: Create and link static library Run time: UE4 Log

Read More »

dynamic_cast fails / RTTI not enabled

UE4 / VS2017 projects don’t enable RTTI by default, and VS2017 hides the configuration in Project Properties setting for UE4 projects. Workaround is to enable UseRTTI in the Build,cs file: bUseRTTI = true; Reference: https://answers.unrealengine.com/questions/55613/how-to-enable-rtti-when-compiling-a-plugin.html

Read More »

Undefined reference to vtable

Even though the compiler says “a missing vtable usually means the first non-inline virtual member function has no definition”…but usually it is not. The really error can be: IDE fails to include cpp files. Or, Forgetting a body…

Read More »

0.1 – Project starts. Environment settings

Hello World! This purpose of this project is to study the latest game AI techniques and build a general purpose AI plugin for UE4. UE: 4.18.3 Windows SDK: 10.0.16299.0 VS: Visual Studio 2017 (v141) XCode: 11

Read More »

UE4 project creation / Compile errors

Having VS 2015 Community & VS 2017 Community installed. Install C++ support for VS 2015. Create UE4 project as usual, then switch the external tool to VS 2017. Or, Uninstall VS 2015 completely with this program. Don’t try to…

Read More »
The AI Project