First of all you are assuming, as you said, that you can store whether a unit is or isnt at any given coordinate:
QUOTE
If there is 128X128 map, assume that we can store whether there is unit or not in every coordinate. So if there is any unit at (0,0), (1,1), (2,2), (3,3) then system will store the information like this.
That first part would probably be very hard to accomplish and I think you would need to figure out a system for that first.
Then detecting each individual unit based on the coordinates will be even more of a problem because you must distinguish between each individual unit, as you have also pointed out.
In my experience I've tried calculating a unit's position using coordinates and storing them, and I think it would work well only for a small number of units.
At first I used Tuxedo-Templar's Zoning method:
http://www.staredit.net/index.php?showtopic=9404And it worked pretty well, and I created a realistic bouncing ball map where a scourge would bounce off the walls on an angle calculated with it's coordinates. Here's the experimental map I uploaded to the DLDB:
http://www.staredit.net/index.php?download=3717But one problem is that Zoning requires units being given back and forth between a player. Now you need one set of X and Y axis for every unit you want to find the coordinates of. Even with just 2 or 3 sets of these it creates a lot of lack giving units back and forth constantly.
What I tried doing was instead using locations. Now even though it requires a lot of locations, it wouldn't cause the lag that using units would cause. You would just use rows of horizontal and vertical locations to find the coordinates.
I never finished an experimental map using locations and coordinates, but I think it could work.
EDIT:
And about storing this information, maybe with EUD's for HP detection, you can set a unit's HP to store it's position on the grid, and then detect it with EUD's. I was thinking through like a unit's Shield/HP points, one to represent X and one to represent Y.