Goal Oriented Action Planning AI Framework

@mid_gen - Trying to compile the project from Github, I get these errors:



> Engine\Source\Runtime\Core\Public\Templates\SharedPointer.h(548): error C2440: 'initializing': cannot convert from 'GOAPState *const ' to 'GOAPAtom *'

>   Engine\Source\Runtime\Core\Public\Templates\SharedPointer.h(548): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
>   D:\ChromeDL\userimages\GOAPer-master\GOAPer-master\Source\GOAPer\Private\GOAPAction\CreateFoodAction.cpp(15): note: see reference to function template instantiation 'TSharedPtr<GOAPAtom,0>::TSharedPtr<GOAPState>(const SharedPointerInternals::FRawPtrProxy<GOAPState> &)' being compiled

>   D:\ChromeDL\userimages\GOAPer-master\GOAPer-master\Source\GOAPer\Private\GOAPAction\CreateFoodAction.cpp(15): note: see reference to function template instantiation 'TSharedPtr<GOAPAtom,0>::TSharedPtr<GOAPState>(const SharedPointerInternals::FRawPtrProxy<GOAPState> &)' being compiled

> Engine\Source\Runtime\Core\Public\Templates\SharedPointer.h(548): error C2439: 'TSharedPtr<GOAPAtom,0>::Object': member could not be initialized
>   Engine\Source\Runtime\Core\Public\Templates\SharedPointer.h(822): note: see declaration of 'TSharedPtr<GOAPAtom,0>::Object'


Any ideas? Was there something committed only part way?

It’s hard to tell whether the Preconditions in GOAPAction class should be GOAPState, or if the IsFoodAvailable (etc) calls should be changed to return a GOAPAtom instead.

Edit: This ended up compiling though I don’t know if it’s right:



	IsFoodAvailableState* foodStateFalse = new IsFoodAvailableState(false);
	IsFoodAvailableState* foodStateTrue = new IsFoodAvailableState(true);
	// Only perform if there's no food
	PreConditions.Add(MakeShareable<GOAPAtom>(&foodStateFalse->Atom));

	// Make food!
	Effects.Add(MakeShareable<GOAPAtom>(&foodStateTrue->Atom));


Edit again: Launching the project after successfully compiling, it gives a warning about missing a cursor asset and missing the TopDownCharacter asset.

Edit again again: Seems like nutrition value never decrements for some reason by default.

Edit final: Added a navigation mesh, a couple of GOAP actors and some food, but they don’t seem to move or do anything. Any ideas?

Edit final again: Got it to do something, but the bots still don’t move to the food.

I can see it changing to DoAction -> GatherFood, but it never moves.