O'Reilly logo

Behavioral Mathematics for Game AI by Dave Mark

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Search Optimization

Because we are using the edge values to search for the chosen bucket, we don’t necessarily have to have the buckets sorted by size. However, we can optimize searches through having our buckets sorted by size. This method works very well when there are many buckets of widely disparate sizes. We can construct an example of when this optimization is useful by using a quadratic distribution such as:

If we use this formula over the x range of 0 to 30, we find that the probabilities (y) of any given x range from 100 to 10. That gives us a large difference in bucket sizes. This is even more apparent when we realize that the final ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required