Post

I wrote another Behind the Code article about Psychonauts 2! This time I explain how we used our Target Search system. It finds and prioritizes objects in the world for Raz’s powers to interact with. www.doublefine.com/news/devin-t...

doublefine.comBehind The Code: Locked On TargetHere’s a quick rundown of how Target Search was used to enable that sequence: Player fires Psi Blast. Target Search finds the flying Regret enemy to aim…

2 reposts8 likes

Thanks for writing this up! I’ve been working on filtering features in UE exposed with EditInlineNew and curves for a while so it’s good to see this worked out on something that shipped (incredible tip on TitleProperty by the way!)

One question I had was on the target component; did every targetable object register on level load and how did this work with level streaming? Also were there few enough/infrequent enough queries that this could just run through the entire set each time?

The targets were put into a few different lists based on broad search categories. We’d run through the entire list for the appropriate category. To mitigate the perf cost we tried to order the conditionals to discard as many targets as possible without doing very costly evaluations.

Registration was generally through InitializeComponent/UninitializeComponent. I think those got called when something streamed in/out, but can’t remember for sure. There was also a way for targets to be set Active/Inactive at runtime which let us temporarily ignore them during searches.