Show HN: 1990s Game Dev Algorithms for Distributed Systems
16 hours ago
- #blockchain
- #spatial-indexing
- #smart-contracts
- Mercator is an open-source spatial indexing library for Sui that enables trustless polygon registration with zero overlap directly in smart contracts.
- It employs 1990s game engine algorithms, including AABB for filtering, quadtrees with Morton Z-curve for indexing, and SAT for collision detection, all using integer-based arithmetic for deterministic results.
- On-chain collision detection prevents double-claim problems by ensuring atomicity, unlike oracle-based solutions that are vulnerable to race conditions.
- The system scales logarithmically, with costs starting at ~$0.0065 for a 4-vertex polygon, and remains efficient even with many objects due to parallel processing enabled by Sui's dynamic object model.
- EVM, Solana, and Aptos face limitations like gas costs, static memory requirements, or concurrency issues, making Mercator incompatible with those platforms.
- Mercator imposes constraints such as convex polygon decomposition, DOS limits, no privacy, and a flat coordinate system, but offers open-source modules and a live demo for practical use.