dessertmonkeyjk said:
I've been fiddling around with this idea in my spare time but if each society (nation, town, clan, etc.) has a shared ideal of what's good and bad then that's how they'll judge your moral. Then there's the personal relationships which are more specific such as agreeing with a society standpoint but not on how they handle it. Then there's you. There is no true line of what is right or wrong when what you think is right will be considered wrong by someone else.
Now... how do we make a system for that in a video game?
(Hint: you need to be thorough)
It is rather easy, really. Also, really time consuming and hard.
EDIT: Damn, it came out a wall of text. I wasn't even really as thorough as I wanted to be. Sorry people, I'll try to add a TL;DR version.
Let's start with the first bit -
society morals. Society is a bit misused here but let's go with that - by society we're talking about a group of people - be they the population of a city/country (it's just that fantasy countries either tend to be small, or take up all the space and just have diverse cities), or maybe the followers of a religion. As a whole the society has certain moral norms, let's say, for the sake of the example, that these norms are "Don't steal", "Don't kill" and "Don't disturb the peace"[footnote]For the sake of simplicity in video games, let's have that mean "don't draw your weapon in public"[/footnote] (rather generic but easy). So the society would have laws to restrict these offences. Another society might have a different set of morals, for the sake of the example again, let's say it's the previous three, plus "Don't ride horses in the city." So, if we have both previous societies representing different medieval-ish cities, city A and city B will impose fines for different activities. That means that you can happily gallop though the main street of one on top of a horse, but the same act will get you fined in the other one.
This is an example of different morals of societies. Travelling to a different area (city/kingdom) will come with at least slightly different restrictions. But we can elaborate on this. There are different degrees of how "bad" each of the actions is. Let's assume that city A considers stealing a really big offence - on par with killing[footnote]Why would that be? Exercise for the reader - there could be a lot of interesting reasons for that - maybe something to do with the mythology (say, if Eve is considered to have stolen the apple)or maybe it is a generally a poor but hard working region and stealing is not only a sign of laziness but it's could potentially really inconvenience the victim - making them work doubly hard to make up for the loss. Or something else entirely.[/footnote], while in city B stealing is a rather minor offence - the fine would be the price of the stolen stuff plus 10% on top. This gives more of a feel of difference to the different societies. And maybe some offences are considered really minor and aren't enforced by the law but people would just avoid you - maybe the "don't ride a horse" thing isn't a punishable offence but if you do ride a horse in the city, most people would avoid and not talk to you until you get down.
So, until now, we have a way to represent morality (only actual offences, more on the other part later) for different areas. While the cities (yeah, let's go with cities) may have uphold different morals, they aren't the only thing that comes under "society". So for our fictional example, let's add religion and a thieves guild. Each of these societies would have their own set of morals that could very well be different from the general ones.
Let's examine the religion first: maybe it could be considered a "good" religion, so the the general rules of the city are also their own - they don't steal or kill. They could have more harsh penalties for some offences, though, let's say you draw a weapon in front of their temple - the religious society would
not appreciate that one bit. But aside from the current laws carrying different "weight", they also have some laws of their own - in addition to the normal ones, there is "do not cover your head in a temple"[footnote]Yes, "no hats inside". Just roll with it, I couldn't think of something better for the time being.[/footnote] - another different thing to distinguish a society.
And now how about the society of thieves? They would certainly not have the "don't steal" rule and can very well not conform to the city regulations at all. Let's assume that their laws revolve around "honour among thieves", so their rules are "Pay your membership tax regularly", "Don't kill another thief" and "Don't use bows"[footnote]Rather easy to implement in a game, that's why I chose it.[/footnote]. Obviously, the dissonance between their morals and those of the other societies conflict. And that is the beauty of it - it further distinguishes their societies and norms.
So those are all ways to shape the ethic outlook of societies. But what about actual, you know, goodness, not just the sins? Well it's not hard to implement, one way is to give benefits to those who keep to the rules - money, respect, housing - it depends on the society. Respect is the easiest to represent, so let's go with that. I rather liked what the Elder Scrolls did with the reputation (mainly Morrowind/Daggerfall), so why not have something similar - people have a certain amount of respect for you and if they consider you moral, they would respect you more. Aside from the pure laws, there can be other morals that aren't punishable but do make people respect you more or less depending on whether you uphold them or not. If the citizens of city A consider it good to always tell the truth, then in conversations lying can make you lose respect while confessing or uncovering lies can gain you respect. The religion, however, may have it's own virtues as would other societies.
...
So, that's about societies. Rather basic but it serves as an example. Society's morals are partly upheld by law and partly by respecting and liking those who they deem virtuous.
Now, for the next bit -
personal relationships. Frankly, I didn't exactly catch what you meant, but I believe it's about specific NPCs views on morality. So, I will handle it as personal ethics for the other characters. Just give me a shout if you meant something else.
So, it is, well not too hard to do it, although there are some limitations (more on this below). First of all, not all NPCs will have the exact same moral values. Working within the framework we have, let's say that one NPC citizen has a really strict views regarding stealing. If they witness one, they are way more likely to report it, or perhaps outright attack the thief. In the case of the player, this could mean that they would report you no matter how much respect they've had so far for you. And perhaps the loss of respect would be greater in them, than other NPCs.
So far so good, but we could also have NPCs who are rather lax on some of the morality points, so another citizen could maybe not very much care if they witness stealing. This is a conflict between the society and the NPC, on the other hand. Similar to the real world, the NPC will have to choose exactly what to do. The easiest thing to do is to only report the crime, if there is a guardsman nearby or other citizens. If there aren't - then tough luck. Our "less moral" citizen walks of with clean conscious, so to say - society can't judge, if they don't know about the moral slip. Also, if they witness the player stealing, there may still be a loss of respect but a minor one.
NPCs with vastly different moral values than the others around them will be faced with a choices:
a) they grit their teeth, so to say, and continue living there. Depending on how different their morals are, maybe they can survive without getting into trouble. Or maybe they can't and will fall victim (figuratively or literally) of society's laws.
b) They leave and join a different society that better supports their views. So maybe somebody will join the thieves guild, if they don't believe in any of their city's morals. Or they could move to another city, if that would work. On the other hand, if an NPC values the moral laws highly, they could join the religion.
c) They become pariahs and just leave. They could just travel a lot or settle down away from other people, whatever makes more sense.
d) They band with other people with similar views (assuming there are any) and form another society. Maybe they start a religion or go and build a new village.
Well c) and d) are slightly harder to implement but that is because I'm rather vague there, if we can have some more concrete rules if there is an actual
game we're talking about or we're creating one. But for now, it's just vagueness.
Finally, NPCs could very well have some moral views on their own, not just modification of the society's. One may view using bows as "sinful"[footnote]OK, that ma not be the best example but it's just an illustration. I can't think of anything better at the moment.

[/footnote] (assuming they aren't a thief, of course) and as such the player would lose respect with them over it. And so on and so forth - in short, NPCs could have some individual morality outside the society's.
But as I mentioned way back - limitations on the personal relationships. And that limitation is the respect. It could start to vary too wildly over sensitive matters amplified by personal views, or, if improperly handled, it could barely make a significance. It's not actually
that hard to make the respect meter/value behave as intended, only the description so far is rather vague, we need something more final to do it.
...
And finally
you.
That is the easiest and simultaneously hardest part. It's easiest because you as a player are making the choices. Depending on the society, their morality views may make sense to you or they may sound like absolute bullshit. So you can choose to stick to the morality or not, maybe even find just play in a society where the ethics make sense to you. That's the easiest part. The hardest part is having writers who present actually sensible moral choices other than the typical "It was nice seeing you. Have a nice day!"/"Bye."/"I will kill your firstborn, drink the blood and rape the corpse!"[footnote]You know what I mean.[/footnote]. So, in short - you choose your own actions, thus your own views on morality, but the choices you can make are limited by what the game offers you to choose from.