All drop modes unraveled

Hey there! December is half gone and I’m really curious to see if we can set a new player record during the hot remote Christmas party season!

Until then, I’d like to explain how the two available random drop modes (“anything goes” and “near city regions”) work and how I intend to develop them further. So, strap yourself in!

Anything goes

This mode was the mode I implemented first when building the application. I wanted a solution that was easy to maintain and quick to ship. I also explained it a bit in the last blog entry “Why Germany sucks”. In a nutshell, it works like a random latitude/longitude picker, that will contact the static street view api to check, if there’s a street view panorama in it’s vicinity. If so, this response will be used as the starting point for the next round. Of course, the algorithm won’t just randomly pick any point on earth, but will use a curated list of country polygons in manually prepared as a boundary.

Almost all of Ireland’s land mass is used to find a street view panorama

Many countries do have an impressive street view coverage and I was able to just trace the borders and let the algorithm pick some random spot, which would magically lead to a valid street view panorama. In some countries, I had to manually leave out some areas that had lacking coverage or no coverage at all. In Ireland’s case, you can see that I omitted some parts of the northern coastline because finding a panorama there was error-prone. There are also countries, where the polygons are even fewer and farther between (Germany, Canada, Australia etc…).

Why this approach? Even though it often leads to questionable results (indoors, rivers, forests), it was easy to implement, the manual labor was manageable by a single person and I was able to release the app this way very fast. Since that was my main goal, I went for it. After collecting feedback and playing this mode a lot by myself, I saw all the obvious shortcomings and tried an alternative solution to generate better drops.

Behold: Near city regions!

I really wanted to fix the issue of dropping the player in no-mans-land. I thought to myself: Why not have list of all cities in the world and start the panorama search from there? Then it would be guaranteed, that the found panorama would be near a city, or at least an urban area of some kind, which in return would lead to more fun!

So I went out and searched for free databases of cities. There’s a lot to choose from and I tried out a couple sources until I settled with a database of roughly 210.000 worldwide cities. Since they all came with an iso2 country code and latitude/longitude data, I was able to easily map them to my existing country data and use an alternative algorithm to request the actual panorama.

So, instead of picking a random coordinate in a polygon of a country, I would fetch a random city from this same country via an api against my backend and would use the result as a starting point for the panorama search. I blurred the coordinates a little (in a radius of ~1km) before the search begins to prevent getting the same panorama each time the same city is picked.

Did it work? Yeah, kind of. In countries with good coverage, the results were awesome. In countries with bad coverage, it didn’t work. In those countries, this approach was bound to fail from the start, since randomly selecting a city somewhere in the country, the results might be very far off the next covered street view panorama. So I deactivated this drop mode for such countries, because the the google api had to be contacted a lot before it returned a result, which usually was a bad panorama anyway (big search radii are a no-go).

In the end, it still is a valid drop mode and when playing privately, we usually tend to pick this one.

The future of drop modes

Generally speaking the drop modes are rather similar and have the same huge drawback: Unreliability of the drop panorama and consumption of google maps api quota.

Wouldn’t it be nice, if every possible drop all around the globe was handpicked, validated and approved? Yes, yes it would be. It would solve every issue that comes with the other drop modes. The drops are guaranteed to be fun (no 100km roads without signs, no dead ends, no forests, no rivers, no museums) AND to top it off, the street view api wouldn’t have to be called to search for the actual panorama, since the spot already features one (similar to the “Popular Landmarks”). Plus, every country could be included, even the ones that only feature very very very little street view coverage.

The only thing left to do, is to manually comb through the whole world and place markers on good panoramas. The algorithm can just pick one randomly and that’s it! How long could that take?

That’s what I’ll be going to find out. Of course, doing that alone as a single man army is a bad idea. It might take forever. So I will provide some kind tool where everyone can help to curate the whole world! I think that this mode will eventually replace the other modes as soon as the data is large and diverse enough. So, stay tuned! Things are going to be getting even better!

I love creating stuff, which includes art, software, games and music.