Are actions in computer games bad for karma? What if I play a bad person in a computer game, cheating people. Or I play an assassin who kills people. Or my character in a game belongs to some evil cult. Or I roleplay a thief and steal. Or my character has an affair with a woman without being married.

How are all these actions in a virtual reality close to actions in a real world from a buddhist point of view? Yes, I do not do them for real, but I still make these choices using my free will. So is it the same if I did all this in real life from? Are they bad for my karma?
There are two parts to karma: 1) external forces/energies you set in motion with your action and 2) latent tendencies and inclinations in your psyche - that later become your action and reaction, that then sets external forces in motion.

If you step away and look at it from a distance, there is really no hard line between "external" and "internal"; karma is a network of subtle potentialities.

Some of the potentialities are pretty subtle, yeah - like the ones involved in playing videogames - but they are still real. Very few of them translate 1:1 to analogous actions in real life though.

For example, mass-shooting in games is not even remotely the same karma as real murder, but you still separate "yourself" from "others", and you still desire good for one's own character at the expense of everyone else's. Amassing golden coins in game is not real, but you still go after "fruits", get frustrated when things you like a taken away and so on and so forth. Guess what kind of latent potentialities, however subtle, all this creates/reinforces?

Actually, when it comes to karma, "subtle" does not mean "weak". Some of our deepest hung-ups come from our subtlest preconceptions.

So I'd say in general the games you play may not create a lot of new karma, but they certainly reinforce your inner tendencies and preconceptions that keep you chained in samsara.