AI works, unless level streamed

I have an AI setup in my level that engages some randomly spawning targets, when I load the map directly in the editor and play, it runs perfectly, but when it’s loaded during the course of the level it does not, it just sits there no matter what I do, if there some simple setting I am missing somewhere?

1 Like

I am having a similar issue with the AI perception system. When I stream a level, actors in the streamed level no longer perceive each other. But when everything is in the persistent level, everything works fine. This needs some attention. Did you ever find a solution?

Not as of yet, no. I kind of moved the team on to other parts of the project and pushed AI down the list until someone came back with something here.

Still an issue, tried more solutions than I can shake a stick at, nothing seems to work.

AI functions perfectly when the level is loaded independently, but when loaded off the persistent level during the course of the game, nothing at all, the AI doesn’t even try. It’s not a Navmesh thing, it doesn’t even make the attempt to load.

This appears to be still an issue…

4.9.2

I’m not sure if there are any planned fixes for this, but it does appear to be an issue. I have gone ahead and used a workaround for this: a collision sphere. This is a fix specific to sight perception, but it is working fine on a streamed map.

65330-aihelp2.png

In order to stop them from seeing behind them, I also check for rotation.

65331-aihelp3.png

This gets the current AI rotation with the look-at rotation to the target, gets the delta, splits out Yaw, and checks if it is greater than 90 degrees, or less than -90 degrees (180 degrees of sight).

Certainly a workaround, and I would love to see a real fix in place for AI perception using streamed levels. Hopefully this helps.

I encountered the same problem. Got any update on it?

Hey there,

you can can make the AIPerception work again, if you specifically register Actors with “Register Perception Stimuli Source”.

For Example: I wanted my AI to see my player → In “Begin Play” I registered the player as perception stimuli source for the AISense class Seeing.

I guess that at the start of a level, the AIPerception system iterates through all actors and registers them as stimuli sources. If you stream a level after that, the loaded actors don’t get automatically registered → you have to register them manually…

I hope this helps :slight_smile:

1 Like

I didn’t try that … unfortunately I had to skip the idea of level streaming cuz m having all sorts of issues … my player pawn doesn’t get possessed(even when auto possess is set correctly), player start stopped working, If things got working in editor, something gets messed up while launching on phone. I’m making my 1st android game (all BP) n having hard time dodging these problems. Even after making sure have done things correctly. bugs jus appear from no where !

I’m seeing this issue as well. Can we get some answers on how to deal with this?

This works for me. An ugly workaround, but it works!

It seems that the answer is what Zcience said. I’ll go ahead and post a feature request in the forums.

Hey there,

you can can make the AIPerception work
again, if you specifically register
Actors with “Register Perception
Stimuli Source”.

For Example: I wanted my AI to see my
player → In “Begin Play” I
registered the player as perception
stimuli source for the AISense class
Seeing.

I guess that at the start of a level,
the AIPerception system iterates
through all actors and registers them
as stimuli sources. If you stream a
level after that, the loaded actors
don’t get automatically registered →
you have to register them manually…

I hope this helps :slight_smile:

For anyone if you encountered the same problem, just try to check AIPerceptionStimuliSource->AI Perception->Auto Register As Source
I think this is an automatic way to do what Zcience said and this solved my problem.
image