Faction Overview: Coven

Coven is the first proper faction to be included in RoH. If you haven’t seen the first draft suggested by revesvans on reddit, you can see it here, along with the town screen concept.


Raven. Witch’s familiar. Weak in battle, but helps with scouting.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
1 3 2 1-2 4 7 12 21 35G
Special: Flying, Scouting

Valravn. Raven of the Slain. Valravne are created from ravens who fed on the bodies of dead soldiers. Wolf-like aspects make these creatures a better fit for combat.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
1+ 4 3 2-3 6 9 14 21 50G
Special: Flying, Scouting

Moon Sister. Apprentice witch. She’s good with hexes and a sickle.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
2 6 6 1-4 12 7 10 13 180G
Special: Flying, Spellcaster (9 mana, [Hex])

Heartless. Men whose hearts are kept at the Blood Altar, forcing them to serve the Circle of Moonrise. Sturdy melee fighters.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
3 8 10 4-5 30 3 7 8 240G
Special: None

Wildcat. Large feral feline. Sharp claws, thin hide.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
4 11 10 6-10 35 6 11 5 400G
Special: Large

Panther. A wildcat warped by the witches’ powers. It merges with the shadows, invisible while stalking its prey.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
4+ 12 10 8-12 40 8 11 5 450G
Special: Large, Invisibility

Hollow Treant. Evil tree that grabs and devours travelers unfortunate enough to pass through its forest. Slow and powerful melee unit.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
5 9 13 10-14 65 4 7 3 600G
Special: Giant

Mora. Creature of nightmares, this shadowy monster roams the mountains. It strikes utter fear into the hearts of those close enough to see its features.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
6 16 10 15-25 80 7 11 2 1100G
Special: Giant, Aura of Fear

Yaga. A giant humanoid creature that resembles an old, deformed human woman. It is a powerful spellcaster and a shapeshifter.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
7* 18 18 30-40 150 5 12 1 4000G + 1Cr
Special: Giant, Spellcaster (50 mana, […]), Transform

Rasvelg. Monstrous flying bird, also known as the corpse swallower. Flies fast, strikes hard. It is rumoured that Rasvelger are related to Yagi.

Tier
OffOffense
DefDefense
DmgDamage
HP
SpdSpeed
InitInitiative
GrwGrowth
Cost
7* 18 18 30-40 150 11 8 1 4000G + 1Cr
Special: Giant, Flying, Transform

GUI Update

By no means finished, but a solid foundation going forwards. I tried to make it adaptive, mostly for my own sake: it should work with any resolution more or less properly.

Anyway, here goes:

Besides GUI, I’ve also been moving most of the stuff that’s been hardcoded out into the data. It’s mostly a “what I wish the data would look like” at this point, but the build tree is already loaded from disk in the video. Here’s what a Rasvelg (Coven T7 unit) file looks like:

id: rasvelg
tier: 7
statistics:
    offense: 18
    defense: 18
    damage: 30..40
    hits: 150
    speed: 7
    initiative: 10
    growth: 1
    cost: 4000g+1cr
abilities:
    - flying
    - giant
    - <inline>:
        id: transform
        type: action
        when:
            - battle
            - army
        condition: >
            (inTown() && town.isFaction("coven") && town.built("coven/walking-hut")) ||
            (inHeroArmy() && hero.visited("coven/walking-hut"))
        effect: |
            stack.trainTo("coven/yaga");

That <inline> ability should allow creature-unique abilities to be defined in-place. Normally you’d reference a shared ability (e.g., flying, spellcaster).

Last but not least: scripting! After some deliberation I’ve settled on ChaiScript over Lua, as it promises smoother integration with modern C++. We’ll see about that, but meanwhile it’s been fairly frictionless. In fact, that drop-down console feeds into a ChaiScript interpreter.

+ Credits

Coven town background by u/revesvans.

Witch portrait placeholder — Witch by Mark Belokopytov under CC BY-ND 2.0.

Raven icon by Lorc under CC BY 3.0.

Castle (heavily modified) by Delapouite under CC BY 3.0.

Hero sprite placeholder — capital "H" of Morris Roman font by W. Morris, 1893.

Spellcaster Creatures

GUI update coming along next week or so. Hopefully.
Edit 2018-08-20: HAHAHAHAHAHA. Oh the naïveté.

Second-level creatures of the Coven faction are Moon Sisters, neophyte witches of the Circle of the Moonrise. Moon Sister is a flying spellcaster creature, able to cast one spell — Hex — on an enemy stack. When implementing spellcasters, there are a few possible approaches seen before in HoMM.

There's a Genie approach: the creature casts a spell at a fixed level of mastery, with a fixed effective spell power. There's a problem with that approach, especially with cheaper lower tier units. What's to stop the player from filling every vacant slot in the hero's army with 1-stacks of Moon Sisters and proceeding to Hex every single enemy stack essentially for free? Instant value, negligible trade-off, especially in the early game.

