Back to Editor's Guide


Heroes in Betrayal


Hero Selection

Each player in Betrayal selects a hero at the beginning of the game to be that player's main avatar.  Rather than inundating new players with some absurd number of choices, the game picks three to five hero types at random and offers a choice between those (each player's set of choices is selected independently).

Once selected, heroes begin the game at level 1, with a scroll of town portal and 50 gold.

Heroic Attributes

The heroes in Betrayal work a little bit differently than you may be used to from melee games (and the multitude of custom maps that have adopted melee conventions).

None of these conventions is a hard-and-fast rule, but they're there to keep expectations in line with reality and help prevent unbalancing edge cases or power creep.  You can break them, but you should follow them unless you have a good reason.

Attributes

The standard attributes of strength, agility, and intelligence have been assigned slightly unusual functions in this map:

Starting attributes have an average value of 40.  A starting value of 50 is high and a starting value of 55 is very high; similarly, 30 is low and 25 is very low.

By convention, the primary attribute rises by 3 per level, and the other attributes by 2 per level.

Also, heroes have 25 base HP (with 0.25 regen), 200 base speed, and no base mana.  Base armor is around 2 for tanks and 0 for ranged (though there's another -5 from gameplay constants to handle the high base agility).  A hero's attack damage is typically 23 + 2d6 with a cooldown of around 1.5 for melee and a bit longer (e.g. 1.6) for ranged.

If you work all that out, you'll find that a hero with average starting attributes will have 345 health, 200 mana, 280 speed, 3 armor (plus base), and 20 DPS (or a bit less for ranged attackers).  Also, all heroes naturally regenerate both health and mana at a rate of 1% per second, regardless of attributes (max and regen rate increase in proportion).  If two level 1 melee heroes fight (without tactics, abilities, or items), one of them should die after around 23 seconds.

Sight range is typically 800 at night (it's always nighttime in the map) and 1200 for day (the Torch item grants ultravision).

Betrayal also doesn't use the "Hero" attack and armor types for heroes; instead, heroes should generally have Normal, Piercing, or Magic attacks and Light, Medium, or Heavy armor.  The damage ratios for these types have been modified to the following:

  Light Medium Heavy
Normal 80% 125% 100%
Piercing 125% 100% 80%
Magic 100% 80% 125%

You can undoubtedly guess which of those types is typically associated with each of the standard melee/ranged/caster archetypes, but you're not required to follow those archetypes.

Skills

As in melee, heroes are expected to have 3 "normal" skills plus one "ultimate" skill.  However, the numbers work out a bit differently than normal.

Level 1 heroes in Betrayal start with 3 skill points, rather than 1 (though they still gain 1 per level).  Regular skills still have a level skip requirement of 2, but have an initial level requirement of -2, so a hero can place 2 points into the same skill at level 1, and a third point at level 2.  Regular skills have 5 levels total.  Ultimates have only one level, and become available at level 5.

Heroes also all get an innate skill called Sprint, which gives a brief boost to movement speed and the ability to move through other units, and a hidden ability that allows detection of invisible units at very short range (200).

Tactical Considerations

Remember that splitting up is encouraged, and any hero could end up being the Traitor, so every hero needs to be able to function on his own.  In most maps, I would encourage people to throw in a few support-oriented heroes, but they just aren't suitable to this map (unless they're designed to support minions that they first summon, or something like that).

Also, the map is pretty big (for the number of units), labyrinthine, and has few specific points to attack or defend, so expect guerilla tactics to be used a lot.  Every hero should have some method for coping with enemy hit-and-run attacks (without being invulnerable to such tactics).  There are a variety of ways to accomplish this:

You may notice that most of those are also useful for making hit-and-run attacks.  How about that.

Killing (or even incapacitating) a single enemy hero will often be a major victory, so it shouldn't be too easy.  For example, nukes that can take off half a hero's health at once are probably not a good idea.  Also be careful with anything that can stun, immobilize, disable attacks or spells...you're probably already familiar with this list, so I won't belabor the point.

Skills that have more than one tactical use or that can be used in creative ways are highly encouraged.  The Crusader's Holy Light skill has different effects depending on whether it's used on an ally (healing), an enemy (a faerie-fire-like effect), or a point (adds armor to allies while they remain near that point), and also has special interactions with some of the forest's uniques.  The Ranger's Tranquility is good both for hiding and for healing.

Skills that don't require any thought to use are discouraged; the player only gets one hero, so make it interesting.  Passives are probably not a great idea, unless they force some change in tactics.  Buffs should usually have a mana cost or cooldown high enough that the player can't keep them "always on."

Creating Heroes

Creating the Hero and Skills

As usual, create a hero in the object editor and enter in appropriate data.  In addition to relevant art and stats, don't forget to set all costs to zero (including food cost) and add an appropriate tooltip (by convention, hero tooltips list the hero's skills at the end--take a look at an existing hero, such as the Crusader, for an example).

