Sunday, August 9, 2020

Truck Quest: Geographic Bias

People think it’s a good idea to publicly reflect on building your game after you publish it — Emily Short recommends it in her post about the 2018 IF Comp Post-Mortems, although the 2019 IF Comp was followed by some active author discussion (and disagreement!) about whether those reflections should be called post-mortems.

A few things could be done differently with Truck Quest, like communicating the player’s movements through the territory of the game. When I was trying to write code to handle the player's movements, I learned that I have a hidden — but powerful — geographic bias.

My thinking was that a long-haul delivery from California to New York would involve more risk (earning more of a reward) than a shorter delivery between two cities in Kansas, and I wanted to show that. But cross-country trips were going to be the final phase of the game. In order to give the player a sense of progression, they were going to start making deliveries in town, working their way up through deliveries across the state.

I had to keep track of whether the player was in one side of a territory, the center, or the other side, and I used three different arrays to hold potential destinations.

If the blue oval is the available territory, then it doesn’t matter whether we call it a city, state, or country. Moving from A to C travels across all three regions, which is clearly the risky long haul. Staying inside a region would be playing it safe. And the AB or BC deliveries would involve a moderate potential for failure. 

Destinations were put into arrays that I named $aPool, $bPool, and $cPool, because I read from left to right. This decision was a terrible mistake. 

When I tested it, you could select a destination in the eastern region and arrive in the west. Or head west from the center and wind up in the east. Or the message would say that you were heading east when the game was actually sending you to the west. Or you’d head east from the western edge and wind up in the center, which is correct but confusing because the code refers to A, B, and C. 

It reminded me of the “missing exit” in Zork, when you’re at the “south end” of a large temple and expected to travel north based on the description alone. Geography is hard.

The main lesson learned is that things are less complicated when your code resembles the information presented to the player. I should have used $westPool, $centerPool, and $eastPool for the names of the arrays. 

A less important discovery was that I put “east” first every time I list directions, even when I’m intentionally trying to start with the west. 

I’m not entirely sure why that’s the case, but I have my suspicions.

No comments:

Post a Comment