# EQS path length scoring doesn't work properly with inversed linear setting

**URL:** <https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205>\
**Category:** AI\
**Tags:** pathfinding, EQS, unreal-engine, bug-report, UE4, Blueprint, question\
**Created:** [May 2, 2016, 2:31pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205 "2016-05-02T14:31:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 2, 2016, 2:31pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/1 "2016-05-02T14:31:08Z")

</div>

Here is my setup - I run a query with a single test enabled at the moment - to be as close to the current position as possible but at least 200 away (needed for a combined test later). But regardless if I use linear or inversed linear scoring it gives higher score to points further away instead of the closest ones.  
G1\_EnvQContext is my player character (I generate grid around him).  
I have this issue in both 4.10 (the most stable for me until 4.12) and 4.12 (Preview 1) (the newest one)

 ![89199-eqs_path_problem1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/1/981603e5972147b8c2ae0c05810960527a5177fc.png)

 ![89200-eqs_path_problem2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/b/33bb3e0ed3e1c9ea353329f3750533ad2ff4f781.jpeg)

 ![89201-eqs_path_problem3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/5/ea5d15b006356b16e6286e765d3c9c63ab1597f8.jpeg)

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 2, 2016, 6:40pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/2 "2016-05-02T18:40:24Z")

</div>

Actually I’ve noticed that distance is calculated as a path instead of a vector, so I’ve used the distance query instead. Feels like a band-aid solution, but at least it works.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [May 3, 2016, 2:51pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/3 "2016-05-03T14:51:18Z")

</div>

Hello,

You’ve stated that you found a solution to your issue. Is this issue now resolved, or are you still experiencing problems with your setup?

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 3, 2016, 3:03pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/4 "2016-05-03T15:03:39Z")

</div>

Hello, thank you for your response!  
It’s not a solution, more like a workaround. In fact, there is a double issue now:

1)Distance check with EQS returns path length instead of vector distance (which is acceptable for me but in case I need a vector length it would cause problems). In other words, two different functions (Distance and Path) call the same code.

2)Inversed linear scaling still doesn’t work for path check (but works for “distance”(that is path as well) checks).

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [May 3, 2016, 7:01pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/5 "2016-05-03T19:01:54Z")

</div>

One suggestion regarding your setup. On your PathLength test, click the dropdown arrow underneath the Score tab and select the maximum score option instead of average score. This way, you’ll be able to get the items with the maximum score (which are the items that are closest to 0 since you’re using inverse linear scoring).

Does that make any difference?

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 3, 2016, 8:53pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/6 "2016-05-03T20:53:01Z")

</div>

Just made a quick test with this setting - nope, still the same. I think it’s just that the equation for inversed linear scoring could be set the same as for linear.

As for distance scoring path instead of vector length it is probably more complicated, but can as well be the same type of problem.

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 3, 2016, 9:12pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/7 "2016-05-03T21:12:03Z")

</div>

Updated to 4.12 Preview 2 - problem still exists in both 4.10 and 4.12 P2

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [May 6, 2016, 4:59pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/8 "2016-05-06T16:59:23Z")

</div>

After some further investigation, I have been unable to reproduce this issue on my end, which leads me to believe I am missing a small setting. Could you please provide a test project? You can zip up the project, upload it to dropbox, and PM me a download link through the forums: [https://forums.unrealengine.com/member.php?160394-Sean-Flint](https://forums.unrealengine.com/member.php?160394-Sean-Flint)

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 6, 2016, 9:25pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/9 "2016-05-06T21:25:02Z")

</div>

This is very strange because I’m having the same behavior in the most basic project I could make. I’m currently uploading the zip archive to dropbox and will share a link asap.

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [May 6, 2016, 9:31pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/10 "2016-05-06T21:31:21Z")

</div>

Update: looks like an editor issue - I’m getting strange behavior for my EQS and physics asset as well (thought it was different, but now I’m pretty sure it’s the same). Every time I close my project and reload it it resets its value to default (linear). The same for physics asset parameters resetting on blueprint reopen.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [May 9, 2016, 2:30pm UTC](https://forums.unrealengine.com/t/eqs-path-length-scoring-doesnt-work-properly-with-inversed-linear-setting/356205/11 "2016-05-09T14:30:05Z")

</div>

Hello,

I have been able to reproduce your issue and have entered a bug report, UE-30470. Thank you for your report.

Have a great day
