There are some games that attempt to tackle the heavy subject of racism by exploring how it affects those who are subjected to it, though worryingly there are also some that seem to have an undertone of racism in their subject matter or treatment of in-game characters, whether intentional or otherwise.
In video games, racism is often represented in terms of species, such as humans and elves, in order to avoid controversy, though the discrimination presented often has parallels with real-life racism.
Though set in a fantasy world with monsters and magic, The Witcher does not shy away from real-world parallels. In the world of The Witcher, Dwarfs and Elves are looked down upon at best and shunned from society at worst, driving some of them to take up arms to fight this inequality. The player is caught in the middle.
In Vampire Bloodlines, you get to know a group of outcast vampires on the beach of Santa Monica, most of them scared and confused just trying to find somewhere they won't be chased away. In the World of Darkness setting, vampire mythology talks of the "Time of Thin Blood" supposedly preceding Armageddon and so these young vampires of unclear lineage are regarded with suspicion and hostility, particularly by the superstitious...
In Square's Tom Sawyer a runaway slave named Jim is portrayed as having giant red and orange striped lips, pitch black skin, a bright orange afro and small white eyes. His appearance, which is considered racist and offensive in North America, is said to be one of the reasons why the game was never released in the North America, despite being based on a story of a famous American author.
In BioShock Infinite, the issue of racism is dealt with more directly in real-world terms, dealing with white racism towards blacks and Native Americans in early 20th century America, rather than the more common video game scenario of human racism towards non-humans.
A History of Insensitivity, IGN