Context:
We’re developing a game where 10+ players (represented as red blobs) move across a 1000x1000 stud area divided into pre-existing spatial chunks (for optimized management). Players need to collect orbs placed on the ground.
Current Challenge:
We need an efficient way to detect when a player picks up an orb. A naïve approach using :GetPartsInBoundsInBox()
/:GetPartsBoundsInRadius()
in a per-frame loop for all players causes performance issues.
Goals:
- Minimize computational overhead for orb-player collision detection.
- Leverage the existing chunk system for spatial partitioning.
- Ensure scalability for 10+ players and potentially hundreds of orbs.
Proposed Solutions?
- How would you implement chunk-aware proximity checks?
- Are there optimized Roblox APIs or patterns for this?
- Should detection happen client-side (with anti-cheat) or server-side?
Key Details:
- Orb positions are static until collected.
- Players move continuously.
- Chunk system already tracks orb placements.
Looking for architecture/algorithm recommendations to reduce redundant checks while maintaining responsiveness.
Here is an image to see how this looks: