Enemy AI Not Moving to Player or Around Map

I am writing a game for my 2 friends as a wedding gift. This is a simple ARPG, 1 level with enemies. I am constructing the enemy AI and cannot seem to get my enemies to move despite using a random navigatable point and pawn sensing, the enemies just idle when I start the game. I have a navmesh setup. Any help with this is appreciated!

1 Like

The attached images show my AI Enemies details as well as how I setup the print string node and what came through the test when I ran the game. Only when the pawn saw me did I get the Sensing Player and Aborted Logs. If you want I can do the random navigation print string test, to see if that is being aborted as well. Thanks so much for the help on this by the way!

Heres a copy of the output log:

PIE: Server logged in
PIE: Play in editor total start time 0.841 seconds.
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Success
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Sensing Player
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogBlueprintUserMessages: [Enemy_Spider_3] Aborted
LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden
LogWorld: BeginTearingDown for /Game/UEDPIE_0_Level1
LogWorld: UWorld::CleanupWorld for Level1, bSessionEnded=true, bCleanupResources=true
LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated
LogPlayLevel: Display: Shutting down PIE online subsystems
LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated
LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden
LogAISub: UAISubsystem::~UAISubsystem AIPerceptionSystem (00000185BFFD2E80), frame # 38719
LogAISub: UAISubsystem::~UAISubsystem EnvQueryManager (000001860719FE00), frame # 38719
LogUObjectHash: Compacting FUObjectHashTables data took 2.16ms
LogPlayLevel: Display: Destroying online subsystem :Context_12

It seems to be an issue with the AI move to node…

This is a shot of the spiders flow before he senses me.

Going to follow up with this but check out the enemy naviagatable area! it looks to be below the floor of the map…

1 Like

Yep, here is the nav mesh bounds in the level if I just hit “P”

1 Like

Driving me nuts! Another issue could be that there is another layer of navigatable area below whats in the last image (lower in the level) so could that be throwing off my get random navigatiable point node?

Moving the enemy spider does not change the difference in its naviagtable area and the navmesh. I am gonna review your links to see if there is something there.

you can try first on a simple plane to more easily rule out the problem


using the template map floor

second, don’t be offended but that code looks horrible :sweat_smile:
Try to simply move it in the begin play

@DomusLudus no offense, I have no formal training, this is all youtube! Also could you be more descriptive with your suggestion? Do you mean start a new level with the template floor and a navmesh and drop the AI Enemy in to QA the issue? Im pretty new to UE4 and need all the direction I can get! (Thanks)

yes just that. start with the roam part.

Other think
image
I am prety sure that the output results are immediate and do not refer to having reached the destination, but to checking that there is a path in the navh mesh to get there.
I may have the problem there, So you may be stopping the movement every time it starts

@DomusLudus @anonymous_user_3867756a Tested the Enemy Spider in a temp level with a simple navmesh and its moving to the random reachable locations! What would you suggest I test next? I dropped the AI back into the current level, deleted the old navmesh and put a new smaller navmesh around the enemy. It didnt move. Not sure where to go from here. Be happy to jump on a video call to work this issue out if anyones game?

@DomusLudus @anonymous_user_3867756a PROBLEM SOLVED! Turns out the solution was to change the capsule size of the AI Enemy to match my player characters’ capsule size. This fixed the issue but if anyone has a reason why this happens I would love to hear it!

2 Likes

I’m glad it works,
about the capsule that’s insanely weird :crazy_face:
It was too big?

Sorry for the super delayed response, yes the capsule height and width of the enemy character to my player characters (not sure why this was different) and it fixed the issue!

1 Like