I have (or will have) a coordinate-based world in my game and I can't find a good way to do it. Should the coordinates, in a hash table, contain the objects in the game?
Or, should each object in the game have coordinates, and write a function to compare distances between objects? Each object type (people, items,...) would have to be in separate lists/trees, and each list would have to be searched, which seems very expensive.
What is a good data design to represent multiple objects in a coordinate-based world, where it is fast to find the distances between them?
Im kinda high, hope that made any sense.