If the "goodness" of people is computed from a root motivation of "survival," then it's fairly straightforward to align things according to "circles of influence" (self, family, groups of which one is a member, mankind as a whole, etc.) to determine a "net vector" which kind of indicates "how good" someone is.
If it's "all about me," and family, groups (including nation), and mankind don't figure in at all, we have, what, a potential sociopath?
To the degree that one's survival is calculated in terms of family, community, human race, etc., we have levels of "enlightened" self interest.
Most people of my acquaintance act with deliberate intended benefit for at least themselves, their family, and their [favorite grouping] (club, church, state, country).
Things can get pretty screwed up when the survival alignment includes only, for example, self and "all life" (where, mysteriously, "mankind" doesn't seem to be included).
In certain totalitarian regimes, we have seen young people "programmed" to survive as "myself and my country" with family pushed off to one side unless all members align with "my country."
So, in my estimation, there is a basic "goodness" to people. And then there is cultural programming, which can screw up the alignment of vectors in the various "circles of influence."
Without weird programming, the "self, family, my society" grouping is almost a given.