No one gave you the real answer so here it is. The book that all the RoTK games, shows, and movies are based off of was written a couple centuries later around the time or a bit after of the fall of the foreign Khanite led Dynasty, the Yuan dynasty.    The northern Yuan dynasty did not fall all at once, and for a while they stayed in contention with the Southern Ming. Luo Guanzhong might have been putting the names Liu Bei,Cao Cao and Sun Quan on paper, but it was really exposé on current or recently historical political events.     The southern Ming saw themselves as fighting an illegitimate foreign Dynasty to reestablish a dynasty ruled by the ethnically Han people's, in the same vein as Liu Bei trying to reestablish the venerable Han Empire in Shu-Han from Wei usurpers.    So Liu Bei became an allegory for the southern Ming patriots and Cao Cao for the evil northern led Yuan "usurpers". Basically RoTK was written to be propaganda so of course Liu Bei was righteous and Cao Cao the cynical villain.