Hotkeys apparently don't work for units purchased from a shop like this, so you don't need to worry about them (even if they did work, we still probably wouldn't use them, as avoiding conflicts could be very difficult).

You'll also need to create appropriate hero abilities.  Again, by convention, regular skills have 5 levels, a level skip requirement of 2, and an initial level requirement of -2.  Ultimates have 1 level and a level requirement of 5.

Tooltips for abilities are also a bit unusual.  The tip for learning an ability looks like this:

Notice that the mana cost and cooldown of the ability are listed in special colors at the top of the description (color codes are |cffcc00ff and |cff909090, respectively).  Then, the ability's function is listed, but the part that changes according to level lists a range: the value at level 1, two periods, then the value at level 5, all colored in lime green (|cff00ff00).  After the description, there's some flavor text, printed with a color code of |cffa0a0ff.  Note that you can understand exactly what the ability does without reading any of the flavor text.  The flavor text is optional, but encouraged.

This doesn't always indicate to the player exactly how the ability functions at each level (since the numerical change may not be linear), but it gives a succinct indication of how the ability works, and how it becomes better as you put more points into it.

Use precise numbers whenever practical.  This tooltip could have just said something like "makes your attacks deal damage-over-time," but it's hard for the player to know how good the skill is or how best to use it without knowing things like how long it lasts or how much damage it inflicts.

Sometimes the mana cost or cooldown will change with the skill's level.  That's fine; print a green range for the part that changes.  For example:

You can also have more than one green range in the tooltip, if more than one number changes as the spell increases in level.

The regular tooltip for the skill (after it's learned) looks essentially the same.  However, the mana cost is removed (since the game engine already shows it), unless it's something unusual, like a variable triggered cost, or a cost-per-second (as with Immolation).  Also, the green part of the tooltip now only shows the value for the current level, instead of a range:

Once you're done, add your hero's abilities to the hero.  If you didn't copy-paste an existing Betrayal hero, don't forget that you should usually add the abilities "Sprint" and "True Sight (Hiding Book)" to the list of the hero's regular abilities (there should also be an inventory in there).

Making the Hero Playable

Once you've created your hero (and associated skills) in the object editor, adding him/her/it into the map is pretty easy.  Go to the "Common Data Initialization" trigger (in the Initialization category) and scroll down until you find a section that looks like this:

Add a new entry in the HeroTypes array for your hero (using the next available index number), and then a corresponding entry in HeroPrimaryAttributes indicating--you guessed it--that hero's primary attribute (ATTR_STRENGTH, etc. are "constant" variables that have been predefined to make the code more readable).

Also change the line setting NumberOfHeroTypes to reflect your addition.

Once you've done this, your new hero will begin to show up as a random choice for players at the start of the game, just like the pre-existing heroes.

However, for testing purposes, you may want to make sure your hero is selectable all the time.  The easiest way to do this is to find the "Choose Hero" building (in Units/Custom/Human/Melee/Buildings) and add your hero to the "Techtree - Units Sold" field (make sure to clear it again when you're done testing).

If you don't want your hero to be one of the standard player heroes--for example, if it's used as part of a special event or scneario--then you shouldn't add it to this trigger.  If you still need the engine to recognize your hero as a standard type, you'll need to add it to this list in some trigger that runs after map initialization.  If it's a Haunt-specific hero, then that Haunt's initialization trigger may be a good place, like this:


Back to Editor's Guide