Christoph Kümper

HeroBattle

HeroBattle is my current project. The idea of HeroBattle came from the game Guild Wars, where it was a PvP mode. HeroBattle got later replaced by another PvP mode. Because I loved HeroBattle and the many interesting AI challenges it offers, I ever wanted to create a standalone version of this game mode. Last year I started to create a prototype using the Unreal Engine 4. The prototype was used for my Bachelor Thesis where I created the AI and the skill representation for the game. I also used the prototype to evaluate, if UE4 is suitable for this type of game and to disclose the problems.

 

Right now the The prototype has following features:

  • AI which can use the implemented skills
  • 24 Skills created from a XML file
  • Capture Points
  • Spawn Points
  • Multilayer
  • Flags (used to set the position where the hero should move to)

General Information

 

Herobattle was originally a PvP mode of Guild Wars, where two Players fought each other. Each player had their own character as well as a party of three AI-controlled heroes. The player had full control over the skill selection and equipment of all four characters. The goal of Herobattle was to gain 20 points before the enemy does. There are two methods to get points: First, killing a Hero or Player yields one point. Second, capturing shrines, tactical points within the arena, yield points over time, granting points faster the more shrines are under a player’s control. Capturing shrines was often done by Heroes, so it was important that heroes are able to fight on their own without too much intervention of the player. If a character died, they’d respawn automatically after 30 seconds.

Interface

Warrior Build

 

The Warrior fulfilled the physical damage role. Its build consists of spear attack skills and stances to boost its attack and movement speed. In order to use its skills it need to build up adrenaline. This can be done by attacking the foe or using Enraging Charge or Lion’s Comfort.

SlotSkill NameDescription
1Barbed Spear"Range Attack" If this attack hits, your target begins Bleeding for 17 seconds.
2Maiming Spear"Range Attack" If your attack hits a Bleeding foe, that foe is Crippled for 17 seconds
3Blazing Spear"Range Attack" If this attack hits, it deals +21 damage and sets target foe on Fire for 3 seconds.
4Stunning Strike"Range Attack" If this attack hits, you deal +25 damage. If it hits a foe suffering from a condition, that foe is also Dazed for 9 seconds.
5Flail"Stance" For 14 seconds, you attack 33% faster but move 33% slower.
6Enraging Charge"Stance" For 14 seconds, you move 25% faster. Enraging Charge ends when you successfully strike a target, at which point you gain 3 strikes of adrenaline if you hit with a melee attack.
7Lion's Comfort"Skill" All of your signets are disabled for 12 seconds. You are healed for 106 Health, and gain 2 strikes of adrenaline.
8Shield Bash"Stance" For 11 seconds, while wielding a shield, the next attack skill used against you is blocked. If it was a melee skill, your attacker is knocked down and that skill is disabled for an additional 15 seconds.

Elementalist Build

 

The Elementalist fulfilled the magical damage role. Its builds consist of fire damage skills and buffs to maintain the mana (energy). It also has two defensive skills: Mirage Cloak and Mystic Regeneration. These skills are used to heal itself and reduce the incoming damage.

SlotSkill NameDescription
1Mind Blast "Spell" Target foe is struck for 57 fire damage. If you have more Energy than target foe, you gain 8 Energy.
2Immolate"Spell" Target foe is struck for 71 fire damage and is set on fire for 3 seconds.
3Glowing Gaze"Spell" Target foe takes 47 fire damage. If that foe is on Fire, you gain 5 Energy plus 1 Energy for every 2 ranks of Energy Storage.
4Aura of Restoration"Enchantment" For 60 seconds, you gain 1 Energy and are healed for 400% of the Energy cost each time you cast a spell.
5Glyph of Lesser Energy"Glyph" For the next 15 seconds, your next 2 spells cost 15 less Energy to cast.
6 Fire Attunement"Enchantment" For 52 seconds, you are attuned to Fire. You gain 1 Energy plus 30% of the base Energy cost of the skill each time you use Fire Magic.
7Mystic Regeneration"Enchantment" For 13 seconds, you have +3 Health regeneration for each enchantment (maximum of 8) on you.
8Mirage Cloak"Enchantment" For 4 seconds, you have a 61% chance to block incoming attacks. When you cast this enchantment, all nearby foes are struck for 26 earth damage.

Monk Build

 

The Monk fulfilled the healing role of the team. Its build consists of healing skills and protection skills.

