Warning: This discussion contains spoilers about the second season of HBO’s “Westworld”

With its story of life-like robots in a Wild West-themed amusement park becoming sentient, and the complications that arise as a result, the television show “Westworld” has attracted a dedicated following over the past couple of years. Yet on the latest episode of the HBO drama, the setting shifted from the American frontier to a very different place — Edo Period Japan.

The second season’s fifth episode earned positive reviews from English-language viewers in large part because of its shift from a park populated by robot cowboys to one occupied by robot ninja and geisha. A large part of that praise stemmed from how the folks behind the show aimed on getting the culture and time period right, and in the process showed how other entertainment ventures made by Western creators dealing with Japan (or any non-Western country) can avoid online backlash.