EQS EnvQuery crashing on AddGeneratedVector

After upgrading to 4.12 my EQS generators are crashing every time they run. It seems to be the AddGeneratedVector function when it’s checking the datatypes. I’ve included an example project so you can skip to the final step.

Crash Text

Example Project (crash info is included in “CrashReport” folder)


  1. New blank BP project
  2. Enable “Environment Querying System” in editor preferences
  3. Make BP from EnvQueryGenerator_BlueprintBase
  4. Override DoItemGeneration and add AddGeneratedVector function before the return node
  5. In class defaults, change “Generated Item Type” to EnvQueryItemType_Point
  6. Make new EQS Query, add the custom generator
  7. Make BP from EQSTestingPawn
  8. Drag pawn into level and assign EQS Query

It can happen if you’re trying to add vectors while the generator is set up to generate actors, like this:

93317-generateditemtype.png

you just need to change it to EnvQueryItemType_Point.

Cheers,

–mieszko

Yep, I rechecked that a few times, just in case upgrading to 4.12 was changing that setting to actor. I changed it a few times, then back to ItemType_Point and compiled and saved just to make sure. Still crashed.

So I made a bare test project to see if it was just my project, but it still occurs in the blank project. Are you sure the project I attached doesn’t crash in the launcher version of 4.12? Step#5 is making sure the item type is correct, but it’s still crashing for me.

Here is the debug showing that it’s being fed an EnvQueryItemType_Point

But it stills fails in the next function at:

check(GetDefault&ltTypeItem&gt()->GetValueSize() == sizeof(TypeValue));

Wow that’s a dumb bug! Totally my fault. I’ve just submitted a fix, it should make it to 4.12.1. If you want to fix it yourself just change

CachedQueryInstance->AddItemData<UEnvQueryItemType_Point>(Vector);

to

CachedQueryInstance->AddItemData<UEnvQueryItemType_Point>(FNavLocation(Vector));

AddGeneratedActor needs a similar change to the part where it converts an actor to a location. Thanks a lot for pointing this one out!

Cheers,

–mieszko