Like every other unit in the game, spellcasters' power should increase with the size of the stack. One way to accomplish this would be to give those units an extra stat — Spell Power. It can even be a range, say, 0-1 for Moon Sisters. Even then, amassing a hundred 2nd-level units isn't all that hard, which results in the stack casting Hex with fifty-odd Spell Power fairly early on. Whichever part of Hex is controlled by Spell Power, be it effect or duration, after a certain point having a larger stack becomes useless: a fight isn't going to drag on for fifty turns, and rare creature's defense exceeds fifty.

All this has been said with an assumption that Hex is a spell like any other, and that it's available to heroes. But what if it isn't? What if spells available to the creatures were a different class of spells entirely? While hero's abilities grow relatively slowly, gathering a considerable amount of spellcasting creatures is quick. We can account for that in the spell itself, toning it down to reasonable levels of power.

HoMM5 went a similar, yet different route, allowing creatures to cast hero spells, but making spell power of a stack grow logarithmically with stack size, instead of linearly. That addressed the problem of heroes relying on 1-stacks of spellcasters, but did little to mitigate the value of splitting stacks. While splitting melee units is generally counterproductive, 1-stacks notwithstanding, splitting a ranged stack in half is generally a good tactic on its own: you don't deal more damage, but you can damage several enemy stacks, and you don't run the risk of losing all of your shooters to a single massive attack. By splitting a stack of spellcasters (most of which are ranged units) in twain, you once again create value.

So Hex is a creature-only spell that scales linearly with spell power. It needs to be useful at low level, when the number of creatures is around a dozen, yet not totally overpowered in late game with several hundred Moon Sisters at the player's disposal. Spell power affecting the spell's duration would quickly get out of hand, so it must affect the effect instead.

Here are some possibilities I've come up with:

  1. extra damage is dealt to the target stack with each melee attack made against it;
  2. reduce defense by amount proportional to spell power divided by the number of creatures in the stack;
  3. same as (2) but affect attack instead;
  4. (2) and (3) at the same time, but lesser effect.

Snowballing

Let's talk about feedback loops.

There are essentially two ways for a player's success (or failure) to impact later stages of the game. In a positive feedback loop, a success causes future successes, or vice versa, resulting in a snowball effect. In a negative feedback loop, a success comes with a drawback that makes future successes harder to achieve. If you want to learn more about feedback loops in games, check out this article or this video by Mark Brown.

HoMM is built almost entirely on positive feedback loops:

  • getting more resources leads to getting more troops that help clear way to more resources;
  • being stuck with no resources makes the player unable to recruit troops and get more resources;
  • losing troops in early game leads to losing precious momentum as you can't break out of your starting area, so while your opponents expand and scout around, you're stuck waiting for start of the next week;
  • extra towns grant more gold and troops.

There are negative feedback loops too:

  • building up second town takes double the resources, but the number of mines you control doesn't increase;
  • more towns you capture means more towns to defend; discounting Town Portal, that means your main army is weaker than it could've been.

but those don't outweigh the snowballing effect.

Positive feedback loop isn't necessarily bad, but it does mean that the player lagging far enough behind may as well give up. On the other hand, a strong negative feedback would draw out the game, making it even longer.

So, what now? I want to counteract the early-game failure compounding, and dampen early- to mid-game snowballing. Biggest offenders are losing troops and extra towns, respectively.

One way to counteract snowballing is to introduce an upkeep cost: the more towns you have and the further apart they are, the higher the cost. This forces the expansion to take longer, as the player has to spend turns and resources making sure they can afford that extra town, or spend time recovering from having no resources due to short-sightedness.

Dealing with compounding losses is trickier. If you lose an army, you lose an army, there's no getting around that. But maybe, if you win a fight with heavy losses, you recover a portion of lost troops? Give each hero a persistent Healing Tent that will let them recover, say, 100 HP worth of troops after battle. That's a hefty boost in early game, but becomes almost worthless in late game.

Breaking: Programming is Hard

I may have rewritten the entire source code since last post. Let me explain.

So I started restructuring the game based on stuff you've seen in previous post, and some small stuff you haven't. GUI was getting overcomplicated, so I started to pull different states into dedicated classes. Then it turned out pathfinding was coupled with almost everything, such that when I tried to move it from movement component to the game board everything broke. After I jumped from file to file adjusting little details I thought it'd be easier to just throw everything away and rewrite it from scratch.

Wasn't as bad an idea as it might seem. Of course, I didn't really throw everything out. I just started writing from scratch, taking parts of old code and fitting them where appropriate. And it's worked out okay so far, the only thing missing from this new version is movement. So fingers crossed, and please put all your comments about how stupid that was in the reddit discussion.

