Tag: C++

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.3 – Layered Influence C++ Libraries

Layered Influence Map

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 »

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.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 »

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.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 »

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 »

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 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 »

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 »

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 »
The AI Project