This seems pretty dubious. I agree that the history is super relevant, but I don't think that's a NECESSARY condition for racism. It is definitely a trait of the human condition everywhere in the world that people favor their in groups versus out groups.
Of course it is part of the human race but that isn't racism. That is certainly how racists tend to look at the world, members of their own race are automatically in the in-group whether this is actually true or not so other races are the out-group. Racists define in-group and out-group by race, non-racists do not.
Racism did not exist at least to any significant extent prior to about the 17th Century because what defined the in-group/out-group was pretty much determined by religion, location and culture. The race relations of the game (no racism) are a more or less accurate depiction of actual medieval society as far as can be historically determined.
If you want to have racism in the game, then you first have to introduce the possibility of the historical conditions in which racism emerged. Otherwise you are saying that races inevitably clash by dint of some kind of inherant human nature, which is actually a racist idea. I do not want Dwarf Fortress to make racist ideological statements.
So if you grew up in a mixed society AND there were no history of race-relevant slavery or whatever then no, I don't think you'd be racist amongst those groups. However, if you grow up in a very homogenous community, then you would start to be at least a little more racist, just because it would now be lining up that your in group and your racial group are largely similar. I.e. somebody of another race definitely immediately can be identified as not from your hometown or probably your immediate region, so you should be suspicious of them as an out grouper. Not necessarily because of historical anything, but just because skin color and facial features are highly visible and cue you in to them being an outsider.
A genuinely homogenous culture with a long history of being such is actually completely non-racist. The growth of Racism requires not homogeny but a mixed community where race correlates with
heirachical status. This fact that status within the society corresponds to highly visible physical characteristics causes racism to develop. The privilaged race holds the lesser races in contempt and the 'lesser races' hate the privilaged race for oppressing them, creating in-groups/out-groups based upon race.
That is the basis for why I say that naval technology caused racism. While nations had always conquered their weaker neighbors, the fact these neighbors tended not to have significant racial differences due to their geographical proximity prevented the racialisation of the heirachical relationships. The Roman Empire may have conquered most of Europe but it was geographically continuous and focused on the Mediterranean, Italian people do not look greatly different from the Spanish or Greeks or North-Africans.
Those racial differences that did exist with the Empire (say between the above and Egyptians, Middle Easterners and Northern Europeans) are muted in their effect in that the Empire also controlled all the blending zones as well, people gradually become darker or lighter as you move in a certain direction rather than there being any cut-off points.
It was only when improved naval technology allowed people to start conquering weaker people's that were a long way away without conquering any intermediate areas that we ended up with racism. Such conquests correlated status with sharply defined racial differences and therefore racism began to flourish, if it was not simply invented.
If you grew up in Times Square, then you would never have learned to rely on skin color or features, as visible as they may be, as an indicator of out-group, so you will be less likely to apply that as an adult. (UNLESS of course you live in a racially segregated bubble where for instance you see a lot of other races, but they are always just store vendors or delivery people or whatever, because of you living in an exclusive gated community in the middle of everything, etc.)
If everyone you have ever met has white skin and suddenly you meet someone with green skin then the only effect is: That's odd someone with green skin. If a lot of people with green skin start appearing then it is no longer even odd, it is a matter of a shrug of the shoulders, green skin simply becomes a normal skin tone. You have never developed the tendency to classify people by skin colour because no opportunity to develop it ever existed.
Your exclusive gated community on the other hand is exactly how we get racism. If all the people you meet that have green skin are found in subordinate roles then you develop a sense of racial identification in addition to a sense of racial superiority. You start to think that white people are 'better' than green people (morally, intellectually, physically etc) and that is why your racial group are in charge.
To get into game mechanics, in order to have racism we must first introduce a colonisation mechanic by which a conquered settlement is colonised by people from the core civilization. As the settlement is normalised (it takes on normal positions and is converted into a liked settlement type) the settlers try and monopolise power, excluding members of the native population from having a shot at the new positions.
If they suceed then the central government (the law-giver) has to decide whether to allow them to do this, that is exclude the key positions to members of their race. If they are prevented from doing this then this hurts colonisation of the settlement while reducing racism points but if they are allowed to do this then the civilization gains racism points, which causes the whole civilization to suffer from racial conflicts as well as reducing the chance of leaders of other races coming to exist.
If the natives are oppressed and there are still enough of them they may overthrow the settler's government, restoring the original government based upon the pattern of their former civilization. The central government may grant them autonomy, in which case they remain part of the civilization but internally function as part of their original entity and the civilization loses racism, or it can boot them out in which case they gain extra racism points and the settlement rejoins it's original civilization.