I need some help making the coordinates system, in the previous version of village wars, the coordinate system was like this:
There was a db table with lots of X,Y and with a row saying if it was available.
When a user registered, i would try to get a random from that list, and see if it was available, this random thing was made to be in a range, like 0 to total_players + 100 so nobody gets thrown to the other corner of the map

Ok, so in this new version i want to make a better system to apply coordinates to people, what you guys have in mind?
Also have in consideration, that it would be better if the coordinates were padding 32,32px from each other, so in the map there are 32x32 images for each village.
Any help will be credited in the final version. It would be cool to release this as a community project.