Prepare to have your mind blown.
tl;dr We have to move SB up one notch on the rankings
+1 your small civ is no threat
This is based on Leader, Ranks, and # players.
So, when RankDiffAttitude * rankDiff / (allPlayers +1)
is >= 1, you get +1 attitude
allPlayers is all players, even dead or unmet.
In your example, K. Khan has a iBetterRankDifferenceAttitudeChange of 3
KK doesn't give us +1 because rank diff is ours (3) - his (1) = 2
3 * 2 / (7 + 1) < 1
Adding Egypt, our rank is 4, so rankDiff is 3.
3 * 3 / 8 > 1, so now we get the +1.
Ethiopia got the +1 with or without Egypt.
--------------------------------------------------------------------------------------------------
Peter is a little tougher
iBetterRankDifferenceAttitudeChange of 2
SB (rank 6) - Peter (rank2) = 4
2 * 4 / 8 = 1, so SB gets +1 diplo
Ergo, all we have to do is get SB above one player on the score graph. Rank diff would be 3.
Arabia 754
Holy Rome is 744
SB is 674
So a couple tech gifts should do it after Nationalism
Music and currency might be enough, but I think we should consider MC again, cus I don't really want to give Constitution (something Peter doesn't have), nor are we giving Paper.
Or, we could let him get Feudal, but no one likes that idea I'll bet.
Or population can change. SB can grow, Sal or Holy Rome could whip (or grow)