Jiggling Prevention Table - Orhu/Summer2023Project GitHub Wiki

This table is used for determining an enemy's distance buffer based on its movement speed. The distance buffer number is needed because comparing two transforms is a float comparison, and should have a buffer. Otherwise, enemies can overshoot their target by a certain amount and will try to go the other way to touch the point, getting stuck in a "jiggling" pattern trying to touch the point they want correctly. The buffer prevents this, but with too much leniency, and enemy may try to path to its next waypoint too soon. Hence, we want to find the Goldilocks number that is just right. Here is that table based on my own manual testing.

Note: Distance travelled every frame varies. I chose the largest number I saw consistently show up.

Move Speed Distance Travelled Every Frame Appropriate Distance Buffer
0.5 0.01000... 0.011
1 0.02000... 0.021
1.5 0.03000... 0.031
2 0.04000... 0.041
2.5 0.05000... 0.051
3 0.06000... 0.061
3.5 0.07000... 0.071
4 0.08000... 0.081
4.5 0.09000... 0.091
5 0.10000... 0.101
5.5 0.11000... 0.111
6 0.12000... 0.121
6.5 0.13000... 0.131
7 0.14000... 0.141
7.5 0.15000... 0.151
8 0.16000... 0.161
8.5 0.17000... 0.171
9 0.18000... 0.181
9.5 0.19000... 0.191
10 0.20000... 0.201