Saturday, April 11, 2020
We tried to make these to add some interest to the game without being a distraction. This is a balance in how frequently these signs should show up. We also did not want to take on the burden of having to manually generate these signs across all our routes, so we needed some sort of algorithm. We wondered if real civil engineers face a similar problems when they have to decide the signage to put on roads.
We settled on putting the first sign about 10 miles into the route and spacing them about every 30 miles. We think that provides a good distance between them and matches our intuition about what our real-world experiences have been on the road.
Deciding on where to place the signs was the first design decision, but the somewhat more complex decision was how to decide "what" should appear on the signs. Which cities warrant being on there and which ones do not? The size of the city certainly matters, but so does its proximity to the current location. This initially seemed like it could get complicated with a lot of nuances and edge cases. In the end, we found something relatively simpler that seems to do a decent job of mimicking the real world.
We use a two pass solution, looking for major cities first, out to the fixed distance of 120 miles, and then filling in minor cities between the the current location and the first major city. A major city is defined as one that has a population over 250,000. If there are no major cities in the next 120 miles, we simply take the next 3 largest cities to show. Simple, but seems to be effective.