Also (who would have thought) GUI programming is hard! It seemed so much simpler at first. I mean, it's just a button, right? Well, a simple button drags with it enough stuff that I'm already considering putting GUI aside until later. Bu-u-ut I suppose there's no better time to figure it out than now. Although now that philosophy lectures have ended my productivity might decline.

Bloody hell, October already?

Don't have much to show for all that time, to be honest. Life's been kinda hectic, and RoH had to take a back seat. In the brief moments of free time I thought a bit about code structure and how to best manage modules without too much coupling. Even drew a few diagrams, like I'm an adult or something.

Apparently I'm most productive during philosophy lectures.

So what came out of all that was basically an overhaul of the graphics system. It's still in progress, but it's not really impeding anything else. (Side note: I really need to use git more for proper feature branch management. The way I'm doing things right now is a mess.)

As the stuff I can show for all this time — minimap! Also, the game board isn't restricted to the size of the window anymore, and I've added some basic scrolling, but I'm not going to make a whole video just for that. Just gaze upon that glorious minimap for now.

Screenshot at 2017-10-13 20:04:02.png

... Okay, turns out I've done more than I remembered at first. Good on me.

Town screen and music

I think it's a good sign that I was able to pick the project back up after almost two months long break. Though, to be fair, I am the one who wrote the code in the first place. Still, one can hope it's not going to be an unreadable mess once released into open-source.

So last time in the "I'm not dead" post I showed you the first steps with the resource manager. It's grown since then. Sprites, sounds, and music, oh my. Parallel with that, I started working on game states, and made a faux-town screen to show. See for yourself:

It really is coming together, isn't it.

Next up — probably some basic GUI, with some more polish for graphics and sounds, fade-outs and transitions and whatnots.

Town screen background is Coven by brilliant reddit user u/revesvans.

Sprites are Cavalry, Stone Pile, and heavily edited Castle by Delapouite and Crystal growth by Lorc. Music is Angevin by Kevin MacLeod. Horse sound effect lifted from HoMM III (you're not gonna believe how hard it is to find a suitable free gallop sound effect!).

Nation of Pehaam

Pehaam is a nation ruled by a coven of witches known as the Circle of Moonrise. Fearsome creatures roam its forests, and spellbound soldiers comprise its armies.

The Circle of Moonrise appeared some 120 years ago, and established itself at the border between then warring Ithear and Ashea. As the coven grew more and more powerful, feeding on the deaths of soldiers, its magic started warping the forests and the mountains around the coven's grounds. Ferocious animals, shadow creatures, and horrifying walking trees filled the area, striking fear into the hearts of local people.

Soon, surrounding villages pledged themselves to the coven, begging the witches to protect them from their own creations. They would give their sons and daughters to the Circle as their tribute. The daughters were to become the younger Sisters of the Circle and the sons, through blood magic, the mighty Heartless warriors, fully subservient to the coven.

These days Pehaam, still ruled by the thirteen witches of the original coven, is wholly separate from both Ithear and Ashea, both of which dare not test its borders. Inside Pehaam, most of the monstrous creatures have been exiled to the forests and mountains, leaving plains to the people.

Creature Upgrades

Let's talk about creature upgrades.

Being able to upgrade a creature is a double-edged sword. On one hand, you can still have army of a bit weaker basic creatures if you're short on resources, and upgrade them later, if ever. On the other hand, basic creatures may be underwhelming or completely useless compared to upgraded version (looking at you, Vampire Lords), and you are forced to spend a turn of building and extra resources on getting access to upgraded version of the creature.

The Heroes III approach of "ᴜᴘɢʀᴀᴅᴇs ғᴏʀ ᴇᴠᴇʀʏᴏɴᴇ, ғʀᴇᴇ, ᴀɴᴅ ʟᴇᴛ ɴᴏ ᴏɴᴇ ɢᴏ ᴀᴡᴀʏ ᴜɴsᴀᴛɪsғɪᴇᴅ!" is unhelpful at best. You can even tell that some creatures only had upgrades because they had to — way too many Queens and Kings for one army.

No. Upgrade is a privilege, not a right. Some creatures get that advantage of getting stronger if you pour some more resources into their training. Skeletons don't need an upgrade, their strength is in numbers thanks to Necromancy. Hippogriffs and Pegasi are already mystical flying creatures, they don't need an upgrade to present challenge on the battlefield.

Having said that, here are some upgrade guidelines I made for myself when thinking over factions and their creatures.

  • An upgrade is justified when:
    • upgraded version is connected to the basic version by lore or theme (e.g. Vampire Spawn ⇒ Vampire, Hellhound ⇒ Cerberus);
    • it's an upgrade of gear on a gear-based creature (e.g. Swordsman ⇒ Knight);
    • it changes attack method of the creature (e.g., double attack, spellcasting, melee ⇒ ranged).
  • If upgraded creature's name is basic creature plus any of King, Lord, Master, or similar, rethink your decisions.