On this page, we try to provide some steps to troubleshoot common problems.
If you are experiencing crashing, here are some possible troubleshooting steps and common causes:
The most common two causes of crashes directly related to EvolvingBehavior are: old/invalid save files, and incomplete or mis-configured Evolution settings.
If you don't see errors in the logs, you can still look through your EvolutionControl actors and LifeCycle actors for settings that are missing (objects set to "None," or missing internal information. Often, adding these missing pieces will resolve crashes.
If you know that your settings are correct and you were able to run successfully before, but are now crashing, it may be that your experiment's save file is out of date or corrupted. Resuming from a previous saved experiment requires that the settings, behavior trees, and actors be similar enough to copy data from the save file. So if you have upgraded your project or plugin version, or significantly changed your actors or settings, you may need to delete (or rename) the old save (or change your LifeCycle component to a different save name), and start a new experiment.
If neither of these resolves your crashes, you may want to try a simpler test case or map, or deleting and re-creating EvolutionControl actors. Your crashes could also be related to your project's code - check that your project runs correctly without EvolvingBehavior being used. Finally, if you are still experiencing crashes, you can submit a bug report to the EvolvingBehavior GitLab repository (https://gitlab.com/NPC-Dev/evolvingbehavior).
If Unreal Engine is stuck, hanging, or in an infinite loop, a likely cause might be a Behavior Tree node that loops infinitely (or for a long time). The "Loop" node type is a common culprit - make sure you don't have Loop nodes that will run for a long time, or that could generate infinite or long loops, especially if they could nest within each other. If you have created other node types that may loop or take a long time to execute, try removing them as well, and see if the problem stops happening. Then, try to re-write them to prevent infinite or very long execution.
If you don't see any changes or movement in your characters when running EvolvingBehavior, there are several possible causes. Here are some things to double-check:
The below subsections expand on some of these possible issues:
Double-check that your EvolutionControlActor and LifeCycle Actor have all their settings configured. Sometimes settings can get accidentally overwritten or deleted (such as when objects are copied or moved, etc.), so check that details of generated nodes, mutators, and other settings are all configured properly:
You can also search the logs for LogEvolvingBehavior to see if there are warnings or errors, but some settings misconfiguration issues may not show as errors.
If you see that your agents are not running a behavior tree, it may be that your code is failing to find the correct EvolutionControlActor to retrieve the behavior trees from. Double-check that your EvolutionControlActors have the correct tags (for their specific population), name, or references set up in the scene for how you are finding them to retrieve the trees.
As noted above, you may want to check using a non-evolving agent that your level has properly configured pathfinding (nav mesh, agents set up to use it, no unexpected colliders or other issues preventing navigation).
The built-in Unreal AI debugger (https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/AIDebugging/) may also help you find some issues with behavior trees and pathfinding.
If you are occasionally seeing movement, but not often or not consistently, it may be that you are not tracking fitness correctly (or your fitness functions are not encouraging the behavior you prefer). You should check that your code is sending fitness updates for all agents, that the weights and fitness functions are giving reasonable values (i.e., no single component of fitness is overwhelming the others, higher fitness is being found for agents showing good behavior, etc.). You can add debug logging of individual fitness component updates, or check the output fitness log files for total fitness scores.
If all your settings are correct, but none of the NPCs are moving, it could just be that you got unlucky initial behavior tree population where none of the trees happen to have useful configurations of nodes. If you wait a few generations, some trees may end up improving - but, because all the fitnesses will be similar, this may not happen quickly or at all. Sometimes, you may be better off restarting the experiment once (or even multiple times) to try a new set of random starting conditions.