SimpleZone | A simple, fast and new Zone module!

Yeah I can’t access it on the website, but downloaded it from your updated post and can now mess with it! Thanks again!

1 Like

I tried implmenting the changes but the performance is still at 95%


image

my zones are pretty big, their sole purpose so to detect when players get in or out or even teleport out of the zone and remove/give items

Hello, can i see the full performance page thing? I wanna see what it is measuring

yep, also im testing this in studio although I don’t think that would make a difference

Hello, if you have alot of parts unfortunately this is just a limitation with how the spatial query api works (it can get very active the more parts there are in the game), here I would just increase the UpdateInterval to maybe 1 second and maybe increase OverlapParams.Tolerance to do make it so that calculations arent too precise as it is not needed.

I do have an idea on how to fix this, and will try writing it out before I can implement it in the next update in the future.

1 Like

Honestly, here I would just use the other module LessSimpleZone and use Zone:IsPointWithinZone() to check if a player is outside the duty zones. It would be much more efficient than what you are doing right now

Alright i will check that out although I have around 9 parts only

1 Like


reducing it to 1 does help yes

1 Like

Hello, my laptop is finally fixed so i can roll out all pending updates for my modules! The order will go SimpleZone → LessSimpleZone → BufferConverter2 → ActorGroup2

Package Version 49:

  • Fixed OverlapParams not being passed to PART_QUERY_JUMP when doing part queries
  • Added metadata for SimpleZone.fromParts() (and all associated constructors like .fromPartsLPO(), example:
    local zone = Zone.fromParts(workspace.Zones:GetChildren())
    zone:ListenTo("Player", "Entered", function(player, metadata)
        print(player.Name .. "entered " .. metadata.part.Name .. "!")
    end)
    

The module download has been updated and I am currently working on a github repository :slight_smile:

1 Like

Just a heads up, OverlapParams.FilterDescendantsInstances(same with raycasts + canquery etc.) doesn’t only search through the provided instances. It just excludes others from the list that gets returned by spatial query. Haven’t taken a look at the source code, but if you haven’t already, you should see some huge speedups by making a custom worldmodel instance any time you want to use spatial query, and running spatial query api off of that. That way it’s only ever searching through the parts you want rather than anything in workspace. This can cut down costs a lot if you have a densely populated area of queryable baseparts but only want to search for specific things.

2 Likes

yay finally simplezone is back in action

I currently am working on a new update utilizing WorldModels however the 1 issue right now is that player events r just broken :V once i fix that ill release it because just like tyridge said it was pretty performant

Package Version 54:

  • Added “Query Spaces” which are WorldModels for each individual Zone which is seperate from Workspace.

    To activate query spaces for a Zone, you must set .InSeperateQuerySpace to true inside QueryOptions.
    There is also QueryOptions.Static which you should set to true if your zones do not move. (Doesn’t matter for box zones)

    Query spaces are empty by default and you have to add objects into it via the new Zone:CopyToQuerySpace() method which creates a synced replica of BaseParts into the query space.

    With this new way of doing queries, performance has been significantly increased because now you can select what you want to be queried
    (Querying a .fromParts() zone of 20k parts every frame, I have only added my character body parts into the query space)
    (Bar height is relative to 1/30 seconds)

  • .fromParts() and .fromBoxes() constructor now won’t construct metadata objects if AcceptMetadata is false
    image

  • Changed the BVH split function to use table.move() instead of unpack(), this makes it usable for big zones

  • Deprecated .fromPartsUpdateable() and .fromPartsLPO() (Hopefully will be replaced by more general constructors in the future)

Downsides to query spaces

  • Because there is so much tracking involved with query spaces, it may take up more memory than desired. In that case, you may not wanna enable query spaces at all for your zones and stick to the old way of queries.

The download link has been updated, the marketplace link is still down :frowning:

I am aware there is much memory leak/issue potential with this update, however I am planning on reworking the entire system anyway so consider this a uh intermediate update :innocent:

Honestly now I’m kinda realising SimpleZone has evolved far from being simple, I guess that’s up for debate though :V

Package Version 61:

The download link has been updated with the newest version

Package Version 62:

  • Fixed .fromParts() metadata passing the replica as the zone part instead of the original, now you can create big zones with .fromParts() and still have each part act as an individual zone (if the zones dont touch eachother)
1 Like

Package Version 67:

  • Added Zone:UseQuerySpaceOf(otherZone: Zone | "self"), Zone:OverwriteQuerySpace(otherZone: Zone), and QueryOptions.QuerySpace as ways to not use up memory having query spaces for each Zone.

Is there an updated or even editable testing places with some of the features set up… I did not see one at the top of the post

Thanks

1 Like

Here is the new test place (has also been appended to the main post):

SimpleZoneTest.rbxl (523.7 KB)

It showcases the speed of query spaces by having 40k non-block parts as 1 big zone and only adding the player character to the query space, you can also try adding more moving parts to test how much you can do before it starts becoming laggy :slight_smile: