For each test I used 2 Roaming Targets and varied the number of roaming AI:
About 20 min. with a roaming AI to Roaming Target ratio of 6:1 yielded clustering at each Roaming Target and active Pawn-to-pawn collision avoidance when Player was within range. When a Roaming Target was finished interacting, new movement occurred toward the newly unoccupied AI for idle AI that were not actively involved in collision avoidance. During the full duration, no AI were left in an infinite idle state; it was temporary and dependent on the occupied AI’s interaction time.
About 15 min. with a roaming AI to Roaming Target ratio of 12:1 yielded similar results to the 6:1 test, except for about the 12 min. mark when roaming AI became “boxed in” due to excessive clustering around the Roaming Target. This left them immobilized and were only able to recover after a Distance Based Optimization Reset event (occurs when Player moves a specified distance from the AI).
If it is desired to have a relatively high ratio of roaming AI to AI Roaming Targets, then a possible solution could be to add some “dummy” non-AI Roaming Targets with no collision and having Hidden In Game enabled (if there is anything to render). This will allow roaming AI a location to move to when AI Roaming Targets are occupied; furthermore, non-AI Roaming Targets are not one-to-one. This is just one potential solution.
In the future I may establish a queue system for Roaming Targets or some other alternative.
Thanks. I tried the same and problem goes away with more targets than AI. Good point is it does not matter if those overlap so invisible target actor. I have not reproduced the infiloop now. It might come from situation there is none or one unreachable target.
Another question: how to rejuvenate AI. When loading a save point (basicly only character related stuff) + current streaming level dead AI stays dead. Even if i route custom event to begin play then AI is moved to initial location but stays dead…Or which internal variables i should take care of is saving AI?
If I understood your query correctly, you would like to “reset” dead AI upon loading a streaming level.
Please answer the following questions:
Which (if any) Diverse AI variables are you currently saving/loading?
When are you saving AI variables (if relevant)?
Are you destroying AI upon death?
If you would like to experiment before answering the questions, here is some information that may help you:
When AI are defined as dead, their enum_CurrentState will be set to “Dead”. If enum_CurrentState is Dead when attempting to revive the AI, then AI will not be able to transition to another AI State when BeginPlay is called, as dead AI should not be able to transition to other states or call other events. Without knowing too much about your particular case, I can at least advise you to test changing the value of enum_CurrentState (Idle is a good option) for your AI upon loading a streaming level; this should occur before Parent’s BeginPlay event is called. Upon execution of BeginPlay, your AI will transition to enum_InitialState.
Was not saving anything on AI. Just wondering what to do for reset. But then problem was mostly that I tested sublevel being set to always loaded, so unload/load does not much. More working procedure is to start sublevel as loaded, use checkpoint so save is created. back to editor. set sublevel to blueprint loadable. start again and load previous save that stream in the level. then different situations can be tested and reloading save resets/creates actors correctly…
@savitapio
If I understood the new method you are using, then AI that were dragged into the sublevel should be reset to default upon unloading/loading the streaming level. If the sublevel is always loaded, then you would need to use another method to reset AI that are dead, which would require a small amount of additional logic.
Are the AI working as desired using your new method (if you prefer the other method of having the sublevel always loaded, I can assist with the AI setup)?
For current this works OK. For future it would be nice to have reset method. I tried to set current state back to idle and current movement mode from none to walking but that did not help the situation. And then if going to save those AIs what variables to save would be good to know.
I published a video that provides an overview for reviving/resetting dead AI in loaded/unloaded streaming level environment as well as handling those same events when the streaming level is always loaded. Note that there is no additional logic required for the first part of the video: loading/unloading streaming level, other than the load/unload logic.
In regards to the AI variables that are to be saved, that is mostly user specific, so I cannot provide a general checklist that will cover every project. The primary variables to take note of are: Health, Current State, and Target Actor (If you plan on having Initial State set to Pursuit upon loading). The AI’s current location might also be beneficial.
Due to the limitations of the forum, the primary venue for Diverse AI discussions will be moving to a designated Discord server. There, you will find better organization and other features to aid in everything related to Diverse AI. This forum, as well as direct communication via email, will remain open and monitored.
Diverse AI v1.22 was published today. It contains a necessary bug fix for UE 5.0 (read changelog of the documentation for more info.). If you plan to use Diverse AI with the current build of UE 5, then this update is required for correct functionality. If you plan to continue in 4.26/4.27, then this update will not provide any noticeable benefit.
Hello everyone. Diverse AI v1.30 is available on the marketplace. There are multiple changes/improvements that are included with this update, including a Companion system and AI-AI/AI-Player Evasion system. Please read the changelog of the documentation for more information. Currently there is no information in the documentation regarding use/setup of the new systems, but I will be working on it soon. Enjoy!