Skip to content

v2.2.0 - Grid optimization for ComboZones, improved exhaustive helpers for ComboZones, and more controls for BoxZone creation

Compare
Choose a tag to compare
@mkafrin mkafrin released this 05 Sep 16:34
· 34 commits to master since this release

Given the performance improvements made on ComboZones, I think this release can only be summed up with the following gif. Just imagine each gold coin is a zone...

This release adds:

  • Grid optimization for ComboZones
    • This enables an utterly massive amount of zones (if not all clustered together). When I say massive, I mean tens of thousands at 0.01-0.02ms before you hit the annoying memory warning banner in FiveM, and hundreds of thousands if you don't care about that (or spread them across multiple resources). So go wild I guess?
    • This optimization also removes a lot of the performance cost of using the exhaustive helpers. There is still an additional cost, but it's a lot smaller than it was before.
  • AddZone() for ComboZones
    • You can now add zones to ComboZones post-creation. This is less performant, because it clears out the grid optimization, but because the optimization is built up on the fly, if this is done early enough (before any of the optimization has been built up), the hit won't be too much.
  • More useful exhaustive helpers for ComboZones
    • onPointInOutExhaustive and onPlayerInOutExhaustive now also pass enteredZones and leftZones to the callback. See here for more info.
  • Added height controls to BoxZone creation
    • There is now a special "Height" mode to BoxZone creation that allows you to change the Z of the center of the zone, the minZ, and the maxZ. See here for more info.
  • Change datetime format on creation printout to ISO 8601
    • Yeah, I have no idea why I didn't do this before.
  • New example resource that includes Circle, Box, and ComboZones, as well as shows off the exhaustive helpers for ComboZones.
  • Various other memory and performance improvements

The resource itself can be found in PolyZone.zip. You can grab an example resource in PolyZone_Example.zip.