Oh noes that's how is it in WoW, can't happen not harsh enough!!
Seriously though, it should be by damage between group of players and NPCs and even for group of players.
So if 2 guys with 1 guard beat some deathclaw, while that guard does 50% of the damage, they will share 500 xp between them, and probably you can even add small bonus to shared value when more players are grouped together ( so 4 players could share say 600 xp )
Well I've just read about the WoW system of sharing exp. The catch there is that the shared experienced is based upon a player level.
Here's a simple example:
PlayerA and PlayerB are in a party mode.
PlayerA has level 15
PlayerB has level 10
Creature exp reward equals to 500exp.
For killing the creature players get:
playerA exp gain = 15/(10+15) * 500*1.0 = 300
playerB exp gain = 10/(10+15) * 500*1.0 = 200
You can also add modifier to the final experience gain based on the amount of players in a group, e.g.:
2 person group = 1.0
3 person group = 1.2
4 person group = 1.3
5 person group = 1.4
And in the end the general formula for shared exp valid for two players that killed one creature:
playerAexpGain =
[ playerALevel / (playerALevel + playerBLevel) * modifier
] * creatureExpRew
playerBexpGain =
[ playerBLevel / (playerALevel + playerBLevel) * modifier
] * creatureExpRew
restriction:if the expresion in
[] is greater than 0.5 it should equal to 0.49
I have to say that after all this method of exp counting seems to me even better than the other one that is based merely on damage dealt.