• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Do acticles about expererience system lies?

Level 9
Joined
May 24, 2016
Messages
317
So, I decided to make my own trigger exp system, and I changed game constants, using https://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=68382 acritcle as a base one to set exp values I need for hero to level up.

So I set Hero XP Required, Level factor as 130,
Hero XP Required, Previous value factor: as 0.35
Hero XP Required, Table: as 400
And guess what? When you level up into 2 level, it works just fine. But when you start leveling up further, experience needed only gets lower and lower! It makes no sence. I made a skill that only kills your allies, so there's no way blizzard function exp from killing might intervene, since killing allies wont bring any exp. I debugged killling too, so I could see unit has been getting the same exp on all levels via my scipt. And there's nothing I could see as a reason to system break. The only explanation I can get from here is that Gameplay Constants - Hero Experience acritcle this artical is wrong about exp system formula.
Pls help me.
 
Level 26
Joined
Sep 26, 2009
Messages
2,434
The article is correct. All you had to do was fill in your values into the equation from the article and you would see that it works as expected.
article said:
Experience required = "Previous value" * "Previous value factor" + "Level" * "Level factor" + "Constant factor"
Your constants:
  • Level factor: 130
  • Previous value factor: 0.35
  • Table: [ 400 ]
  • Constant factor: 0
Level 1 to level 2:
  • Required Exp = Value taken from table
  • Required Exp = 400
Level 2 to level 3:
  • Required Exp = prev_val * prev_val_factor + level * level_factor + constant_factor
  • Required Exp = 400 * 0.35 + 3 * 130 + 0
  • Required Exp = 140 + 390 + 0
  • Required Exp = 530
Level 3 to level 4:
  • Required Exp = prev_val * prev_val_factor + level * level_factor + constant_factor
  • Required Exp = 530 * 0.35 + 4 * 130 + 0
  • Required Exp = 185.5 + 520 + 0
  • Required Exp = 705
 
Level 9
Joined
May 24, 2016
Messages
317
The article is correct. All you had to do was fill in your values into the equation from the article and you would see that it works as expected.

Your constants:
  • Level factor: 130
  • Previous value factor: 0.35
  • Table: [ 400 ]
  • Constant factor: 0
Level 1 to level 2:
  • Required Exp = Value taken from table
  • Required Exp = 400
Level 2 to level 3:
  • Required Exp = prev_val * prev_val_factor + level * level_factor + constant_factor
  • Required Exp = 400 * 0.35 + 3 * 130 + 0
  • Required Exp = 140 + 390 + 0
  • Required Exp = 530
Level 3 to level 4:
  • Required Exp = prev_val * prev_val_factor + level * level_factor + constant_factor
  • Required Exp = 530 * 0.35 + 4 * 130 + 0
  • Required Exp = 185.5 + 520 + 0
  • Required Exp = 705
I set Hero XP Required, Table: as 200 back.
And guess what? It works right now.

IDK about default blizzard exp system, maybe it's up to work when you do not touch addheroexp(), but in cause you do - exp system gets broken as hell for sure.
 
Level 26
Joined
Sep 26, 2009
Messages
2,434
I've used this trigger and had no issues:
  • xp
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Hero - Add (Integer((Entered chat string))) experience to Paladin 0001 <gen>, Show level-up graphics
The trigger action is AddHeroXPSwapped() which just calls AddHeroXP().
Also tried a jass version directly and in both cases I encountered no issues. I am on latest patch.
 
Level 9
Joined
May 24, 2016
Messages
317
I've used this trigger and had no issues:
  • xp
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Hero - Add (Integer((Entered chat string))) experience to Paladin 0001 <gen>, Show level-up graphics
The trigger action is AddHeroXPSwapped() which just calls AddHeroXP().
Also tried a jass version directly and in both cases I encountered no issues. I am on latest patch.
Have you changed game constants? BTW Im doing it on 1.26, since I want my map compatible with both 1.26 and reforged
 
Top