Currently, the continuousBeam search algorithm loops through all objects in an A x A bounding box, where A is the length of a single beam segment. Since A can be very large, this can involve a lot of objects that are unnecessarily looped through. This optimization breaks it down into a series of B x B bounding boxes, where B << A. By doing this, we avoid looping through a lot of objects that we may have otherwise looped through, resulting in a massive performance increase when using hitscan beam weapons with very long ranges.
Currently, the
continuousBeam
search algorithm loops through all objects in an A x A bounding box, where A is the length of a single beam segment. Since A can be very large, this can involve a lot of objects that are unnecessarily looped through. This optimization breaks it down into a series of B x B bounding boxes, where B << A. By doing this, we avoid looping through a lot of objects that we may have otherwise looped through, resulting in a massive performance increase when using hitscan beam weapons with very long ranges.Demonstration video: https://streamable.com/511kjz