x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AI Perception register source issue

Hey so I was messing around with the AI Perception System in blueprint and i'm getting a really weird issue. Most of the time when I call the Register Source blueprint node it works fine. However after a little while (usually after restarting the editor a few times) the Register source nodes seem to break. They trigger a breakpoint here at the ensure function:

 void UAIPerceptionSystem::RegisterSource(FAISenseID SenseID, AActor& SourceActor)
 {
     ensure(IsSenseInstantiated(SenseID));
     SourcesToRegister.Add(FPerceptionSourceRegistration(SenseID, &SourceActor));
 }

The only way to get around it once it starts doing this is to completely recreate the blueprint. Even if I remove the node and add it back the problem persists until I make a new version of the blueprint. So far its done this with blueprints based off of pawn, character, and several other custom c++ ones that are also based off of pawn or character. Here is a link to my call stack when I hit the breakpoint: http://pastebin.com/MvNSafaG

Here is the actual error that crashes the editor: Array index out of bounds: 255 from an array of size 1

Not sure if its related but also sometimes when I get this issue the node will change from requiring the sense class and the target object to one that also requires a world context.

Edit: So after talking with some people on the UnrealEngine IRC channel Ashyre figured part of it out for me. Essentially I had to make some changes to the AIPerceptionSystem.cpp

On line 399 I removed the const

Then I insterted a new line at 403 SenseID = UAISense::GetSenseID(Sense);

The end result being:

  FAISenseID SenseID = UAISense::GetSenseID(Sense);
  if (AISys->GetPerceptionSystem()->IsSenseInstantiated(SenseID) == false)
  {
       AISys->GetPerceptionSystem()->RegisterSenseClass(Sense);
       SenseID = UAISense::GetSenseID(Sense);
  }

However, after some more experimentation I realized that while this didn't actually fix the problem it made it reproduce regularly. Essentially whenever I restart the editor the Register node changes and the game crashes with this call stack: http://pastebin.com/3GbKq2VH

alt text I have tried attaching stuff to the world context but it doesn't fix anything.

Thanks,

-Chris

Product Version: Not Selected
Tags:
issue.png (98.6 kB)
more ▼

asked Apr 17 '15 at 08:08 PM in Bug Reports

avatar image

ckchessmaster
67 12 14 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

It seems you've found a bug in the way perception system exposes its functions to BP. Can you try supplying a context, like "self", to the Register Perception Stimuli Source? It's possible it's crashing due to this parameter getting hidden while the value is None, which would lead to a crash.

Cheers,

--mieszko

more ▼

answered Apr 19 '15 at 10:08 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image ckchessmaster Apr 20 '15 at 04:24 PM

Ok thanks for the reply! How would I go about supplying it with a context? Would that be something I would do in code? I know in the blueprint I supply "self" but like you said there might be something going on with it.

avatar image MieszkoZ STAFF Apr 20 '15 at 05:25 PM

Like so:

alt text

Where you obratain`Self` like so:

alt text

self.png (32.4 kB)
self2.png (27.4 kB)
avatar image ckchessmaster Apr 20 '15 at 07:40 PM

So I'm really not sure what the issue is, I'm getting some really strange things happening. I'm starting to think there may be some weird issue with my project because it tends to break after a few editor restarts. I saw zoombapup did a brief overview of it today and his setup looks the same as mine so i'm probably going to try and get this setup and working on a blank project and go from there.

avatar image MieszkoZ STAFF Apr 20 '15 at 08:08 PM

Are you able to grab UE4's github sources, master branch, and give that a go? I've just submitted a bunch of perception system fixes.

avatar image ckchessmaster Apr 20 '15 at 08:25 PM

Yeah I can. I'll give that a go and let you know what happens, thanks!

avatar image ckchessmaster Apr 21 '15 at 02:57 AM

Well so far everything looks good no major crashes relating to the bug! There is one small crash still but its just when you drag out a pin from target it will crash: Unhandled GraphSchemaAction, wanting a menu icon: FEdGraphSchemaAction I can still attatch stuff to it just can't drag anything off.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question