SlotSkill NameDescription
1Word of Healing"Spell" Heal target ally for 94 Health. Heal for an additional 109 Health if that ally is below 50% Health.
2Signet of Rejuvenation"Signet" Heal target ally for 71. If target ally is casting a spell or attacking, that ally is healed for an additional 71 Health.
3Shielding Hands"Enchantment" For 8 seconds, damage and life steal received by target ally is reduced by 13. When Shielding Hands ends, that ally is healed for 35 Health.
4Guardian"Enchantment" For 5 seconds, target ally has a 50% chance to block attacks.
5Cure Hex"Spell" Remove one Hex from target ally. If a Hex was removed, that ally is healed for 114 Health.
6Mend Ailment"Spell" Remove one condition from target ally. For each remaining Condition, that ally is healed for 66 Health.
7Balanced Stance"Stance" For 14 seconds, you cannot be knocked down and you do not suffer extra damage from a critical attack
8Disciplined Stance"Stance" For 3 seconds, you gain +10 armor and have a 75% chance to block attacks. Disciplined Stance ends if you use an adrenaline skill.

Skill Representation

 

The skills are described in a XML file. Each skill is divided into two blocks: "Properties Block" and "Impact Block". The "Properties Block" contains information like cast time, cool down and skill range. The weapon tag is an optional tag and indicates if the skill requires a specific weapon.

The "Impact Block" describes the mechanic of the skill. Therefor the skill mechanic is split into different components. Each component represents one mechanic aspect of the skill. This means for example for the skill “Immolate” which applies damage and the condition fire that it has a damage component and a condition component.

Every component has a corresponding C++ Object which contains an init function a run function and a getScore function. There is also a skill Object which contains the information from the properties block and a list of the components of the skill.

 

The init function is used by the XML parser to initialize the object with the data from the XML file.

void UBcBlock::init(FBuffContainer bContainer, ABaseCharacter* owner, FSkillProperties properties, UBuff* ownerBuff)
{
	Super::init(bContainer, owner, properties, ownerBuff);
	FXmlNode* node = bContainer.node;
	m_BlockType = SkillEnums::stringToSkillType(node->GetAttribute(TEXT("type")));
	FString sUsage = node->GetAttribute(TEXT("usage"));
	if (sUsage.Equals(TEXT("INF")))
	{
		m_HasUsages = false;
	}
	else
	{
		m_HasUsages = true;
		m_Usage = FCString::Atoi(*sUsage);
	}
	m_BlockChance = bContainer.scaleTable[owner->getAttributeValue(bContainer.scaleAttribute)];
}

The run gets called when the skill is executed and contains the functionality of skill.

//Example run function of the damage component
bool UScDamage::run(ABaseCharacter* target, ABaseCharacter* self, FString SkillName /*= TEXT("Name")*/)
{
	ABaseCharacter* testTarget = getTarget(target,self);
	Super::run(target, self);
	float damage = scaleTable[self->getAttributeValue(m_ScaleAttribute)];
	if (m_properties.skillType == SkillType::MELEEATTACK || (m_properties.skillType == SkillType::RANGEATTACK))
	{
		FWeaponValues weapon(m_properties.weaponType);
		damage += weapon.getDamage();
	}
	target->damage(self, damage, damageType);
	return true;
}

The getScore function is the utility function of the component and is used by the AI to evaluate the skill.

void UBcBlock::getScore(ABaseCharacter* caster, FCharacterState state, USkillScore* skillScore, float duration)
{
	float durationScore = (m_BlockChance/100.f) * duration / 1.5f;
	int count = 0;
	if (m_BlockType == SkillType::ATTACK)
	{
		count = characterState.attackers;
	}
	else
	{
		count = characterState.caster;
	}
	float blockCountScore = (m_BblockChance / 100.f) * count;

	float score = (durationScore * blockCountScore) / 2;

	if (score > 1)
	{
		score = 1;
	}
	if (score < 0)
	{
		score = 0;
	}

	skillScore->addScore(score, TEXT("block"));
}

AI

 

The AI was subject of my Bachelor Thesis (Semantic AI for the Game HeroBattle). The main goal was to build an AI which uses the same skill representation as the game mechanic. This representation is used to create utility functions for the skills of HeroBattle. These functions are used by the Utility System and the Temporal Planning to evaluate the actions of the Heroes to find the next action for the Heroes.

The result is a semantic AI, which uses the skill representation to understand and use the skills from HeroBattle in the right situations. The AI is also able to indicate skill synergies. A Skill synergy is for example between the skills Immolate and Glowing Glaze. In order to get energy from the skill Glowing Glaze the foe has to burn.

The AI also uses a Blackboard to communicate between allied Heroes. Therefor the Blackboard saves all planned actions of all allied Heroes. With the Blackboard it's also possible to simulate future gameStates, which is used by the temporal planning.

For further information about the AI, the skill representation and the Implementation contact me and I will send you my Bachelor Thesis. I can also give you access to the repository.