• 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.

Gameplay Constants "Hero Revive Cost"

Level 21
Joined
Mar 16, 2008
Messages
964
Can anyone explain how the "Hero Maximum Revive Cost - Time" and "Maximum Time Factor" and "Time Level Factor" settings work? Also does anyone know if these are some of the constants that should not be edited? Thank you for any ideas.

1722540117590.png

Would anyone know the JASS to access the hero's revive time?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
There is no way to access a hero's revive time, but you could just calculate it yourself.

This is recent info I found in a reddit post:
The formula is revivetime = 55 seconds * level * 0.65
So it rounds up to 36 and 72 at levels 1 and 2 respectively, and rounds down to 107 at level 3.
It would continue to 143 seconds at level 4, all the way up to 356 seconds (almost 6 minutes) at level 10.
They capped it at 110 seconds because losing your hero at level 10 was so punishing. It took forever to get back, and that was back before taverns were around.
But in my tests I get 35/70/105 seconds using the default constants:
  • begin
    • Events
      • Unit - A unit Begins reviving
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 1000.00 seconds
  • finish
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (String((Elapsed time for Timer)))
I'm not sure why these values don't match the information above, but there could be several reasons (rounding down, misinformation, events/timer have a 1 second difference, etc).

Edit (again, again, again):
So your calculation could look like this:
  • Actions
    • -------- Edit these to match your constants / unit data: --------
    • Set Time_Base = 55.00
    • Set Time_Limit = 150.00
    • Set Time_Level_Factor = 0.65
    • Set Time_Max_Factor = 2.00
    • Set Time_Hero_Level = (Real(Hero level of your unit))
    • -------- Math time: --------
    • Set Time_Limit = (Min((Time_Base x Time_Max_Factor), Time_Limit))
    • Custom script: set udg_Time_Result = udg_Time_Base * udg_Time_Hero_Level * udg_Time_Level_Factor
    • Custom script: set udg_Time_Result = RMinBJ( (udg_Time_Result + 1.00) - udg_Time_Hero_Level, udg_Time_Limit )
    • -------- Final result: --------
    • Set Time_Result_Integer = (Integer(Time_Result))
    • Game - Display to (All players) for 30.00 seconds the text: (String(Time_Result_Integer))
Modify the variables to match your changes in the Gameplay Constants and take into consideration my results down below. Note that I may have made a mistake here, the added 1.00 second as well as subtracting the hero level at the end seem to work but I can't say for certain that it's 100% correct.

Time_Base is the Stats - Build Time found in the Object Editor. (Thanks Chaosium)
Time_Limit is the Hero Maximum Revive Cost - Time. (Gameplay Constant)
Time_Level_Factor is the Hero Revive Cost - Time Level Factor. (Gameplay Constant)

HOWEVER, I'm still not 100% sure what Hero Revive Cost - Maximum Time Factor does. In my tests I found these results:

Time Factor 1x, Lvl 1 Hero = 35 sec
Time Factor 1x, Lvl 2 Hero = 55 sec
Time Factor 1x, Lvl 3 Hero = 55 sec
Time Factor 1x, Lvl 5 Hero = 55 sec
Time Factor 1x, Lvl 10 Hero = 55 sec

Time Factor 2x, Lvl 1 Hero = 35 sec
Time Factor 2x, Lvl 2 Hero = 70 sec
Time Factor 2x, Lvl 3 Hero = 105 sec
Time Factor 2x, Lvl 4 Hero = 110 sec
Time Factor 2x, Lvl 5 Hero = 110 sec
Time Factor 2x, Lvl 10 Hero = 110 sec

Time Factor 3x, Lvl 1 Hero = 35 sec
Time Factor 3x, Lvl 3 Hero = 105 sec
Time Factor 3x, Lvl 5 hero = 150 sec (limit)
Time Factor 3x, Lvl 10 Hero = 150 sec (limit)

So a Time Factor of 1x seems to hit a limit at 55 seconds. Time Factor 2x hits a limit at 110 seconds. Time Factor 3x hits the expected Limit that we set of 150 seconds. I think this means that there's a hard cap equal to Build Time * Time Factor (55, 110, 165), however, if Hero Maximum Revive Cost - Time is less than the hard cap it will be used instead.
 

Attachments

  • Revive Time test.w3m
    17.2 KB · Views: 3
Last edited:
Level 21
Joined
Mar 16, 2008
Messages
964
So if base time is 15s, hero level is 60, factor is 0.2, then rez time should be 180s?

or does it work more like ( base + (base * lvl * factor) ) = 195
or simply (base * lvl * factor) = 180
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Yes, 15 * 60 * 0.2 = 180 seconds.

But this value is then capped by the Hero Maximum Revive Cost - Time set in your Gameplay Constants. It's 150 seconds by default.

It's also capped by a formula using your Hero Revive Cost - Maximum Time Factor --> 15 * 2 = 30 seconds.

The cap used is always the smaller of the two values.

So your Hero would actually have a 30 second revive time with those settings since it exceeds both caps.

But I think it would make the most sense to set Maximum Time Factor to an unreachably high value like 100 (100*15 = 1500 seconds) and rely on Hero Maximum Revive Cost - Time instead. Not too sure why there's two caps in the first place... This seems like a remnant of the past or maybe I'm just missing something.
 
Last edited:
Top