I'm writing a game where a large number of objects will have "area effects" over a region of a tiled 2D map.
Required features:
- Several of these area effects may overlap and affect the same tile
- It must be possible to very efficiently access the list of effects for any given tile
- The area effects can have arbitrary shapes but will usually be of the form "up to X tiles distance from the object causing the effect" where X is a small integer, typically 1-10
- The area effects will change frequently, e.g. as objects are moved to different locations on the map
- Maps could be potentially large (e.g. 1000*1000 tiles)
What data structure would work best for this?