⬅ Back to Analytics Home

Grid Guessr Explination

Overview

I am in a discord server that is full of massive geography nerds. Of which I am not really one. While I certainly know a lot about the world, capitals and cities and countries and whatnot, some of these people are far smarter than me. To the point where we were playing a guessing game of cities, where the only hint was a map of the cities road layout. I had used OSM previously to generate road layouts for cities, so I figured why not make it into an actual online game.

Results

The game isn't perfect, I don't have the free storage space in my stack to add in all of the Asian cities, and some of the city coordinates are incorrect. I am, as I play the game myself, slowly working my way through fixing those any time I see one that is wrong, but the game is largely in a playable state and can be played HERE!

My initial plan was to generate each map randomly from a list of cities each time someone pressed next round, but unfortunately, it takes time to generate each map (15 seconds to 5 minutes depending on the size of the city) so that wouldn't work too well for an online game. Instead I had to generate all of the images myself and store them somewhere that I could simply chose from randomly, which worked, however I couldn't store them on my laptop so I had to use a different service (cloudinary). Then I just stored empty png's on my laptop which I use as the answer key/correct answer/acceptable answers list.

The game isn't perfect, I don't have the free storage space in my stack to add in all of the Asian cities, and some of the city coordinates are incorrect. I am, as I play the game myself, slowly working my way through fixing those any time I see one that is wrong, but the game is largely in a playable state

After I got all the maps, I split them into buckets by continent so that I could just pick a folder for each level such that when you choose that level it randomly selects images from that folder. Then I made the game logic such that you can't guess cities that aren't in the list, and you can guess the city in any state with spaces and capitalization I think, instead of specificall City_COUNTRY which is what they are all stored as. Finally I added the world levels which select multiple files, and the individual country files that select the same files but then further filter for country for the countries that have enough images. I also had to generate a list of coordinates for all of the cities to calculate the distance between the guess and the correct city. Most of that logic is in the python game code however.

Data

All of my maps were created by me, using OSM data, a free open source mapping software, that I love using.