The mechanics are rule based.
- If you have only one hero. He, he gains experience for the creepcreeps killed anywhereno matter where he is on the map.
- If you have multiple heroes. A, a hero gains experience when he or any unit under his "command" kills a hostile unit. If multiple heroes are commanding a unit that makes a kill, then the XP is split evenly.
- If no hero "commands" the unit that makes the kill, then all heroes, share the XP.
So, now we know which hero will get the XP. But when the hero killsWhen getting experience from a creep, you getthe hero only gets a percentage of the XP ( that he would have received had the hostile unit not been a creep ) depending on your hero level. So level 1 hero -> 80%, level 2 -> 70%, level 3 -> 62%, level 4 -> 55% anddepending on the hero's level 5 -> 0%.
- Level 1 -> 80%
- Level 2 -> 70%
- Level 3 -> 62%
- Level 4 -> 55%
- Levels 5+ -> 0%
Hence, if you are supposed to get 100 exp, which is to be shared between 2 heroes of level 2 and 3, they will each receive 5070% = 35 and 5062% = 31, respectively. WhichThis is worse than hadif only the lower leveled one of them commandgot the creepingexperience ( 10010070% = 70 orvs. 10062 = 62 ).
That is why, you creep with just one hero, if heroes are of different levels.
Source: http://classic.battle.net/war3/basics/heroes.shtml
Edit: "commands" ( itit is not defined in the page ), - I think this means, that the hero is actively engaged in combat along with unit in question. This unit can be in a defined radius of the hero. IIRC, that radius is 600, but I don't have sources for that.