• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hero XP Reduction

Status
Not open for further replies.
Level 2
Joined
Jun 19, 2010
Messages
6
Okay so here is the deal, i've searched all over HIve and Thehelper.net for a solution for my problem, and have yet to find one, and came here hoping someone can help. I am making a RPG map, but right now my leveling system is abit outta whack. And by this, I mean if your hero is level 70, you can go kill level 16 creeps, and still get wonderful xp amounts, and just eventually this turns my RPG into a campfest. So I was wondering, is there a way to make heroes not gain xp from creeps 5 levels ABOVE AND BELOW them? Because I also don't want a hero carrying another through abunch of high leveled creeps to level them up.

I've already tried the "Creep Reduction" table under Gameplay Constants, but I may have used it incorrectly. If someone could please point me into the right direction, i'd greatly appreciate it.

Thanks!

EDIT: Basically I figured out a easier way to explain my problem. I just want a way to make a xp reduction table for UNITS, and NOT creeps!
 
Last edited:
Level 2
Joined
Jun 19, 2010
Messages
6
Both of your linked tutorials only provided information I already know about, and tried. I don't care about if a level 5 hero gains xp from a level 1, and a level 6 doesn't. I want to know how to reduce the xp a level 80 hero gets from killing a level 30 to 0, or a level 10 killing a level 80 to 0. Can someone please help me with this?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I'll give you one simple formula.

Level of aggressor/Level of victim-1

This reduces all XP to 0. Quite boring, isn't it?
However

Level of aggressor/level of victim-0.5

Now it gets interesting.
It makes it so that if the aggressor is twice the level of victim or more, then he gets no XP.

To avoid truncation you should calculate in reals:
Real(Level of aggressor)/Real(level of victim)-0.5(Which is a real)

Different values for the end
-1 = -100% XP, cos the victim must be endlessly higher.
-0.5 = Victim must not be less than 50% of the aggressor's level
-0.25 = Victim must not be less than 75% of aggressor's level

It's quite a simple formula, but it works wonders.

*Truncation is the thing that happens if you try to divide integer 3 with integer 2. You get 1, cos everything after the 3. is truncated(cut off).
*This formula also gives a smooth XP reduction, so the 0 won't be hit like a brick wall.
 
Both of your linked tutorials only provided information I already know about, and tried. I don't care about if a level 5 hero gains xp from a level 1, and a level 6 doesn't. I want to know how to reduce the xp a level 80 hero gets from killing a level 30 to 0, or a level 10 killing a level 80 to 0. Can someone please help me with this?

my tutorial did show this its all in the numbers. u have to look at the formula and make ur own. Xonoks way should do this for u.
 
Level 2
Joined
Jun 19, 2010
Messages
6
I'll give you one simple formula.

Level of aggressor/Level of victim-1

This reduces all XP to 0. Quite boring, isn't it?
However

Level of aggressor/level of victim-0.5

Now it gets interesting.
It makes it so that if the aggressor is twice the level of victim or more, then he gets no XP.

To avoid truncation you should calculate in reals:
Real(Level of aggressor)/Real(level of victim)-0.5(Which is a real)

Different values for the end
-1 = -100% XP, cos the victim must be endlessly higher.
-0.5 = Victim must not be less than 50% of the aggressor's level
-0.25 = Victim must not be less than 75% of aggressor's level

It's quite a simple formula, but it works wonders.

*Truncation is the thing that happens if you try to divide integer 3 with integer 2. You get 1, cos everything after the 3. is truncated(cut off).
*This formula also gives a smooth XP reduction, so the 0 won't be hit like a brick wall.

I don't quite understand, is this in triggers or gameplay constants?
 
Level 6
Joined
Nov 24, 2012
Messages
218
Are your creeps Neutral Hostile or a Player?

If Neutral Hostile:
2rm8pis.png

Edit that to 100,100,100,100,100,0 if you want no EXP for more than 5 levels apart.

If Player:
1.
Get rid of Hero EXP Gains and make your own custom EXP system.
Basically just getting heroes nearby when a creep dies and checking their level differences, then giving them exp.

or

2.
Use a damage detection system and for every damage instance towards a creep, check if that damage dealt is fatal (damage > remaining hp), if yes, then pick all nearby heroes and do a level difference check. If heroes more than 5 levels apart, disable his EXP gain. Run a 0.01 timer which will then re-enable his EXP gain.
 
Ehhh, this is a quick plug n play for xp and bounty, but it needs some updating to be modular and so on

http://www.hiveworkshop.com/forums/...v2-2-1-1-a-203592/?prev=status=r2&u=Nestharus

This is the function you really want for just xp (quest, party, etc)

JASS:
    function CalculateAwardedXP takes unit whichUnit, real xpBonus, integer xpLevel returns integer
        local integer level = GetHeroLevel(whichUnit)
        local real levelDifBonus = GetLevelDifBonus(level, xpLevel)
        local real xp = GetGivenXP(xpLevel)
        local real xpReq = GetReqXP(level)
        local integer award = CalculateAwardXP(xp, xpReq, 1, levelDifBonus, xpBonus)
        
        return award
    endfunction

Check out the demo map if you want =).

XP algorithm is influenced by the algorithm EverQuest uses for awarding xp, but I put on my own touches =).
 
Status
Not open for further replies.
Top