finds.dev

cloudwu/aoi

Area of Interest Library

View on GitHub

★ 308Cupdated Jun 2012

// the take

A minimal C library for area-of-interest management, the classic MMO server problem of figuring out which entities can see which other entities as they move. Written by cloudwu (also known for skynet), it's meant to be embedded directly into a game server's update loop rather than used as a standalone service.

The API is refreshingly small: create, update (with watcher/marker/both/drop modes), and a callback-based message pump, so it's easy to wrap in any language via FFI. It takes a custom allocator per space, which matters for a library meant to sit inside a hot game-server loop where you want control over memory pooling. The watcher/marker split is the right abstraction for AOI (an entity can care about others without being visible itself, or vice versa), which a lot of naive AOI implementations get wrong.

The algorithm itself is only explained in a Chinese-language blog post linked from the README, so anyone who doesn't read Chinese is adopting this on faith. There's no license file, which is a real blocker for anyone trying to use this in a commercial game server. Last commit is from 2012, and test.c/testmap.c look like manual example programs, not an actual test suite, so there's no confidence the code still behaves correctly on modern compilers/platforms. No documentation on the underlying spatial structure (grid? tree?) or how to tune it for different world sizes and entity densities, which is exactly the kind of parameter you need to get right for this to perform at scale.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
308
Forks
101
Language
C
Last commit
26 Jun 2012

// nearby

If aoi isn't quite it.

All repos →