Tag Info

New answers tagged

1

The two options I see are to record per-player visibility flags within the grid points themselves, and then (somehow) update those flags each frame... This seems like the right answer to me. Store whether or not each player can see each grid point. Updating the map can actually be very simple and efficient. You presumably already update each unit. When ...


1

I think, that's work for influence maps. It's almost your first option but in more common interpretation for AI in games. Influence maps presents all your map with grid in some specific structure. For each cell you save some value and periodically update it. In your case, you can save last_seen_time as value. So, when you'll iterate scrap to find new target, ...


1

Lærne's suggestions are great, but I would also suggest a dynamic bounding volume tree of AABBs. Conceptually the dynamic bounding volume tree keeps a balanced tree of nodes which can be queried at any time for near elements by passing in an AABB and retrieving an overlapping pair. The tree is not rebuilt every frame. Instead each node's AABB is slightly ...


4

KD-trees are definitively not dynamic enough to be considered, honestly. Moving a few units can easily require you to rebuilding of the whole KD-Tree. A KD-tree is very efficient for queries, but not much for neighbor searching. A quadtree is more flexible over time, as the location are more local. The disavantage is that if you have a lot of unit at one ...



Top 50 recent answers are included